Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: Nick Clifton <nickc@redhat.com>
Cc: binutils@sources.redhat.com, gdb@sources.redhat.com
Subject: Re: fake symbols to aid debugging
Date: Tue, 29 Jul 2003 08:11:00 -0000	[thread overview]
Message-ID: <20030729081041.GN27145@bubble.sa.bigpond.net.au> (raw)
In-Reply-To: <m3r849u8z9.fsf@redhat.com>

On Tue, Jul 29, 2003 at 07:45:30AM +0100, Nick Clifton wrote:
> Hi Alan,
> 
> > I waste enough time doing this that I figure it's worth doing something
> > about it.  My first idea, already implemented, was to have the linker
> > emit extra symbols to identify the stubs.  This works well but bloats
> > the symbol table and isn't on by default.  A better idea would be to
> > create the stub symbols on the fly.  With that in mind, I propose to
> > add two new bfd functions
> >
> > long bfd_get_fake_symtab_upper_bound (bfd *abfd);
> > long bfd_canonicalize_fake_symtab (bfd *abfd, asymbol **buf);
> >
> > analogous to bfd_get_symtab_upper_bound and bfd_canonicalize_symtab.
> >
> > Comments?
> 
> Well a few questions actually:
> 
> Where would these fake symbols be held ?  In a new .fakesymtab
> section?  Or are they entirely ephemeral and never stored in the
> executable ?

They're ephemeral, but I discovered I needed to save some info away in
order to locate stubs.  For that reason, I think the idea of emitting
DWARF2 info for stubs is better.  Helps gdb out in tracing over stubs
too.

> Can the fake symbols be generated after the stubs are created ?  ie
> can they be created for already existing libraries/executables ?

That was my aim, but short of scanning all code it's hard to locate
stubs..

> Would gdb users be able to set breakpoints on these fake symbols ?

I think so.  It's a while since I poked around in gbd though..

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


      reply	other threads:[~2003-07-29  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-29  2:33 Alan Modra
2003-07-29  3:11 ` Daniel Jacobowitz
2003-07-29  3:34   ` Alan Modra
2003-07-29 12:48     ` Daniel Jacobowitz
2003-07-29  6:50 ` Nick Clifton
2003-07-29  8:11   ` Alan Modra [this message]

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=20030729081041.GN27145@bubble.sa.bigpond.net.au \
    --to=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=nickc@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