public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: Help with getting CFA for split debuginfo files
Date: Wed, 07 May 2014 15:06:14 -0700	[thread overview]
Message-ID: <20140507220614.GA20216@us.ibm.com> (raw)
In-Reply-To: 1399456123.3973.51.camel@bordewijk.wildebeest.org

[-- Attachment #1: Type: text/plain, Size: 1671 bytes --]

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
| 


             reply	other threads:[~2014-05-07 22:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 22:06 Sukadev Bhattiprolu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-05-08  6:54 Mark Wielaard
2014-05-07  9:48 Mark Wielaard
2014-05-06 23:32 Sukadev Bhattiprolu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140507220614.GA20216@us.ibm.com \
    --to=sukadev@linux.vnet.ibm.com \
    --cc=elfutils-devel@lists.fedorahosted.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).