From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29207 invoked by alias); 5 Feb 2003 00:24:41 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 29194 invoked from network); 5 Feb 2003 00:24:40 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 172.16.49.205 with SMTP; 5 Feb 2003 00:24:40 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h150OdZ17634; Tue, 4 Feb 2003 16:24:39 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: gdb-patches@sources.redhat.com Cc: Elena Zannoni Subject: [rfa] revert my previous search_symbols change, add comment From: David Carlton Date: Wed, 05 Feb 2003 00:24:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-02/txt/msg00158.txt.bz2 In my patch from 2002-12-23, I changed some code in search_symbols from a call to lookup_symbol to a call to lookup_symbol_aux_minsyms. At that time, I didn't understand exactly what lookup_symbol_aux_minsyms did; now that I understand that function better, I don't think that change was a good idea. So this patch reverts that change. At Andrew's suggestion, I've added a comment as well, saying what I'd really like to replace the call to lookup_symbol with. In my next patch, I'll change lookup_symbol_aux_minsyms to actually do something correct (now that Daniel has been kind enough to demangle partial symbols for me), but I wanted to get this part of the change out of the way first. Tested on i686-pc-linux-gnu/GCC3.1/DWARF-2; OK to apply? David Carlton carlton@math.stanford.edu 2003-02-04 David Carlton * symtab.c (search_symbols): Revert the search_symbols part of my 2002-12-23 patch. Add comment. Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.87 diff -u -p -r1.87 symtab.c --- symtab.c 4 Feb 2003 18:07:01 -0000 1.87 +++ symtab.c 4 Feb 2003 23:55:02 -0000 @@ -2967,31 +2967,18 @@ search_symbols (char *regexp, namespace_ { if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol))) { - if (kind == FUNCTIONS_NAMESPACE) - { - found_misc = 1; - } - else - { - struct symbol *sym; - - if (SYMBOL_DEMANGLED_NAME (msymbol) != NULL) - sym - = lookup_symbol_aux_minsyms (SYMBOL_DEMANGLED_NAME - (msymbol), - SYMBOL_NAME (msymbol), - VAR_NAMESPACE, - NULL, NULL); - else - sym - = lookup_symbol_aux_minsyms (SYMBOL_NAME (msymbol), - NULL, - VAR_NAMESPACE, - NULL, NULL); - - if (sym == NULL) - found_misc = 1; - } + /* FIXME: carlton/2003-02-04: Given that the + semantics of lookup_symbol keeps on changing + slightly, it would be a nice idea if we had a + function lookup_symbol_minsym that found the + symbol associated to a given minimal symbol (if + any). */ + if (kind == FUNCTIONS_NAMESPACE + || lookup_symbol (SYMBOL_NAME (msymbol), + (struct block *) NULL, + VAR_NAMESPACE, + 0, (struct symtab **) NULL) == NULL) + found_misc = 1; } } }