This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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: how to examine data with compiler optimization option set?


> From: Andreas Schwab <schwab@suse.de>
> Cc: Eli Zaretskii <eliz@gnu.org>,
> 	"Frank Ch. Eigler" <fche@redhat.com>, msnyder@vmware.com,
> 	brobecker@adacore.com, jreiver@free.fr, gdb@sourceware.org
> Date: Thu, 04 Sep 2008 10:00:45 +0200
> 
> 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.

Failing that, there should be a compiler switch to disable this
optimization, and that switch should be enabled by default when one
uses -ggdb.

In many real-life programs the net effect of this optimization is
negligibly small, while the effect of not being able to see function
arguments means the program either gets shipped less debugged or is
built without optimizations and shipped that way.  I know _I_ would
happily give up this optimization if I could get back the lost ability
of debugging reasonably well optimized code.


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