This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: Should GCC tell GDB about its optimizations?
- To: leisner at rochester dot rr dot com
- Subject: Re: Should GCC tell GDB about its optimizations?
- From: Andreas Schwab <schwab at suse dot de>
- Date: Mon, 6 Mar 2000 11:54:52 +0100
- Cc: shebs at apple dot com, gcc at gcc dot gnu dot org, gdb at sourceware dot cygnus dot com
- References: <200003040446.XAA04330@rochester.rr.com>
"Marty Leisner" <leisner@rochester.rr.com> writes:
|> Yes...!!!
|>
|> I proposed something like this years ago...I almost hacked up
|> gcc to put this in (I think I started...)
|>
|> It is incredibly useful in the real world to encapsulate what
|> compiler flags were used in the binary (essentially the gcc command
|> line with preprocessor flags).
|>
|> I just compiled a trivial C program with -O3 to see..
|>
|> The .s file has
|> .ident "GCC: (GNU) 2.95.2 19991024 (release)"
|>
|> Is there a way for nm to decode this? (strings can show it,
|> but its pretty meaningless in the binary).
|>
|> For example:
|> ...
|> GCC: (GNU) egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
|> GCC: (GNU) egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
|> GCC: (GNU) 2.95.2 19991024 (release)
|> GCC: (GNU) 2.95.2 19991024 (release)
|> GCC: (GNU) 2.95.2 19991024 (release)
|> GCC: (GNU) egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
|> ....
|>
|> I don't know how to take apart elf binaries off the top
|> of my head, but I assume there is information someplace encoded
|> to match this up with specific files.
This information is concatenated in the .comment section. It can be
listed with "objdump -sj.comment ....". But there is no easy way to map
it back to the object modules apart from the fact that the order is the
same as the order of the modules linked in.
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg