From: "n2knqf5ogu at bsogq dot anonbox.net" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug libdw/28148] New: eu-addr2line reports function name of the caller when code is inlined
Date: Wed, 28 Jul 2021 12:30:09 +0000 [thread overview]
Message-ID: <bug-28148-10460@http.sourceware.org/bugzilla/> (raw)
https://sourceware.org/bugzilla/show_bug.cgi?id=28148
Bug ID: 28148
Summary: eu-addr2line reports function name of the caller when
code is inlined
Product: elfutils
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libdw
Assignee: unassigned at sourceware dot org
Reporter: n2knqf5ogu at bsogq dot anonbox.net
CC: elfutils-devel at sourceware dot org
Target Milestone: ---
Created attachment 13570
--> https://sourceware.org/bugzilla/attachment.cgi?id=13570&action=edit
Binary to reproduce described bug with eu-addrline
For inlined code addr2line from binutils reports the function name of the
inlined function. eu-addrline from elfutils, on the other hand, reports the
function name of the function where the code was inlined (i.e. the caller).
However, similar to addr2line, eu-addrline reports the file name of the file
where the inlined code is defined. Which is very confusing as **the eu-addrline
output reports a function name which is not defined in the reported file** for
this reason.
Compare the following elfutils-0.185 and binutils-2.35 output for the attached
RISC-V binary:
$ eu-addr2line -f -e inlined-bug.elf 20400e10
__atomic_fetch_and_4
/home/john/src/RIOT/cpu/riscv_common/include/irq_arch.h:62:5
$ addr2line -f -e inlined-bug.elf 20400e10
irq_disable
/home/john/src/RIOT/cpu/riscv_common/include/irq_arch.h:62
The binutils output is correct, the irq_disable function is inlined at address
20400e10 (in the caller __atomic_fetch_and_4) and the irq_disable function is
defined in /home/john/src/RIOT/cpu/riscv_common/include/irq_arch.h. The
elfutils output on the other hand is confusing as __atomic_fetch_and_4 is not
defined in /home/john/src/RIOT/cpu/riscv_common/include/irq_arch.h.
I noticed this while using
dwfl_module_getsrc/dwfl_lineinfo/dwfl_module_addrname in my own code, the
addr2line example just makes it easier to reproduce this issue. From a library
standpoint I find it confusing how inlined functions are presently handled in
libdwfl as it is often unclear if a libdwfl function returns information about
the caller or the inlined function in such cases.
--
You are receiving this mail because:
You are on the CC list for the bug.
next reply other threads:[~2021-07-28 12:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-28 12:30 n2knqf5ogu at bsogq dot anonbox.net [this message]
2023-10-06 11:29 ` [Bug libdw/28148] " mark at klomp dot org
2023-11-02 13:30 ` mark at klomp dot org
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-28148-10460@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).