This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Question on typedefs of anonymous structs in G++
- From: Michael Snyder <msnyder at specifix dot com>
- To: Hilfinger at adacore dot com
- Cc: gdb at sourceware dot org
- Date: Thu, 08 May 2008 12:15:00 -0700
- Subject: Re: Question on typedefs of anonymous structs in G++
- References: <20080507090045.51A1048CC44@nile.gnat.com>
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.