GDB interactions with GCC
Jean Christophe Beyler
jean.christophe.beyler@gmail.com
Tue Nov 3 18:09:00 GMT 2009
That is what I noticed as well. So you have confirmed that if we want
to retain that information, it needs to be stored on the stack even if
the optimization levels are used.
Thanks,
Jc
On Tue, Nov 3, 2009 at 1:01 PM, Daniel Jacobowitz <drow@false.org> wrote:
> On Tue, Nov 03, 2009 at 12:54:54PM -0500, Jean Christophe Beyler wrote:
>> On my architecture, I can have the code for foo reduced to :
>>
>> add FirstInputRegister, FirstInputRegister, 1
>> call bar
>> branch return.
>>
>> Therefore, once I'm in bar, the input register that foo had has been
>> lost since it's been incremented. The original value of a has been
>> lost since it is not in a particular register, was not spilled.
>>
>> In this case, how does GDB handle it ?
>
> GDB will report that the value is not available. If you compile
> without optimization, GCC will generally save it in a stack slot, and
> the value will be available.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>
More information about the Gdb
mailing list