This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] DW_OP_GNU_implicit_pointer binutils support, fix up DW_OP_call_ref
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jan Beulich <JBeulich at novell dot com>
- Cc: Roland McGrath <roland at redhat dot com>, binutils at sourceware dot org
- Date: Thu, 9 Sep 2010 14:12:54 +0200
- Subject: Re: [PATCH] DW_OP_GNU_implicit_pointer binutils support, fix up DW_OP_call_ref
- References: <20100909100627.GC2652@sunsite.ms.mff.cuni.cz> <4C88E49902000078000152F6@vpn.id2.novell.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Sep 09, 2010 at 12:43:53PM +0100, Jan Beulich wrote:
> > + if (dwarf_version == 2)
> > + {
> > + printf ("DW_OP_GNU_implicit_pointer: <0x%lx> %ld",
> > + (long) byte_get (data, pointer_size),
> > + read_leb128 (data + pointer_size, &bytes_read, 1));
> > + data += pointer_size + bytes_read;
>
> Is this one wrongly adding bytes_read, ...
>
> > + }
> > + else
> > + {
> > + printf ("DW_OP_GNU_implicit_pointer: <0x%lx> %ld",
> > + (long) byte_get (data, offset_size),
> > + read_leb128 (data + offset_size, &bytes_read, 1));
> > + data += offset_size;
>
> ... or is the respective addition missing here?
>
> > + }
> > + break;
> >
> > /* HP extensions. */
> > case DW_OP_HP_is_value:
Oops, thanks for catching this. I've actually tested only with -g -O2
on current trunk, not with -g -gdwarf-3 -O2, with the latter it obviously
didn't work. Committed this follow-up as obvious.
2010-09-09 Jakub Jelinek <jakub@redhat.com>
* dwarf.c (decode_location_expression): Fix data adjustment
for DW_OP_GNU_implicit_pointer in v3+.
--- binutils/dwarf.c 9 Sep 2010 10:18:12 -0000 1.75
+++ binutils/dwarf.c 9 Sep 2010 12:06:16 -0000
@@ -1122,7 +1122,7 @@ decode_location_expression (unsigned cha
printf ("DW_OP_GNU_implicit_pointer: <0x%lx> %ld",
(long) byte_get (data, offset_size),
read_leb128 (data + offset_size, &bytes_read, 1));
- data += offset_size;
+ data += offset_size + bytes_read;
}
break;
Jakub