"optimized out" in spite of DWARF saying otherwise?

Michael Haupt michael.haupt@oracle.com
Thu Mar 21 20:15:00 GMT 2013


Jan,

Am 21.03.2013 um 17:48 schrieb Jan Kratochvil <jan.kratochvil@redhat.com>:
> On Thu, 21 Mar 2013 17:39:26 +0100, Michael Haupt wrote:
>> so I have this formal argument to a method, and my DWARF says
>> 
>> 0x...e642 - 0x...e642: rdi
>> 
>> (note start and end are the same). gdb, however, insists on the value being
>> "<optimized out>", with the current address being 0x...e642. How is this?
> 
> That is correct.  DWARF4:
> 2. An ending address offset. [...] It marks the first address past the end of
> the address range over which the location is valid.
> 
> Such entry in fact does not say anything, it covers zero bytes.

thanks for reminding me of a too-long forgotten part of the standard. :-)

> (1) You should look on other entries in that location list (if any).

I generate all of these myself; some of them cover call sites (which are a couple instructions long and never caused this trouble).

The offending one I asked about is just a mark. There is no guarantee as to which instruction there is at the address in question; is it "safe" to use an extent of, say, 1, or does the instruction length govern that?

Best,

Michael


More information about the Gdb mailing list