This is the mail archive of the gdb@sourceware.org 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]
Other format: [Raw text]

Re: Question on typedefs of anonymous structs in G++


On Wed, 2008-05-07 at 05:00 -0400, Paul Hilfinger wrote:
> Using g++ 4.1 on Linux (at least), I observe that a type such as
> 
>       typedef struct {
>           ...
>       } Foo;
> 
> produces no trace of debugging information about Foo.  Serves one
> right for writing a C-style definition of Foo in a C++ program, to be
> sure, but G++ used to include Foo in the debugging data.  Does anyone
> here happen to know the story behind the change?  Thanks.

Did you actually declare an object of the type?
And use the object, so that it couldn't be optimized away?

Without an instance of a type, G++ will likely optimize the 
debug info for the type away.




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