From: Mark Wielaard <mjw@redhat.com>
To: Gerhard Gappmeier <gerhard.gappmeier@ascolab.com>
Cc: gdb-patches@sourceware.org
Subject: Re: New feature "source-id"
Date: Tue, 18 Mar 2014 13:22:00 -0000 [thread overview]
Message-ID: <1395148924.27876.20.camel@bordewijk.wildebeest.org> (raw)
In-Reply-To: <7365721.BnaR1nHazz@lt-gergap>
Hi Gerhard,
On Sat, 2014-03-15 at 11:49 +0100, Gerhard Gappmeier wrote:
> The idea is that when you need to debug an executable or opening a coredump of
> an executable that was built with "source-id" and "build-id" enabled it just
> works. You don't need to care about how and where to get debug symbols and the
> correct sources.
I was wondering how this would work together with what distros like
Fedora do right now to solve this same issue of finding the
corresponding source files.
Distros, at least those based on rpm, rely on the build-id and DWARF
debug information. For each executable/library they record the build-id
and strip the symbol table and debug information in a separate .debug
file. The debug Compile Unit and DWARF line table reference the source
files used to build the executable file. These files are collected and
put under /usr/src/debug/<package-foo>/.... Then they run debugedit [1]
on the .debug files to replace all file references to the files
under /usr/src/debug/... Both the .debug files (placed
under /usr/lib/debug/<package-foo>) and the source files are then
bundled together in the <package-foo>-debuginfo.rpm (including the
necessary build-id directories).
That way you can use the build-id from the ELF note section to retrieve
both the separate .debug files and the corresponding source files. And
on my distro gdb even helpfully suggests how to do this:
Missing separate debuginfos, use: debuginfo-install at-3.1.13-14.fc20.x86_64
Which will then fetch the debuginfo package and all dependencies so gdb
can find the .debug files and the corresponding source code those .debug
files refer to. I don't know if the debuginfo-install suggestion is
upstream or only in the distro package of gdb.
> * We need to make the new section ".note.gnu.source-id" official. I don't know
> who maintains this and this needs to be registered somewhere.
> [...]
> * adding file hashes (SHA1) for each source file to the debug info. This way
> we can completely remove the mtime check and replace it with a check of the
> SHA1 sum. When we can replace the existing warning with a message like "The
> source file does not match the executable."
For DWARF5 there is a proposal to add the MD5 digest to debug-line file
table: http://dwarfstd.org/ShowIssue.php?issue=130701.1
Would that be a good alternative location to store the hash of the
source file?
Cheers,
Mark
[1] http://rpm.org/gitweb?p=rpm.git;a=blob;f=tools/debugedit.c;hb=HEAD
next prev parent reply other threads:[~2014-03-18 13:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-15 10:49 Gerhard Gappmeier
2014-03-15 17:32 ` Doug Evans
2014-03-15 20:06 ` Eli Zaretskii
2014-03-16 2:34 ` Doug Evans
2014-03-16 9:43 ` Gerhard Gappmeier
2014-03-16 16:22 ` Doug Evans
2014-03-16 16:34 ` Eli Zaretskii
2014-03-17 8:49 ` Gerhard Gappmeier
2014-03-17 12:25 ` Matt Rice
2014-03-17 19:01 ` Gerhard Gappmeier
2014-03-18 0:25 ` Doug Evans
2014-03-18 0:48 ` Bruce Dawson
2014-03-18 1:39 ` Doug Evans
2014-03-18 17:44 ` Bruce Dawson
2014-03-18 17:57 ` Doug Evans
2014-03-18 13:22 ` Mark Wielaard [this message]
2014-03-18 14:00 ` Gerhard Gappmeier
2014-03-18 15:03 ` Mark Wielaard
2014-03-18 16:40 ` Gerhard Gappmeier
2014-03-18 17:56 ` Bruce Dawson
2014-05-21 19:30 ` Tom Tromey
2014-05-21 20:42 ` Bruce Dawson
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=1395148924.27876.20.camel@bordewijk.wildebeest.org \
--to=mjw@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=gerhard.gappmeier@ascolab.com \
/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