public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "mark at klomp dot org" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug libdw/30948] src/stack doesn't show source inforamtion if the target is compiled with clang
Date: Tue, 07 Nov 2023 14:43:58 +0000	[thread overview]
Message-ID: <bug-30948-10460-Yj11U8ss5N@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30948-10460@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30948

--- Comment #3 from Mark Wielaard <mark at klomp dot org> ---
See also https://sourceware.org/bugzilla/show_bug.cgi?id=22288

The issue is that we rely on .debug_aranges to know whether a (code) address is
described in a particular DWARF CU (and from there which line table to use). We
could create an aranges table ourselves, that means scanning over all the
Compile Units and look at the first CU DIE, which will have a low-pc and
high-pc (or ranges) attribute describing the addresses. The tricky bit is
"merging" that with any existing .debug_aranges table. And that even if there
is a .debug_aranges it might not be complete.

So I think what we need to do is whenever we try to match up an address to a
CU, we first check the .debug_aranges, if it doesn't match (and it is the first
time) we do a full scan over all CUs and create or auxilary aranges table, then
use that for (any future) mapping. I think this needs to be done in
dwarf_addrdie which uses dwarf_getaranges but we might have to look at other
places which use dwarf_getaranges and decide whether to make that functions the
"magic" one or if that will always report the actual .debug_aranges. I think I
would prefer if dwarf_getaranges would remain reporting the actual
.debug_aranges data (if it is there).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-11-07 14:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-08 17:22 [Bug libdw/30948] New: " yamato at redhat dot com
2023-11-02 13:25 ` [Bug libdw/30948] " mark at klomp dot org
2023-11-06 21:21 ` yamato at redhat dot com
2023-11-07 14:43 ` mark at klomp dot org [this message]
2024-02-29 22:54 ` amerey at redhat dot com

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=bug-30948-10460-Yj11U8ss5N@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.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).