This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH] readelf: Add base to offsets in format_dwarf_addr for debug_loc/ranges.
- From: Josh Stone <jistone at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 23 Jan 2013 15:49:53 -0800
- Subject: Re: [PATCH] readelf: Add base to offsets in format_dwarf_addr for debug_loc/ranges.
On 01/22/2013 07:52 AM, Mark Wielaard wrote:
> Have you tried the patch, does it produce the
> addresses you are expecting?
Sorry for being slow about that. Yes I've tried it now, and yes it
gives better output. For reference, here are a few examples of the
particular location list I was interested in.
As something of a baseline, binutils' readelf gives:
> 00576bbe ffffffff811953f5 ffffffff8119541b (DW_OP_reg1 (rdx))
> 00576bbe ffffffff8119541b ffffffff8119546b (DW_OP_reg13 (r13))
> 00576bbe ffffffff8119546b ffffffff81195471 (DW_OP_GNU_entry_value: (DW_OP_reg1 (rdx)); DW_OP_stack_value)
> 00576bbe ffffffff81195471 ffffffff81195481 (DW_OP_reg13 (r13))
> 00576bbe <End of list>
Here's F18's eu-readelf -N:
> [576bbe] 0x0000000000000b85..0x0000000000000bab [ 0] reg1
> 0x0000000000000bab..0x0000000000000bfb [ 0] reg13
> 0x0000000000000bfb..0x0000000000000c01 [ 0] GNU_entry_value:
> [ 0] reg1
> [ 3] stack_value
> 0x0000000000000c01..0x0000000000000c11 [ 0] reg13
Here's your patch on elfutils.git, still -N:
> [576bbe] 0xffffffff811953f5..0xffffffff8119541b [ 0] reg1
> 0xffffffff8119541b..0xffffffff8119546b [ 0] reg13
> 0xffffffff8119546b..0xffffffff81195471 [ 0] GNU_entry_value:
> [ 0] reg1
> [ 3] stack_value
> 0xffffffff81195471..0xffffffff81195481 [ 0] reg13
And you patch on elfutils.git without -N:
> [576bbe] 0xffffffff811953f5 <sys_write+0x5>..0xffffffff8119541b <sys_write+0x2b> [ 0] reg1
> 0xffffffff8119541b <sys_write+0x2b>..0xffffffff8119546b <sys_write+0x7b> [ 0] reg13
> 0xffffffff8119546b <sys_write+0x7b>..0xffffffff81195471 <sys_write+0x81> [ 0] GNU_entry_value:
> [ 0] reg1
> [ 3] stack_value
> 0xffffffff81195471 <sys_write+0x81>..0xffffffff81195481 [ 0] reg13
So yes, the actual numbers are much better, as now I can relate them
back to the range of the function itself.
The output without -N looks a little funny, but as you said that's not
really the fault of your patch, just a consequence of having "real"
addresses to look up. But I always use -N with vmlinux anyway, because
it's WAY too slow otherwise. Linear table scans are deadly...