public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Aaron Merey <amerey@redhat.com>
To: "Frank Ch. Eigler" <fche@redhat.com>
Cc: Mark Wielaard <mark@klomp.org>, elfutils-devel@sourceware.org
Subject: Re: [PATCH v2] dwarf_getaranges: Build aranges list from CUs instead of .debug_aranges
Date: Thu, 22 Feb 2024 12:27:12 -0500	[thread overview]
Message-ID: <CAJDtP-T6iQEADcphrWZ=fc5Up1CbgA8ADUMPBzTjVpqtdDU7rw@mail.gmail.com> (raw)
In-Reply-To: <20240222153529.GG21278@redhat.com>

Hi Frank,

On Thu, Feb 22, 2024 at 10:35 AM Frank Ch. Eigler <fche@redhat.com> wrote:
>
> > > We could then also introduce a new public function, dwarf_getdieranges
> > > (?) that does the new thing. But it doesn't have to be public on the
> > > first try as long as dwarf_addrdie and dwfl_module_addrdie work. (We
> > > might want to change the interface of dwarf_getdieranges so it can be
> > > "lazy" for example.)
> >
> > Ok this approach seems like the most flexible.  Users can have both
> > .debug_aranges and CU-based aranges plus we don't have to change the
> > semantics of dwarf_getaranges.  [...]
>
> Another option is to generate the .debug_aranges automatically, but
> only if it is absent from the input dwarf file.  (An eu-readelf user
> can tell if it was synthetic or not, if it matters.)

I'd like to be able to do this but .debug_aranges might be incomplete
even if the section is present in the input file.  This would require
us to parse CUs anyways in order to verify the section's completeness.

I'll defer to David Blaikie [1] again: "consumers shouldn't rely on the
presence of .debug_aranges, or them being complete (DWARF doesn't
require/guarantee this - and Clang doesn't emit aranges by default, for
instance). Each contribution to .debug_aranges says which CU it covers
and any CUs not covered should be parsed/assumed to contain things
covering other addresses."

Aaron

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=22288#c5


      reply	other threads:[~2024-02-22 17:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  1:35 [PATCH 0/2] dwarf_getaranges: Build aranges list from CUs Aaron Merey
2023-12-07  1:35 ` [PATCH 1/2] libdw: Use INTUSE with dwarf_get_units Aaron Merey
2023-12-21 23:56   ` Mark Wielaard
2023-12-22 21:02     ` Aaron Merey
2023-12-07  1:35 ` [PATCH 2/2] dwarf_getaranges: Build aranges list from CUs instead of .debug_aranges Aaron Merey
2023-12-11 23:18   ` [PATCH v2] " Aaron Merey
2024-02-13 13:28     ` Mark Wielaard
2024-02-20  4:20       ` Aaron Merey
2024-02-20 22:23         ` Mark Wielaard
2024-02-22  3:19           ` Aaron Merey
2024-02-22 15:35             ` Frank Ch. Eigler
2024-02-22 17:27               ` Aaron Merey [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='CAJDtP-T6iQEADcphrWZ=fc5Up1CbgA8ADUMPBzTjVpqtdDU7rw@mail.gmail.com' \
    --to=amerey@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=fche@redhat.com \
    --cc=mark@klomp.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).