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


"Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de> writes:

> Dan, have you looked at the HPUXHPPA defines in lookup_symbol ?
> These make me believe that the HP reader indeed needs lookups on partial
> symbols.
> 
> In this case, you have a problem when lookup_symbol is called with e.g.
> overload1arg(int) (when we want to set a breakpoint at the function in
> cplusfuncs).
> 
> As lookup_symbol_aux has no access to the mangled name, a lookup in the
> partial symbols will fail, as you are looking for a demangled name in the
> mangled names.
> The previous version of lookup_partial_symbol (before your changes) would
> have found both mangled and demangled names.

And just for the record, this is wrong, and the source of many
annoying bugs i've tried to track down (such as where we would or wouldn't find a C++
operator symbol depending on when you tried to call
it. lookup_partial_symbol wouldn't find it, but lookup_symbol and
lookup_minimal_symbol would.).

I grabbed gdb-5.0 source, which certainly does not have my changes in
it, and lo and behold, it doesn't find demangled names in partial
symbols. Try it yerself if you like.

It's possible this is because of your change in 1994 to make partial
symbols no longer have demangled names.
But we certainly no longer find demangled names in partial symbols,
since at least 5 months before my changes.
In fact, I was actually of the impression that we weren't supposed to, since we
never have since as long as i've been working on GDB.
If lookup_partial_symbol is supposed to be able to find demangled
names, then it needs access to the demangled names, which partial
symbols don't have.
We'd either have to transform demangled names back into mangled ones,
or include demangled names in partial symbols, to have this work..

Alternatively, you could SYMBOL_INIT_DEMANGLED_NAME in
lookup_partial_symbol, before calling SYMBOL_MATCHES_NAME.

but SYMBOL_MATCHES_NAME won't ever see a demangled name on the partial
symbols, and thus, never find a demangled name.


--Dan




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