Re: Effect of 'register' keyword on debug info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 24, 2012 at 8:23 PM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
> Rohit Arul Raj <rohitarulraj@xxxxxxxxx> writes:
>
>> On Thu, May 24, 2012 at 3:40 AM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
>>> Rohit Arul Raj <rohitarulraj@xxxxxxxxx> writes:
>>>
>>>> Looking at the debug info and the generated assembly, the values of
>>>> variables 'f1' and 'd1' are stored in the same register.
>>>> Due to this, while debugging, after setting the break point at (A)
>>>> [line no 8], if we print the value of 'f1' i get the wrong value.
>>>
>>>
>>>> Q: Is this the side effect of using 'register' keyword? If 'f1' is
>>>> getting optimized out, shouldn't we get that info while debugging?
>>>
>>> This question as stated is not really appropriate for the mailing list
>>> gcc@xxxxxxxxxxx, which is for the development of GCC itself.  This
>>> question would be appropriate for gcc-help@xxxxxxxxxxx.  Please take any
>>> followups to gcc-help.  Thanks.
>>>
>>> This has nothing to do with using the register keyword.
>>>
>>> Yes, you should ideally be told when a value is unavailable.  This
>>> specific area of GCC has been much improved since GCC 4.5.2.
>>>
>>
>> Thanks Ian.
>> I tried with gcc v4.6.3 and get the same behavior.
>> Should this be considered as a bug with debug info generation then?
>
> Yes.
>
> Ian

Further, by default the debug info for variables 'd1' and 'f1' are
generated as location expressions. Where as with '-fvar-tracking', the
debug info is generated as location lists.

1) Is it possible to generate location expressions to identify that
the variable has been optimized out?
2) If (1) is not possible and if '-fvar-tracking' gives accurate info
on live variables, why isn't it turned ON by default at '-O0'?

Since the code is compiled at '-O0' should correct debug info be generated?

Thanks for the help,
Rohit



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux