Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* should minimal symbols be able to force lookup_symbol to return NULL?
@ 2002-10-28 11:16 David Carlton
  2002-10-30 15:15 ` David Carlton
  0 siblings, 1 reply; 8+ messages in thread
From: David Carlton @ 2002-10-28 11:16 UTC (permalink / raw)
  To: gdb; +Cc: Elena Zannoni, Jim Blandy

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-11-04 22:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-28 11:16 should minimal symbols be able to force lookup_symbol to return NULL? David Carlton
2002-10-30 15:15 ` David Carlton
2002-11-04 13:08   ` Jim Blandy
2002-11-04 14:14     ` David Carlton
2002-11-04 14:22       ` Elena Zannoni
2002-11-04 14:26         ` David Carlton
2002-11-04 14:55           ` Elena Zannoni
2002-11-04 14:57             ` David Carlton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox