This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb support for unnamed union/structure fields


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@yahoo.com> 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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]