how to examine data with compiler optimization option set?

Michael Snyder
Wed Sep 3 00:05:00 GMT 2008

Joel Brobecker wrote:
> The documentation is slightly outdated, as stabs has hardly any support
> for debugging optimized code.  Better stick with DWARF2/3.
>>> Isn't that possible at all? (I am currently evaluating the debugging
>>> facilities
>>> of gdb)
>> No it is not possible.
> Note that the debugger behavior is usually expected considering
> the debugging information generated by the compiler. I heard there
> is some effort to improve the debugging information, but generally
> speaking, debugging optimized code right now can be tricky.

I don't think there is any possibility whatsoever of
somehow generating location codes for the variables in
the example.

Those values are simply not kept anywhere.  GCC will replace
them all with the constant, "3".

More information about the Gdb mailing list