This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] bug in symtab.c:lookup_block_symbol()'s search method
- To: Michael Snyder <msnyder at cygnus dot com>
- Subject: Re: [RFA] bug in symtab.c:lookup_block_symbol()'s search method
- From: Jason Molenda <jason-swarelist at molenda dot com>
- Date: Mon, 10 Sep 2001 11:32:26 -0700
- Cc: gdb-patches at sources dot redhat dot com
- References: <20010909074800.A8112@shell17.ba.best.com> <3B9D054A.4C3CC2B1@cygnus.com>
On Mon, Sep 10, 2001 at 11:24:10AM -0700, Michael Snyder wrote:
> > + if (SYMBOL_SOURCE_NAME (sym)[0] > name[0])
> > + {
> > + break;
> > + }
>
> If this test works, then wouldn't some sort of strcmp test work too?
It is comparing unmangled names, so there may be space chars which
are not significant. I don't know enough about mangling to be
confident that I could put a strcmp in here safely. I'll try it
out later today and see if the testsuite happens to trip up on it.
The SYMBOL_MATCHES_NAME() call used for the actual comparison uses
util.c:strcmp_iw, which skips over whitespace.
(On the good news side, when I first started working on this loop,
I found that using strcmp() to detect matches produced a number of
testsuite regressions, helping to Show Me The Light.)
Jason