This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA]: Fix partial symbol lookups


> > 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.
	.
	.
> 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.

Sorry, but wrong again.
Since gdb-4.8 we have the following in lookup_partial_symbol:

          if (!do_linear_search && SYMBOL_LANGUAGE (center) == language_cplus)
            {
              do_linear_search = 1;
            }

So lookup_partial_symbol falls back to a linear search if either the mangled
or demangled partial symbol is not found.
And the linear search does this:

              if (SYMBOL_MATCHES_NAME (psym, name))
                {
                  return (psym);
                }

which will match either the mangled or the demangled partial symbol name.

It might have been my fault not to remove all this in gdb-4.14, as the symbol
readers back then wouldn't have needed it.
But now with the HP symtab reader and the HPUXHPPA defines in lookup_symbol
it might be needed again.
At least _I_ don't dare to remove it.

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]