This is the mail archive of the gcc@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: Missing type info in debug data in 4.0.0


>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

 Daniel> On Wed, May 04, 2005 at 03:53:35PM -0400, Paul Koning wrote:
 >> I'm doing some tests to see if 4.0.0 will improve our debug
 >> experience, which is mixed indeed with complex C++ code and 3.3.3.
 >> 
 >> So far it looks like things are MUCH worse.  I built my
 >> application and looked at it with GDB.  Many of the structure
 >> names are missing.
 >> 
 >> I did some checking with readelf, looking at one of the object
 >> files.  I dumped the debug data (-w) searching for the struct
 >> names in that output.  Some of them showed up, some did not.  In a
 >> bunch of cases, out of three struct types defined one right after
 >> the other in a header file, one showed up and the other two were
 >> missing.
 >> 
 >> Any ideas?

 Daniel> Are they both used and defined in the program?  Currently GCC
 Daniel> only outputs full debug info for classes at the point where
 Daniel> the key method is emitted.  There's some discussion about
 Daniel> this in the archives.

OUCH.

Some of the types in question are probably not used in the program --
they are there for debugging.  It's disturbing to see this sort of
incompatibility.

The rule for "used" clearly has problems.  One of the types missing is
a struct that is referenced by way of casts, e.g.,
  struct foo { int x; int y; };
  bar = ((struct foo *)0x1234000)->x;

and that usage apparently is not enough to get gcc 4.0.0 to drop the
definition of "struct foo" into the output.  

So what does gcc consider "use" of a type?  If the number of omissions
is small enough, I might be able to hunt them down and do a
workaround.  Then again, I'd prefer GCC to use the old rule.  It seems
reasonable to assume that, if I mention a type in the source code, I
might want to refer to it in the debugger.  If that can't be the
default, at least there should be an option to force that behavior.

	   paul


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