From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28252 invoked by alias); 30 Aug 2002 03:28:13 -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 28245 invoked from network); 30 Aug 2002 03:28:11 -0000 Received: from unknown (HELO zenia.red-bean.com) (66.244.67.22) by sources.redhat.com with SMTP; 30 Aug 2002 03:28:11 -0000 Received: (from jimb@localhost) by zenia.red-bean.com (8.11.6/8.11.6) id g7U3F5B05897; Thu, 29 Aug 2002 22:15:05 -0500 To: gdb-patches@sources.redhat.com Subject: Re: RFA: don't use minsym name when searching block References: <200208220526.g7M5Qp520822@zenia.red-bean.com> <20020822125030.GA27560@nevyn.them.org> <20020829215155.GA24578@nevyn.them.org> From: Jim Blandy Date: Thu, 29 Aug 2002 21:01:00 -0000 In-Reply-To: <20020829215155.GA24578@nevyn.them.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.90 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-08/txt/msg01025.txt.bz2 I've committed the following, which differs from my original patch: 1) it fixes the analogous uses in the HPPAHPUX block, and 2) it includes comments explaining why using the minsym name is inappropriate. 2002-08-29 Jim Blandy * symtab.c (lookup_symbol_aux): In the cases where we find a minimal symbol of an appropriate name and use its address to select a symtab to read and search, use `name' (as passed to us) as the demangled name when searching the symtab's global and static blocks, not the minsym's name. Index: gdb/symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.68 diff -c -r1.68 symtab.c *** gdb/symtab.c 1 Aug 2002 17:18:33 -0000 1.68 --- gdb/symtab.c 30 Aug 2002 02:18:57 -0000 *************** *** 860,874 **** /* This is a function which has a symtab for its address. */ bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); ! sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol), ! mangled_name, namespace); /* We kept static functions in minimal symbol table as well as in static scope. We want to find them in the symbol table. */ if (!sym) { block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); ! sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol), ! mangled_name, namespace); } /* sym == 0 if symbol was found in the minimal symbol table --- 860,879 ---- /* This is a function which has a symtab for its address. */ bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); ! ! /* This call used to pass `SYMBOL_NAME (msymbol)' as the ! `name' argument to lookup_block_symbol. But the name ! of a minimal symbol is always mangled, so that seems ! to be clearly the wrong thing to pass as the ! unmangled name. */ ! sym = lookup_block_symbol (block, name, mangled_name, namespace); /* We kept static functions in minimal symbol table as well as in static scope. We want to find them in the symbol table. */ if (!sym) { block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); ! sym = lookup_block_symbol (block, name, ! mangled_name, namespace); } /* sym == 0 if symbol was found in the minimal symbol table *************** *** 1027,1041 **** { bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); ! sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol), ! mangled_name, namespace); /* We kept static functions in minimal symbol table as well as in static scope. We want to find them in the symbol table. */ if (!sym) { block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); ! sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol), ! mangled_name, namespace); } /* If we found one, return it */ if (sym) --- 1032,1050 ---- { bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); ! /* This call used to pass `SYMBOL_NAME (msymbol)' as the ! `name' argument to lookup_block_symbol. But the name ! of a minimal symbol is always mangled, so that seems ! to be clearly the wrong thing to pass as the ! unmangled name. */ ! sym = lookup_block_symbol (block, name, mangled_name, namespace); /* We kept static functions in minimal symbol table as well as in static scope. We want to find them in the symbol table. */ if (!sym) { block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); ! sym = lookup_block_symbol (block, name, ! mangled_name, namespace); } /* If we found one, return it */ if (sym)