[rfa] clean up lookup_symbol_aux

David Carlton carlton@math.stanford.edu
Mon Oct 7 10:43:00 GMT 2002


On 02 Oct 2002 14:50:34 -0700, David Carlton <carlton@math.Stanford.EDU> said:

> * I decided to reorder the search order: in the non-HPUXHPPA case, it
>   makes sense to me to search global psymtabs before searching minimal
>   symbols.  The theory there is that you should look for symbols with
>   debugging information before looking for symbols without debugging
>   information; also it seems to me that the current code might, in
>   some situations, find a static symbol via searching the minsyms
>   before it finds a global symbol via searching the psymtabs, which is
>   definitely a bad outcome.

Actually, I didn't understand lookup_minimal_symbol well enough when I
wrote the above; now I no longer think that the existing code might
find a static symbol via minsyms before a global symbol via psymtabs.

I still think that it would be a good idea to search psymtabs before
searching minimal symbols, but I prefer that only because I think it's
slightly cleaner, not because of any correctness reasons.  (And I'm
not sure which side efficiency concerns land on in this situation;
it's kind of complicated.  For all I know, it might even be more
efficient to move the minimal symbol search before the symtab search!)

And, of course, I still think that the general idea of cleaning up
lookup_symbol_aux and combining duplicate code is a good one.  I'm
just more agnostic about what order the resulting patch should call
lookup_symbol_aux_symtabs, lookup_symbol_aux_psymtabs, and
lookup_symbol_aux_minsyms in.

David Carlton
carlton@math.stanford.edu



More information about the Gdb-patches mailing list