how to examine data with compiler optimization option set?

Paul Koning
Thu Sep 4 14:05:00 GMT 2008

>>>>> "Robert" == Robert Dewar <> writes:

 Robert> Andreas Schwab wrote:
 >> Robert Dewar <> writes:
 >>> Well you always had local variables disappearing in earlier
 >>> versions but enough worked so you could debug, in particular
 >>> parameters were always available and reliable.
 >>  If parameters are passed in registers they are very likely to get
 >> lost.  Even on i386 parameters sometimes get passed in registers,
 >> eg. when calling local functions.

 Robert> Yes, indeed parameters do get lost and I find it impossible
 Robert> in practice to debug at -O1 (whereas this was ny normal
 Robert> practice for many years).

 Robert> What I am saying is that if an effort is put in to improve
 Robert> the debugging information, for me this would be the primary
 Robert> target.

Is the problem inadequate debug information (i.e., the values are
there, but there isn't debug data that points to the correct registers
or stack slots) -- or is the problem that the values you want to see
are dead by the time you get to them and the registers holding them
have been reused by then?   Or something in between, i.e., the values
are technically dead, but the registers have NOT yet been reused so
the debug information can (and should) still show where they are.


More information about the Gdb mailing list