Re: [RFA]: Fix partial symbol lookups

Daniel Berlin
2000-11-16T08:56:00Z

"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++;
}

So we couldn't have possibly been finding demangled names until I
added that, and since the HP code is older than the change to use
SYMBOL_MATCHES_NAME, they couldn't have had demangled names working in
partial symbol lookups.
--Dan