From: Jim Blandy <jimb@redhat.com>
To: David Carlton <carlton@math.stanford.edu>
Cc: gdb <gdb@sources.redhat.com>, Elena Zannoni <ezannoni@redhat.com>
Subject: Re: should minimal symbols be able to force lookup_symbol to return NULL?
Date: Mon, 04 Nov 2002 13:08:00 -0000 [thread overview]
Message-ID: <vt2wunthx9k.fsf@zenia.red-bean.com> (raw)
In-Reply-To: <ro18z0fr023.fsf@jackfruit.Stanford.EDU>
David Carlton <carlton@math.stanford.edu> writes:
> On 28 Oct 2002 11:16:31 -0800, David Carlton <carlton@math.Stanford.EDU> said:
>
> > 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.
>
> This isn't true: it only sometimes does that (if either it can find a
> symtab at the right address or if it wants to try a name lookup with
> the mangled name). Sigh. This is a mess.
Yeah. I don't think that's deliberate behavior, since it doesn't
happen under any consistent circumstances.
As far as I can tell, the minsyms are in lookup_symtab_aux strictly as
a faster way to find the right psymtab: look up the minsym by name,
get its address, find the psymtab that covers that address. This does
an address range comparison per psymtab, instead of a hash probe. But
we know that our psymtab address ranges are inaccurate at times (C++
can scatter a single CU's code across disjoint parts of the text
segment), so this seems like a rotten approach.
I suspect that HP found the same problem you have: look at Rich
Title's comment below (starting with "RT:"):
#ifdef HPUXHPPA
/* Check for the possibility of the symbol being a function or
a global variable that is stored in one of the minimal symbol tables.
The "minimal symbol table" is built from linker-supplied info.
RT: I moved this check to last, after the complete search of
the global (p)symtab's and static (p)symtab's. For HP-generated
symbol tables, this check was causing a premature exit from
lookup_symbol with NULL return, and thus messing up symbol lookups
of things like "c::f". It seems to me a check of the minimal
symbol table ought to be a last resort in any case. I'm vaguely
worried about the comment below which talks about FORTRAN routines "foo_"
though... is it saying we need to do the "minsym" check before
the static check in this case?
*/
Perhaps we should remove the HPUXHPPA conditional, and just do it the
HPUXHPPA way all the time.
next prev parent reply other threads:[~2002-11-04 21:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-28 11:16 David Carlton
2002-10-30 15:15 ` David Carlton
2002-11-04 13:08 ` Jim Blandy [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vt2wunthx9k.fsf@zenia.red-bean.com \
--to=jimb@redhat.com \
--cc=carlton@math.stanford.edu \
--cc=ezannoni@redhat.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox