how to examine data with compiler optimization option set?

Ulrich Weigand
Thu Sep 4 20:46:00 GMT 2008

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!)


  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE

More information about the Gdb mailing list