binutils-gdb/gdb/testsuite/gdb.gdb
Simon Marchi c5c3b90970 gdb-gdb.py: strip typedefs in intrusive_list printer assertion
When debugging gdb itself and trying to print a intrusive_list that has
more than one element, I get:

    File "/home/simark/build/binutils-gdb-all-targets/gdb/gdb-gdb.py", line 365, in _children_generator
      node_ptr = self._as_node_ptr(elem_ptr)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/simark/build/binutils-gdb-all-targets/gdb/gdb-gdb.py", line 345, in _as_node_ptr
      assert elem_ptr.type.code == gdb.TYPE_CODE_PTR
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError

This is because node_ptr is a typedef
(intrusive_list_base_iterator::pointer).  Add a call to strip_typedefs
to get to the real type.

Enhance gdb.gdb/python-helper.exp with a test that would have caught
this bug.

Change-Id: I3eaca8de5ed06d05756ed979332b6a431e15b700
Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-07-19 16:30:52 -04:00
..
index-file.exp Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
python-helper.cc Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
python-helper.exp gdb-gdb.py: strip typedefs in intrusive_list printer assertion 2024-07-19 16:30:52 -04:00
selftest.exp Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
unittest.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
unittest.exp Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00