From mboxrd@z Thu Jan 1 00:00:00 1970 From: jtc@redback.com (J.T. Conklin) To: shaunj@gray-interfaces.com Cc: gdb@sources.redhat.com Subject: Re: printing enumerated values Date: Fri, 06 Oct 2000 11:04:00 -0000 Message-id: <5m7l7lhmmr.fsf@jtc.redback.com> References: <00100611524000.07740@ed> X-SW-Source: 2000-10/msg00023.html >>>>> "Shaun" == Shaun Jackman writes: Shaun> In GDB I get this... Shaun> (gdb) p A Shaun> $1 = 0 Shaun> (gdb) p B Shaun> $2 = 1 Shaun> (gdb) You need to let us know more about your environment. From current sources, on a NetBSD/i386 1.3 machine (ie i386 aout stabs) I get: (gdb) p A $1 = A (gdb) p B $2 = B (gdb) p (int) A $3 = 512 (gdb) p (int) B $4 = 513 --jtc -- J.T. Conklin RedBack Networks >From bje@redhat.com Sat Oct 07 08:02:00 2000 From: Ben Elliston To: gdb@sources.redhat.com Subject: Displaying structs Date: Sat, 07 Oct 2000 08:02:00 -0000 Message-id: X-SW-Source: 2000-10/msg00024.html Content-length: 523 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