This is the mail archive of the gdb@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]
Other format: [Raw text]

should minimal symbols be able to force lookup_symbol to return NULL?


Currently, it seems to me that, when lookup_symbol_aux is searching
the minsyms, if it finds a minsym without a corresponding symbol, then
lookup_symbol_aux will return NULL without proceeding on to the check
of the static symtabs/psymtabs.

Is this a desirable property to preserve?  Some versions of my
proposed rewrite to lookup_symbol_aux break that property (not on
purpose, I just hadn't realized that lookup_symbol_aux had that
property); now I'm worried that that is a mistake.

Specifically, I'm willing to believe that if we have a global minimal
symbol without a corresponding global symbol (presumably from a file
compiled without -g), then lookup_symbol_aux should never search the
static blocks.  After all, searching the static blocks is more of a
hack to try to hallucinate something useful to do if we can't do the
right thing, and in this situation it seems like the right thing to do
would be to try to extract information from the appropriate minimal
symbol.

But I don't know enough about the callers of lookup_symbol to be sure
here: are any of them persistent enough to search minimal symbols if
lookup_symbol returns null?  Actually, maybe I can answer that myself:
decode_line_1 does seem to do that, and it might not be the only such
caller.

Also, another issue: say that minsym lookup discovers a global minimal
symbol without a corresponding global symbol.  (And say that we're in
the non-HP case.)  Assuming that we agree that we shouldn't search for
a static symbol, then should we do a global psymtab search or not?  If
you think we shouldn't do a global psymtab search, do you say that for
optimization reasons or semantic reasons?

Currently, we don't do the global psymtab search (unless we're in the
HPPA case, in which case the minsym search happens much later).  I'd
be willing to believe that the current behavior arises from claiming
that symbol tables "should" never have a minimal symbol without a
symbol but with a partial symbol, so we might as well optimize out the
partial symbol search (which can be expensive), except that maybe
HP-generated symbol tables can lead to situations where this doesn't
work and where you really do need to do the partial symbol search as
well.

Any comments on this would be appreciated.  Right now I'm leaning
towards allowing global minimal symbol lookup to cancel static symbol
lookups, and I'm waffling on allowing it to cancel global partial
symbol lookups in the non-HP case.

David Carlton
carlton@math.stanford.edu


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