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 ?
Yes, I have.

> These make me believe that the HP reader indeed needs lookups on partial
> symbols.

I meant inside the HP symreader itself.

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

Err, I submitted a patch to pass the mangled name down to
lookup_symbol_aux and lookup_partial_symbol. Isn't that how this whole
discussion started? 
I also changed compare_psymbols to use the mangled names again.
In fact, the patch should make lookup_partial_symbol and
compare_psymbols the same as it was before my 10-12 changes, except
it'll binary search, rather than linear search. 


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


> 
> Your guesses are as good as mine, but before touching the HP code or 
> continuing with speculations on how it should work or not, you'd better
> ask someone who is familiar with the HP code.

I'm waiting for someone from HP to answer, as we speak.

> 
> I am really getting tired of arguing with you over all these issues.
> Your 2000-10-12 changes _are_ broken, and I am not yet convinced that we will
> really get away with your simplistic assumptions.

Yes, they are broken for partial symbols, which is why i submitted a
fix for partial symbols, which is how this whole discussion started.
There is also an infinite recursion issue with minsyms, which you
submitted a patch for, but the patch hasn't been approved yet.

> 
> As a starter, the problems mentioned in
> http://sources.redhat.com/ml/gdb-patches/2000-10/msg00230.html
> http://sources.redhat.com/ml/gdb-patches/2000-10/msg00247.html
> http://sources.redhat.com/ml/gdb-patches/2000-10/msg00248.html
> http://sources.redhat.com/ml/gdb-patches/2000-10/msg00220.html
> are still not addressed. 

The first one includes a patch, as soon as it's approved, it'll be
applied.
The second one points out things this patch fixes.
The third one is the same.
The fourth one has to do with makefile tweaking, so i have no clue
what that has to do with anything.

> I'd be curious how you intend to solve the
> `maint check' problem, for example.
> 
> While looking at all the issues, I am also wondering, if the usage
> of current_language->la_language in lookup_symbol will not cause problems
> further down the road. What happens if execution stops in a C frame and you
> want to access C++ information ?

The same thing that would happen otherwise. You might hit a problem if
you try to specifically look up a mangled name from a C frame, but
with the patch to use mangled names in partial symbols, it should find
the partial symbol just fine.

Look:
I'm happy to revert the patches if you think they are completely
wrong. However, if they need fixing, then let's fix them, rather than
throw them away.

I could care less either way at this point, as i'm tired of arguing
too.
I didn't intend to start an argument by submitting a patch to fix the
partial symbol lookups that broke.

--Dan

> 
> > "Peter.Schauer" <Peter.Schauer@regent.e-technik.tu-muenchen.de> writes:
> > 
> > > > Daniel Berlin wrote:
> > > > 
> > > > > Correct.
> > > > > But this never worked since 1994 anyway, since psymbols have no
> > > > > demangled name in them.
> > > > > :)
> > > > 
> > > > Good catch!  I too remember the comments that imply that
> > > > mangled names are in there, and have assumed they were true.
> > > 
> > > They were not true from 1994 - Dec 1998 and I should be blamed that I
> > > didn't remove the code and comment when I removed the demangling of 
> > > partial symbols back in 1994, my sincere apologies.
> > > 
> > > > > I also corrected lookup_partial_symbol to binary search the global
> > > > > table, regardless of language, since this is the part that had led me
> > > > > to believe it had demangled names in it in the first place. 
> > > > 
> > > > Are you SURE that NO language puts mangled names in?
> > > > If so, then this should be a big improvement.
> > > 
> > > I just double checked once again. 
> > > add_psymbol_to_list (which is used by most symbol readers) calls 
> > > SYMBOL_INIT_LANGUAGE_SPECIFIC (&psymbol, language), which sets the demangled
> > > name to NULL.
> > > 
> > > But wait, the HP patches reintroduced the demangling of partial symbols
> > > for their symbol reader (look for add_psymbol_with_dem_name_to_list).
> > 
> > This shouldn't make a difference, unless it's using the demangled name
> > as the symbol name, rather than using SYMBOL_INIT_DEMANGLED_NAME (IE
> > the right way is so the demangled name is the demangled name, the symbol name is the
> > mangled name)
> > > 
> > > This is really bad, as GDB now has to cope with the presence and non-presence
> > > of demangling in partial symbols. I'd be very reluctant to reintroduce
> > > the demangling of partial symbols for all other symbol readers, instead
> > > someone should fix the HP reader to not need the demangling of partial
> > > symbols.
> > 
> > It shouldn't.
> > 
> > > 
> > > I am now afraid that we have to back out all 2000-10-12 Dan Berlin changes,
> > > to get a reliably working (and perhaps sometimes slower) GDB again.
> > > 
> > 
> > No, we don't.
> > Unless they are using the demangled name as the symbol name, which is
> > incorrect anyway.
> > As long as they have the mangled name, it'll be found in a partial
> > symbol lookup just the same as it would be found elsewhere.
> > IE it won't find more or less symbols than it would using any other
> > debug format.
> 
> -- 
> 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]