public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "mcermak at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug tapsets/30407] Tapset function print_ubacktrace_fileline() no longer works with DWARF5
Date: Tue, 10 Oct 2023 09:14:28 +0000	[thread overview]
Message-ID: <bug-30407-6586-JbsCyMNrvI@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30407-6586@http.sourceware.org/bugzilla/>

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

--- Comment #5 from Martin Cermak <mcermak at redhat dot com> ---
Created attachment 15161
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15161&action=edit
WIP patch

The attached patch doesn't properly parse the .debug_line header (yet) to find
correct pointers to the .debug_line_str section.  Next version will try to do
that.

Demo:
-----------------------------------
# cat a.c
int main(void) {
    return 0;
}
# 
# gcc -g -gdwarf-5 a.c -o prog5
# gcc -g -gdwarf-4 a.c -o prog4
#
# eu-readelf --debug-dump=info prog4 | fgrep -i produc
           producer             (strp) "GNU C17 13.1.1 20230614 (Red Hat
13.1.1-4) -mtune=generic -march=x86-64 -g -gdwarf-4"
# eu-readelf --debug-dump=info prog5 | fgrep -i produc
           producer             (strp) "GNU C17 13.1.1 20230614 (Red Hat
13.1.1-4) -mtune=generic -march=x86-64 -g -gdwarf-5"
# 
# stap --ldd -e 'probe process.function("main") { print_ubacktrace_fileline()
}' -c ./prog4 
 0x40110a : main+0x4/0xe at /root/test/a.c:2 [/root/test/prog4]
 0x7f9d3c42814a : __libc_start_call_main+0x7a/0xb0 [/usr/lib64/libc.so.6]
 0x7f9d3c42820b : __libc_start_main@GLIBC_2.2.5+0x8b/0x160
[/usr/lib64/libc.so.6]
 0x401045 : _start+0x25/0x30 [/root/test/prog4]
# 
# stap --ldd -e 'probe process.function("main") { print_ubacktrace_fileline()
}' -c ./prog5
 0x40110a : main+0x4/0xe at /root/test/a.c:2 [/root/test/prog5]
 0x7fba8ae2814a : __libc_start_call_main+0x7a/0xb0 [/usr/lib64/libc.so.6]
 0x7fba8ae2820b : __libc_start_main@GLIBC_2.2.5+0x8b/0x160
[/usr/lib64/libc.so.6]
 0x401045 : _start+0x25/0x30 [/root/test/prog5]
#

-- 
You are receiving this mail because:
You are the assignee for the bug.

  parent reply	other threads:[~2023-10-10  9:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-30  6:08 [Bug tapsets/30407] New: Tapset function print_ubacktrace_fileline() no longer works on kernel 6.2 agentzh at gmail dot com
2023-05-02 22:29 ` [Bug tapsets/30407] " agentzh at gmail dot com
2023-05-02 22:32 ` [Bug tapsets/30407] Tapset function print_ubacktrace_fileline() no longer works on kernel 6.2/6.1 agentzh at gmail dot com
2023-06-08 14:27 ` mcermak at redhat dot com
2023-06-08 14:39 ` [Bug tapsets/30407] Tapset function print_ubacktrace_fileline() no longer works with DWARF5 mcermak at redhat dot com
2023-07-12 14:47 ` wcohen at redhat dot com
2023-07-14 15:25 ` mcermak at redhat dot com
2023-07-26 14:40 ` mark at klomp dot org
2023-10-10  9:14 ` mcermak at redhat dot com [this message]
2023-10-10  9:14 ` mcermak 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-30407-6586-JbsCyMNrvI@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@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).