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


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 ?

| 
| You find the .debug_frame CFI through dwfl_module_dwarf_cfi and then
| lookup the address using dwarf_cfi_addrframe. The .debug_frame
| apparently exists but doesn't contain the requested address. You should
| then try to find it through the .eh_frame CFI using dwfl_module_eh_cfi
| (or just swap the dwfl_module_dwarf_cfi and dwfl_module_eh_cfi calls
| since on fedora the .eh_frame should always be complete because GCC uses
| -fasynchronous-unwind-tables by default).
| 
| Cheers,
| 
| Mark
| 


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