Re: gdb support for unnamed union/structure fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, the code was compiled with "-g" option, but when
I dump foo structure in gdb, gdb only prints values of
"int a; int d", but not "int b; int c" which happen to
be inside unnamed structure.

I realize that this is a gcc-help forum, the reason I
posted here is to find out if any specific compile
option is to be used to have gdb display unnamed
unions/structure fields.

If there is a gdb discussion forum, appreciate if you
could give me a pointer.

thx in advance
Mathew

--- Amit Choudhary <amit2030@xxxxxxxxx> wrote:

> 
> >  
> > typedef union {
> >        int a;
> >        struct {
> >          int b;
> >          int c;
> >        };
> >        int d;
> >  } foo;
> > 
> > I see that gdb 6.4 is also released, does it
> support
> > displaying unnamed union/stucture fields.
> >  
> 
> This is a gdb question assuming that you have
> compiled with the -g option. In your program you
> must be defining a variable like "foo xyz;". Now, if
> you do "p xyz" in gdb, it will show the
> fields of xyz and their values.
> 
> Regards,
> Amit Choudhary 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux