This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: "optimized out" in spite of DWARF saying otherwise?
- From: Michael Haupt <michael dot haupt at oracle dot com>
- To: gdb at sourceware dot org
- Date: Thu, 21 Mar 2013 21:15:20 +0100
- Subject: Re: "optimized out" in spite of DWARF saying otherwise?
- References: <C3092A95-675A-4C3C-9CBF-48F37DAC9A50 at oracle dot com> <20130321164806 dot GA19532 at host2 dot jankratochvil dot net>
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