gdb with gcj

Bryce McKinlay mckinlay@redhat.com
Sat May 1 17:39:00 GMT 2004


On May 1, 2004, at 1:26 PM, Andrew Haley wrote:

> Bryce McKinlay writes:
>> On May 1, 2004, at 9:41 AM, Andrew Haley wrote:
>>
>>> The last time I investigated this, some of the optimizers (CSE?
>>> loop?) were replacing one variable with another.  This doesn't
>>> change the semantics of the program but the new variable is no
>>> longer marked as a user variable and doesn't carry debug info.
>>
>> Lets make sure there is a PR on this. We shouldn't have to recompile
>> just to debug.
>
> Well, it's been like that for a long while, and AFAIK it's a hard
> problem.  In theory you can generate DWARF expressions that allow you
> to calculate what a variable would be if the code were not optimized,
> but in the general case it's impossible.  After all, the "as if" rule
> allows the compiler completely to rewrite a program.

Sure, I guess its reasonable to expect that with optimization, you 
won't always get entirely accurate/reliable output when printing local 
variables. This is how it used to work. But, the problem I see now is 
that GDB basically refuses to print local variables at all. It doesn't 
even try - it just says the variables don't exist. So in this respect 
the problem has become significantly worse in recent months.

Regards

Bryce



More information about the Java mailing list