libstdc++: Fix gdb pretty printers when dealing with std::string
commit4347fea9c28b6dc5997ef8b87e49867a071967ea
authorFrançois Dumont <fdumont@gcc.gnu.org>
Mon, 26 Sep 2022 17:14:54 +0000 (26 19:14 +0200)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Mon, 3 Oct 2022 05:01:10 +0000 (3 07:01 +0200)
tree55552e7e44ff055da49c66190c3bf22c2c87a379
parent422310150696a77657a1be5e792ca3afd18dc1d4
libstdc++: Fix gdb pretty printers when dealing with std::string

Since revision 33b43b0d8cd2de722d177ef823930500948a7487 std::string and other
similar typedef are ambiguous from a gdb point of view because it matches both
std::basic_string<char> and std::__cxx11::basic_string<char> symbols. For those
typedef add a workaround to accept the substitution as long as the same regardless
of __cxx11 namespace.

Also avoid to register printers for types in std::__cxx11::__8:: namespace, there is
no such symbols.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py (Printer.add_version): Do not add version
namespace for __cxx11 symbols.
(add_one_template_type_printer): Likewise.
(add_one_type_printer): Likewise.
(FilteringTypePrinter._recognizer.recognize): Add a workaround for std::string & al
ambiguous typedef matching both std:: and std::__cxx11:: symbols.
* testsuite/libstdc++-prettyprinters/cxx17.cc: Remove obsolete
\#define _GLIBCXX_USE_CXX11_ABI 0.
* testsuite/libstdc++-prettyprinters/simple.cc: Likewise. Adapt test to accept
std::__cxx11::list.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/whatis.cc: Likewise.
* testsuite/libstdc++-prettyprinters/80276.cc: Likewise and remove xfail for c++20
and debug mode.
* testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/whatis.cc