From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5901 invoked by alias); 4 Nov 2002 22:14:45 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 5894 invoked from network); 4 Nov 2002 22:14:45 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 4 Nov 2002 22:14:45 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id gA4MEcA26907; Mon, 4 Nov 2002 14:14:38 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Jim Blandy Cc: gdb , Elena Zannoni Subject: Re: should minimal symbols be able to force lookup_symbol to return NULL? References: From: David Carlton Date: Mon, 04 Nov 2002 14:14:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-11/txt/msg00046.txt.bz2 On 04 Nov 2002 15:53:43 -0500, Jim Blandy said: > David Carlton writes: >> On 28 Oct 2002 11:16:31 -0800, David Carlton 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. Oh, good. > 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? > */ Right. Though, like Rich, I'm also vaguely worried about the Fortran comment that comes later. > Perhaps we should remove the HPUXHPPA conditional, and just do it > the HPUXHPPA way all the time. I've got some plausible scenarios which might allow both the HPUXHPPA and non-HPUXHPPA cases to work without #ifdefs and which would allow minsyms to be used as a speed optimization without affecting correctness. Basically, what they boil down to is keeping the minsym check in its non-HPUXHPPA location, but making sure that it never returns a NULL result; since that's what the above comment is complaining about, it seems plausible that that would allow us to remove the HPUXHPPA #ifdef. I'll wait until my first stab at refactoring (which, I hope, preserves the current behavior exactly) (well, almost exactly: there's one or two changes which I think of as bugfixes, but it's quite careful about control flow) gets approved before I submit an RFA for that. Certainly I'm glad that Joel has appeared and is willing to run proposed changes through the testsuite on HP/UX machines. David Carlton carlton@math.stanford.edu