Re: [PATCH] Consistent display of ""

Pedro Alves
2013-08-06T18:39:33Z

On 08/06/2013 04:41 PM, Mark Kettenis wrote:
>> Date: Tue, 6 Aug 2013 14:49:03 +0100
>> From: "Andrew Burgess" <aburgess@broadcom.com>

>> 3. My understanding was that values lost due to the ABI of a call site
>> were recorded as optimized out. For evidence I would present
>> dwarf2_frame_prev_register, and how DWARF2_FRAME_REG_UNDEFINED is handled.
>>
>> For these reasons I believe my patch should still be considered, what do
>> you think?
>
> I think that registers are either available or unavailble. A register
> being unavailble implies that a variable that is supposed to live in
> such a register may have been optimized out. Whether GDB's pseudo
> variables that respresent registers are considered unavailable or
> optimized out in that case is arguable.

I think improving consistency as in Andrew's patch is good.

When <unavailable> values were introduced, this particular
"info registers"/"*value not available*" string already existed,
and it was never adjusted.

The distinction between <unavailable> and <optimized out> is:

- <optimized out> means that the object no longer exists in the
compiled binary, because the compiler got rid of it (the debug
info tells us there's no way to retrieve it).

- <unavailable> means that the object was not optimized out, and actually
exists in the program (and the debug info describes how to get at it), but
we don't have access to the bits necessary to extract/compute the object
from -- e.g., a core file section has been truncated, a tracepoint did
not collect the necessary registers or memory, etc..

I favor normalizing GDB's output in this direction.

--
Pedro Alves