This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: how to examine data with compiler optimization option set?
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: fche at redhat dot com (Frank Ch. Eigler)
- Cc: eliz at gnu dot org (Eli Zaretskii), schwab at suse dot de (Andreas Schwab), dewar at adacore dot com, msnyder at vmware dot com, brobecker at adacore dot com, jreiver at free dot fr, gdb at sourceware dot org, aoliva at redhat dot com (Alexandre Oliva)
- Date: Thu, 4 Sep 2008 22:45:04 +0200 (CEST)
- Subject: Re: how to examine data with compiler optimization option set?
Frank Ch. Eigler wrote:
> On Thu, Sep 04, 2008 at 06:55:15PM +0300, Eli Zaretskii wrote:
> > [...]
> > > If parameters are passed in registers they are very likely to get lost.
> >
> > Then the compiler should, under -ggdb, emit code and debug info that
> > allow GDB finding these parameters somewhere.
>
> And it should.
Current GCC policy is that -g never changes anything in the emitted code.
If you build with and without -g and then strip the binaries, they are
supposed to be identical. This seems a useful property to me ...
However, this is not to say there couldn't be some other option that
did change code generation like that. (In any case, even without
changing code generation, there seems to be a lot of possibilities
to simply generate better debug info describing what's there!)
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com