This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: only force symbol lookups with local variables on hppa
> Date: Sun, 20 Aug 2006 09:57:54 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> On Sun, Aug 20, 2006 at 03:10:42PM +0200, Mark Kettenis wrote:
> > > From: Mike Frysinger <vapier@gentoo.org>
> > > Date: Sun, 20 Aug 2006 09:03:06 -0400
> > >
> > > as a follow up to the slow script thread:
> > > http://sources.redhat.com/ml/gdb/2006-08/msg00099.html
> > >
> > > attached patch will change the behavior so symbols with dollar signs
> > > in them0 ($) are only looked up when a specific arch says to do so
> > > (with hppa being the only one at the moment)
> > > -mike
> >
> > > 2006-08-20 Mike Frysinger <vapier@gentoo.org>
> > >
> > > * parse.c (write_dollar_variable): Check LOOKUP_DOLLAR_SYMBOLS.
> > > * config/pa/tm-hppa.h [LOOKUP_DOLLAR_SYMBOLS]: Define.
> >
> > Sorry but, this implementation is not acceptable; we want to get rid
> > of all the defines in tm.h files (and the files themselves
> > eventually), not add more :(.
>
> As a followup, there are several better options:
>
> - Set a gdbarch hook. See gdbarch.sh.
> - Keep track of the number of symbols found which start with
> a '$', probably in each objfile. Only do the lookup if
> symbols starting with dollar have been found.
> - Just make partial symbol lookups faster.
And of these the last two are certainly preferable to the first
solution.
Actually, I'm afraid the assumption that symbols do not start with a
dollar sign isn't true on most platforms: I just created some
assembler code that contains such symbols and it assembles, links and
runs fine on OpenBSD/i386. I have no doubt that the same will be true
on other ELF systems using the GNU toolchain.
Mark