[RFA] choose symbol from given block's objfile first.

Joel Brobecker brobecker@adacore.com
Wed May 9 20:40:00 GMT 2012


> It looks reasonable to me, but I wonder whether it is complete.
> That is -- there are a lot of uses of ALL_OBJFILES; I wonder whether any
> of them need updating.

I did a second audit, and found that a lot of those uses were for
purposes other than symbol lookup (finding the symtab associated
a PC, for instance), so an update shouldn't be needed there.

There are a couple of places where the loop is used to find symbols,
but collects all matching symbols instead of the first one.

There are also some locations where the loop is inside a routine
that does a lookup without "context".  For instance,
basic_lookup_transparent_type.  In that case, the only real caller
I could find was check_typedef, which I don't think we want to
change.

Then, there are the symtab iterators, which we might want to
update in order to allow a different iteration order.  But I think
it'll make better sense in that case to do what I just did, and
check the priority objfile first, and then call the iterator.
Following that thread, one can see that the callers of "lookup_symtab"
might want to ask that a particular objfile be checked first.
But in the end, I decided to stop looking, because the call tree
quickly explodes...

-- 
Joel



More information about the Gdb-patches mailing list