This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Displaying structs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]