This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA]: Fix partial symbol lookups
Daniel Berlin <dberlin@redhat.com> writes:
> "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de> writes:
>
> > > > The previous version of lookup_partial_symbol (before your changes) would
> > > > have found both mangled and demangled names.
> > >
> > > Now this I take issue with.
> > > How could it possibly find demangled names, if it doesn't have access
> > > to them?
> > > lookup_partial_symbol didn't find demangled names before my patch on
> > > 10-12. It doesn't have the code to do so, as you pointed out yourself
> > > (because the SYMBOL_MATCHES_NAME is no better than the strcmp, since
> > > we have no access to demangled names), unless the symbol name was the
> > > demangled name, rather than the mangled name, which doesn't occur.
> >
> > Not true.
> > There were no demangled names in partial symbols from most symbol readers,
> > _except_ for the HP reader, which we are currently discussing, and which
> > I discovered rather late in the day as well.
> > Before your change, lookup_partial_symbol fell back to a linear search
> > if it didn't find the symbol and had the chance to find the demangled symbol
> > via SYMBOL_MATCHES_NAME during the linear search.
>
> Peter, you are missing an important point.
>
> *I* added that SYMBOL_MATCHES_NAME. Not HP. As the comment shows
> right above it.
>
> In the GDB-5.0 source, it's
>
> while (STREQ (SYMBOL_NAME (*top), name))
> {
> if (SYMBOL_NAMESPACE (*top) == namespace)
> {
> return (*top);
> }
> top++;
> }
>
Of course, I copied the wrong piece of code.
Sigh.
--Dan