From: Alexander Larsson <alexl@redhat.com>
To: Jim Blandy <jimb@redhat.com>
Cc: gdb@sources.redhat.com
Subject: Re: External debug symbols
Date: Wed, 21 Aug 2002 23:51:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.44.0208220240260.12684-100000@devserv.devel.redhat.com> (raw)
In-Reply-To: <vt2n0rg6ro2.fsf@zenia.red-bean.com>
On 21 Aug 2002, Jim Blandy wrote:
> Wow, that's a lot less work than I expected it to be. It doesn't look
> especially wrong to me. Basically, the presence of a .debuglink
> section tells GDB that, whenever it loads one objfile, it should also
> load the other. When the stripped objfile is freed, the other one is
> freed, too.
Since I don't know much about the gdb codebase I tried to look for the
solution that required the smallest amount of changes. But yeah, I was
also a bit amazed how easy it was.
> Sun's toolchain, I'm told, has the ability to simply leave the debug
> info in the .o files, and just put what amounts to an index in the
> executable file. The debugger is responsible for figuring out which
> .o file has the data it needs, and applying any relocs to the debug
> info based on the symbol values in the linked executable. This makes
> linking a lot faster, and keeps executables small. This would also
> address your distribution size problem, but it would also be helpful
> to developers in their everyday work as well.
It does sound nice, but it also sounds like an load of work. And for us
having just one file with debug information per lib/executable is actually
preferable, from a packagaging perspective.
> But since the .debuglink change is so simple, it seems a shame to put
> that on hold in favor of an alternative solution which I expect will
> take a lot more work, and may never get done.
>
> .debuglink looks like a Dwarf 2 section name. How about .gnu_debuglink?
I will change that.
> I'm also concerned about the deallocation policy. I think your change
> will break the ALL_OBJFILES_SAFE macro, since the `nxt' pointer the
> macro carefully caches before evaluating the `for' body will become
> invalid if the body goes and frees the objfile it points to.
>
> Along similar lines --- what would happen if the debug objfile gets
> unloaded before the stripped objfile? Wouldn't the stripped objfile
> still have a dangling pointer to the now-gone debug objfile? I can't
> think of a situation where this would happen, but it would be nice to
> be confident that it didn't matter.
The later problem could be fixed by having a back-pointer from the debug
objfile to the original one, and NULLing out the other pointer when the
debug objfile is freed.
The first issue sounds harder. It could be handled by making sure the
debug file is always in front of the original file in the object_files
list. But that sounds somewhat fragile.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Alexander Larsson Red Hat, Inc
alexl@redhat.com alla@lysator.liu.se
He's a notorious chivalrous cowboy on his last day in the job. She's a
disco-crazy paranoid vampire looking for love in all the wrong places. They
fight crime!
next prev parent reply other threads:[~2002-08-22 6:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-20 12:50 Alexander Larsson
2002-08-21 6:39 ` Alexander Larsson
2002-08-21 10:46 ` Jim Blandy
2002-08-21 23:51 ` Alexander Larsson [this message]
2002-08-27 3:59 ` Alexander Larsson
2002-09-16 6:59 ` Alexander Larsson
2002-09-20 8:13 ` Elena Zannoni
2002-09-20 8:22 ` Daniel Jacobowitz
2002-09-23 0:46 ` Alexander Larsson
2002-09-23 0:43 ` Alexander Larsson
2002-09-23 8:21 ` Alexander Larsson
2002-09-23 8:25 ` Daniel Jacobowitz
2002-09-23 10:03 ` Alexander Larsson
2002-09-23 21:45 ` Eli Zaretskii
2002-09-25 1:51 ` Alexander Larsson
2002-09-25 22:00 ` Eli Zaretskii
2002-10-02 7:42 ` Alexander Larsson
2002-10-02 21:40 ` Eli Zaretskii
2002-10-08 8:21 ` Alexander Larsson
2002-10-08 9:33 ` Eli Zaretskii
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=Pine.LNX.4.44.0208220240260.12684-100000@devserv.devel.redhat.com \
--to=alexl@redhat.com \
--cc=gdb@sources.redhat.com \
--cc=jimb@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