libstdc++: Fix std::any pretty printer
authorJonathan Wakely <jwakely@redhat.com>
Wed, 16 Nov 2022 12:22:04 +0000 (12:22 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 16 Nov 2022 13:37:38 +0000 (13:37 +0000)
commit3c54805d03ac1bcc3d8547ffb5e6c4e1f301a7a2
treefe996f1a3c2f9c230f8f478495f5112ec2bb06a3
parent922816220210c53eb889733b5832cbd39353ff8c
libstdc++: Fix std::any pretty printer

The recent changes to FilteringTypePrinter affect the result of
gdb.lookup_type('std::string') in StdExpAnyPrinter, causing it to always
return the std::__cxx11::basic_string specialization. This then causes a
gdb.error exception when trying to lookup the std::any manager type for
a specliaization using that string, but that manager was never
instantiated in the program. This causes FAILs when running the tests
with -D_GLIBCXX_USE_CXX11_ABI=0:

FAIL: libstdc++-prettyprinters/libfundts.cc print as
FAIL: libstdc++-prettyprinters/libfundts.cc print as

The ugly solution used in this patch is to repeat the lookup for every
type that std::string could be a typedef for, and hope it only works for
one of them.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py (StdExpAnyPrinter): Make
expansion of std::string in manager name more robust.
libstdc++-v3/python/libstdcxx/v6/printers.py