From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11970 invoked by alias); 28 Oct 2002 19:16:35 -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 11943 invoked from network); 28 Oct 2002 19:16:33 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 28 Oct 2002 19:16:33 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id g9SJGWd20065; Mon, 28 Oct 2002 11:16:32 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: gdb Subject: should minimal symbols be able to force lookup_symbol to return NULL? Cc: Elena Zannoni , Jim Blandy From: David Carlton Date: Mon, 28 Oct 2002 11:16:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-10/txt/msg00196.txt.bz2 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