From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@sourceware.org
Subject: Re: [PATCH] libdw: Add new dwarf_get_units function to iterate over all units.
Date: Wed, 21 Feb 2018 16:15:00 -0000 [thread overview]
Message-ID: <1519229722.3058.95.camel@klomp.org> (raw)
In-Reply-To: <1517315687-3616-1-git-send-email-mark@klomp.org>
On Tue, 2018-01-30 at 13:34 +0100, Mark Wielaard wrote:
> The dwarf_nextcu and dwarf_next_unit functions provide information to
> construct the offset to construct the associated CU DIE using dwarf_offdie
> or dwarf_offdie_types. This requires the user to know beforehand where
> to DIE data is stored (in the .debug_info or .debug_types section).
> For type units one also needs to use the type offset to create the actual
> type DIE. In DWARF5 DIEs can come from even more data locations. And there
> are also skeleton units which require the user to find the associated
> split compile unit DIE (which would come from a different file).
>
> The new dwarf_get_units function simplifies iterating over the units in
> a DWARF file. It doesn't require the user to know where the DIE data is
> stored, it will automagically iterate over all know data sources (sections)
> returning the Dwarf_CU and the associated Dwarf_Die if requested. If the
> user requests to know the associated "subdie" it will also be resolved.
>
> This implementation returns the correct subdie for type units. A future
> version will also handle skeleton units and return the associated skeleton
> DIE and split unit DIE.
>
> readelf has been adapted to use the new iterator and print the new DWARF5
> unit header information (which it gets through dwarf_cu_die). The new
> interface hides which section exactly to iterate on (by design). readelf
> works around that by "cheating". It sets up a Dwarf_CU so that it gets
> the data from the right section, using the (normally) internal data
> structure.
I pushed this to master.
prev parent reply other threads:[~2018-02-21 16:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 12:35 Mark Wielaard
2018-02-21 16:15 ` Mark Wielaard [this message]
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=1519229722.3058.95.camel@klomp.org \
--to=mark@klomp.org \
--cc=elfutils-devel@sourceware.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).