This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Displaying structs
- To: gdb at sources dot redhat dot com
- Subject: Displaying structs
- From: Ben Elliston <bje at redhat dot com>
- Date: Sun, 8 Oct 2000 02:01:37 +1100 (EST)
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