]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix pretty printers for std::list
authorJonathan Wakely <jwakely@redhat.com>
Mon, 24 Nov 2025 12:48:42 +0000 (12:48 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 24 Nov 2025 12:52:40 +0000 (12:52 +0000)
commit39cd9fd2404fe51eabe7587392dad4819fcc2ca8
tree7dac7460b54e704021515961ea5e20ba825ffe84
parentca948ee810949179aac598a14a714ec9550dd9c6
libstdc++: Fix pretty printers for std::list

The logs for xmethods.exp show that the std::list tests have never
worked:

gdb.error: No type named std::__cxx11::list<int, std::allocator<int> >::_Node.^M
skipping:   File "/home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/../python/libstdcxx/v6/xmethods.py", line 445, in match\r\nskipping:     node_type = gdb.lookup_type(str(class_type) + '::_Node').pointer()\r\nskipping:                 ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\nskipping: gdb.error: No type named std::__cxx11::list<int, std::allocator<int> >::_Node.\r\nlist.gdb:11: Error in sourced command file:^M
Error while looking for matching xmethod workers defined in Python.^M
skipping: list.gdb:11: Error in sourced command file:\r\nskipping: Error while looking for matching xmethod workers defined in Python.\r\nUNSUPPORTED: libstdc++-xmethods/list.cc

Because of the way the GDB tests treat errors as UNSUPPORTED (so that
the tests don't fail if the version of GDB is too old to support
xmethods) we were not getting any FAIL, even though the tests were
broken.

The std::list type does not have a nested _Node type, it only has
_Node_ptr. Instead of looking up _Node and then getting a pointer to
that type, just look up _Node_ptr instead.

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/xmethods.py (ListMethodsMatcher.match):
Fix lookup for node type.
libstdc++-v3/python/libstdcxx/v6/xmethods.py