public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Panu Matilainen <pmatilai@redhat.com>,
	Project Archer <archer@sourceware.org>
Subject: Re: find-debuginfo.sh change for gdb index
Date: Tue, 06 Jul 2010 19:14:00 -0000	[thread overview]
Message-ID: <20100706191407.535874824F@magilla.sf.frob.com> (raw)
In-Reply-To: Tom Tromey's message of  Tuesday, 6 July 2010 12:34:52 -0600 <m38w5ocvcj.fsf@fleche.redhat.com>

> One thing that came up is that the current approach of using file
> size+mtime to determine whether the index is valid is not super.

Agreed.

> Two competing ideas:
> 
> 1. Put the build-id into the index file, then verify it.

That is the method already used for .debug files today.  (The old
.gnu_debuglink CRC32 check should be ignored when there are build IDs.
I don't know about GDB, but libdw ignores it when there is a build ID.)

> 2. Require the index to be a section in the ELF object.

This is the most obvious way to handle this information.  The only real
down-sides are a) possible bugs breaking the original file and b) somewhat
more hair later if the index format has to be redone and only data
reindexed.  I don't really think either of those is something to worry much
about.

Doing this adds another interlocking requirement.  The eu-strip (libebl)
code for -g matches the individual DWARF sections by name.  (Without -g, it
strips all non-allocated sections, but for -g it only strips the sections
with recognized names.)  So that requires a (one-line) change in elfutils
for the new section name, and we'll need the new elfutils release in
buildroots before the new index-adding procedure goes in.  (It shouldn't be
any problem to push this out quickly, but it needs to go on your checklist
so we coordinate it.)

>    This has the nice property that no validation need be done.

Put another way, it implicitly takes advantage of the existing validation
mechanisms.  If you modify the unstripped file before strip-to-file, then
even the CRC32 will be correct.  (This should not really be a concern one
way or the other for Fedora, where both --build-id is always used and all
the tools should be validating by IDs rather than CRCs.  But for generic
goodness of the scheme, it is attractive in not introducing a new wrinkle
about the CRC calculation.)

>    However, it would require a further tweak to find-debuginfo.sh.

Or perhaps less change there, after a fashion.  The place to put the new
work is either right after debugedit or right before eu-strip -f.  Off hand
I think it should be the former.  That will put an index into e.g. the
unstripped vmlinux, which gets copied into /usr/lib/debug but never passed
to eu-strip.

So one approach would be to replace the debugedit invocation with the use
of another shell script.  Then that new script can run debugedit and make
the gdb index.  It can be fiddled as needed without changing the core logic
in find-debuginfo.sh again.  We could possibly let that script be supplied
by the redhat-rpm-config rpm or the gdb rpm or something else, so that its
maintenance is not directly in the path of the rpm package maintainers.


Thanks,
Roland

  reply	other threads:[~2010-07-06 19:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 22:32 Tom Tromey
2010-06-29 23:21 ` Roland McGrath
2010-06-30 17:35   ` Tom Tromey
2010-06-30 18:14     ` Roland McGrath
2010-06-30 18:23       ` Tom Tromey
2010-06-30 20:42         ` Tom Tromey
2010-06-30 20:44           ` Roland McGrath
2010-06-30 21:25             ` Tom Tromey
2010-06-30 21:58               ` Tom Tromey
2010-06-30 22:00                 ` Tom Tromey
2010-06-30 22:14               ` Roland McGrath
2010-07-02 19:55                 ` Tom Tromey
2010-07-05  9:36                   ` Panu Matilainen
2010-07-05  9:48                     ` Jan Kratochvil
2010-07-05 10:39                       ` Panu Matilainen
2010-07-06 18:35                     ` Tom Tromey
2010-07-06 19:14                       ` Roland McGrath [this message]
2010-07-06 19:41                         ` Tom Tromey
2010-07-06 20:28                           ` Roland McGrath
2010-07-08 15:56                         ` Tom Tromey
2010-07-08 20:36                           ` Tom Tromey
2010-07-08 22:53                           ` Roland McGrath
2010-07-09  5:07                             ` Panu Matilainen
2010-07-09 17:48                               ` Tom Tromey
2010-07-30 21:36                                 ` Tom Tromey
2010-07-30 23:07                                   ` Roland McGrath
2010-07-30 23:09                                   ` Jan Kratochvil

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=20100706191407.535874824F@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=archer@sourceware.org \
    --cc=pmatilai@redhat.com \
    --cc=tromey@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).