aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdb-gdb.py.in
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-07-17 12:10:57 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2024-07-19 16:30:52 -0400
commitc5c3b90970f899bbc4e19a2401f1bc8d5b01e1d3 (patch)
tree4a912b495cd538c870efd7b4eba4eb371f4a8083 /gdb/gdb-gdb.py.in
parentb39807cc93bb85c9654b39a5c17f9d8de940429e (diff)
downloadgdb-c5c3b90970f899bbc4e19a2401f1bc8d5b01e1d3.zip
gdb-c5c3b90970f899bbc4e19a2401f1bc8d5b01e1d3.tar.gz
gdb-c5c3b90970f899bbc4e19a2401f1bc8d5b01e1d3.tar.bz2
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>
Diffstat (limited to 'gdb/gdb-gdb.py.in')
-rw-r--r--gdb/gdb-gdb.py.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/gdb-gdb.py.in b/gdb/gdb-gdb.py.in
index b5a7fa4..7cab694 100644
--- a/gdb/gdb-gdb.py.in
+++ b/gdb/gdb-gdb.py.in
@@ -342,7 +342,7 @@ class IntrusiveListPrinter:
corresponding intrusive_list_node.
"""
- assert elem_ptr.type.code == gdb.TYPE_CODE_PTR
+ assert elem_ptr.type.strip_typedefs().code == gdb.TYPE_CODE_PTR
if self._uses_member_node():
# Node as a member: add the member node offset from to the element's