This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [LTO, committed] Add FIXME about DW_FORM_ref_addr and dwarf2 vs dwarf3
- From: "Daniel Berlin" <dberlin at dberlin dot org>
- To: "Andrew Pinski" <pinskia at physics dot uc dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 20 Sep 2006 08:42:29 -0400
- Subject: Re: [LTO, committed] Add FIXME about DW_FORM_ref_addr and dwarf2 vs dwarf3
- References: <1158734353.30325.4.camel@celery.andrew.com>
On 9/20/06, Andrew Pinski <pinskia@physics.uc.edu> wrote:
I noticed while looking a different bug, that we might be handling
DW_FORM_ref_addr incorrectly on the LTO branch reader. Dwarf3 changed
the definition of DW_FORM_ref_addr slightly for the size of the operand.
In Dwarf2, it was the size of that target address while in Dwarf3, it is
the offset size. Also right now we (GCC) output the dwarf2 format of
so we are going to incorrect read this right now.
I added a FIXME to make the note of it as I cannot test a real fix for
this and I don't see where we mark the dwarf2 version we are reading in
either.
Yes this is a bug, though it is a mostly theoretical bug though. It
only affects machines where we output 64 bit (offset wise) debug info
even though they have a 32 bit address size. I don't believe we
support this, even though we could.
As for the version, it will be in cu->cu_version.
Realistically, the code should look like this
if (cu->cu_version == 2)
{
if (cu->pointer_size == 4)
read 4 bytes
else
assert(cu->pointer_size == 8)
read 8 bytes
}
else
{
assert(cu->cu_version == 3)
<existing code>
}