]> git.ipfire.org Git - people/ms/gcc.git/commit
libstdc++: Fix gdb pretty printers when dealing with std::string
authorFrançois Dumont <fdumont@gcc.gnu.org>
Mon, 26 Sep 2022 17:14:54 +0000 (19:14 +0200)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 20 Mar 2023 11:48:00 +0000 (11:48 +0000)
commit0a6e26e79798057301e5e2f56e89aec65e83161c
tree4d66b3cbdb58a22f07d66789db253222f3685bdf
parentabd85fa15043ee32483ff1daa6dee5d47c9071c4
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.

(cherry picked from commit 4347fea9c28b6dc5997ef8b87e49867a071967ea)
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