Displaying structs

Ben Elliston bje@redhat.com
Sat Oct 7 08:02:00 GMT 2000


Often, when debugging, I like to examine pointers to structures.  When
examining the struct instance that the pointer is addressing, I might use:

(gdb) print/x *ptr
 
If the struct has fields which are further pointers to structs, I have to
manually follow these pointers:
 
(gdb) print/x *ptr->next
or
(gdb) print/x *ptr->prev
 
Is there a way that GDB can recursively follow these (to some level)?  I am
guessing that there is enough debugging information for it to know that the
pointers are to meaningful types.

Ben



More information about the Gdb mailing list