From: Mark Wielaard <mjw@redhat.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: [PATCH 1/2] libdw: Add new function dwarf_cu_getdwarf.
Date: Mon, 18 Aug 2014 16:03:38 +0200 [thread overview]
Message-ID: <1408370618.3370.8.camel@bordewijk.wildebeest.org> (raw)
In-Reply-To: 87bnrjs80u.fsf@redhat.com
[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]
On Sun, 2014-08-17 at 12:52 +0200, Dodji Seketeli wrote:
> Mark Wielaard <mjw@redhat.com> writes:
>
> > In both systemtap and libabigail there is a need to get the actual Dwarf
> > underlying an Dwarf_Die or Dwarf_Attribute. Following a DIE reference
> > might end up in an alternate Dwarf since the addition of DWZ multifile
> > forms. Both Dwarf_Die and Dwarf_Attribute already contain a Dwarf_CU
> > handle. Add a function dwarf_cu_getdwarf to retrieve the underlying
> > Dwarf using the Dwarf_CU.
>
> Thanks Mark!
>
> This, indeed, is going to be useful for libabigail at least. This new
> dwarf_cu_getdwarf function, along with the existing dwarf_diecu function
> will allow us to get the actual Dwarf a given DIE comes from. And with
> the recently added dwarf_getalt function, we'll be able to tel if the
> DIE comes from the alternate Dwarf or not. This is awesome.
Glad it is useful.
Do note that the existing dwarf_diecu gives you the top-level Dwarf_Die
for the CU, not a Dwarf_CU. Both the original Dwarf_Die and the result
from dwarf_diecu should have the same Dwarf_CU handle that you can use
with dwarf_cu_getdwarf. The Dwarf_CU represents the actual DWARF CU
concept, from which you can get some extra information not like address
or offset size used in the particular DIE tree (see also dwarf_cudie
that returns both that extra information and the top level Dwarf_DIE for
the CU). While the top-level Dwarf_Die is the compile/partial/type_unit
DIE (all other DIEs in the CU are children of this DIE).
Cheers,
Mark
next reply other threads:[~2014-08-18 14:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-18 14:03 Mark Wielaard [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-08-20 9:31 Mark Wielaard
2014-08-17 10:52 Dodji Seketeli
2014-08-15 14:08 Mark Wielaard
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=1408370618.3370.8.camel@bordewijk.wildebeest.org \
--to=mjw@redhat.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).