This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help with getting CFA for split debuginfo files


On Wed, 2014-05-07 at 15:06 -0700, Sukadev Bhattiprolu wrote:
> Mark Wielaard [mjw@redhat.com] wrote:
> | > 	$ ./crc5 80a7be3c20 80a7be3c20 /usr/lib64/libc-2.18.so
> | > 	Error dwarf_cfi_addrframe(): : no matching address range
> | > 	Error with addr 0x80a7be3c20
> | > 
> | > 	$ ./crc5 80a7be3c20 80a7be3c20 /usr/lib/debug/lib64/libc.so.6.debug
> | > 	Error dwfl_addrmodule: no error
> | > 	Error with addr 0x80a7be3c20
> | > 
> | > Pls find the code attached. Appreciate any comments on how to extend it
> | > to work with split debug info files.
> | 
> | The first invocation should work (it will find the separate debug info
> | file that matches itself through dwfl_standard_find_debuginfo).
> 
> Thanks for looking into it.
> 
> I switched the order the dwfl_module_eh_cfi() and dwfl_module_dwarf_cfi()
> and did not seem to help, until I noticed that 'bias' is always 0 for
> the dwarf_cfi but 0x10000 for the eh_cfi (for the examples I tried).
> 
> I had code like this before:
> 
> 	        cfi = dwfl_module_eh_cfi(mod, &bias);
> 
> 		result = dwarf_cfi_addrframe(cfi, pc - bias, &frame);
> 
> Changing 'pc - bias' to just 'pc' for the eh_cfi, the program seems to work
> for several addresses in libc. Does that change make sense ?

Yes, that makes sense if you take the addresses directly from the file.
The bias given by dwfl_module_eh_cfi or dwfl_module_dwarf_cfi is the
difference between addresses as used in the CFI (from the Elf or Dwarf
file - which might be different depending on whether the Dwarf comes
from a separate debuginfo file or not) and where the Dwfl_Module is
"loaded". The difference matters for example if you construct a Dwfl
from a life process or core file. Then the addresses found in the
process or core might have to be translated back to the addresses as
found in the underlying Elf or Dwarf file.

Cheers,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]