From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20264 invoked by alias); 29 Aug 2002 21:50:51 -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 20256 invoked from network); 29 Aug 2002 21:50:50 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 29 Aug 2002 21:50:50 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17kY7t-0006j5-00; Thu, 29 Aug 2002 17:50:57 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17kXCl-0006XI-00; Thu, 29 Aug 2002 17:51:55 -0400 Date: Thu, 29 Aug 2002 14:51:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: don't use minsym name when searching block Message-ID: <20020829215155.GA24578@nevyn.them.org> Mail-Followup-To: Jim Blandy , gdb-patches@sources.redhat.com References: <200208220526.g7M5Qp520822@zenia.red-bean.com> <20020822125030.GA27560@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2002-08/txt/msg01006.txt.bz2 On Thu, Aug 29, 2002 at 04:24:16PM -0500, Jim Blandy wrote: > Daniel Jacobowitz writes: > > > On Thu, Aug 22, 2002 at 12:26:51AM -0500, Jim Blandy wrote: > > > > > > I'd appreciate it if the C++ folks could check this out. I don't have > > > a test case yet, but I'll try to put one together tomorrow. > > > > Could you describe the problem? Also... "the minsym's name might be > > mangled" definitely seems like a problem; they should either be > > consistently mangled or demangled... > > Minimal symbol names are consistently mangled, which makes sense: > they're linker symbols, after all. You have to use > SYMBOL_DEMANGLED_NAME to get a minsym's demangled name. But the names > of real symbols (struct symbol) are always demangled. So when we pass > SYMBOL_NAME (msymbol) to lookup_block_symbol, we're passing a name > guaranteed to be mangled to a function that expects a demangled name. > > I'm working on a test case for this. The symptom is that, when you > try to set a breakpoint on a method, say foo::bar, you get an error > message, but if you then repeat the exact same command, it works the > second time. Oh! In that case, I think I have a test case for it tucked away in a bug report; I'll look for it. That makes much more sense now. > What's going on is that, the first time we call lookup_symbol_aux, > which is passed both the mangled name and the demangled name, we hit > the case being patched: we find a minsym, and read the symtab whose > address range contains the minsym's value. However, since we then > search the global and static blocks using the mangled name, we fail. > > The second time we try to lookup foo::bar, the symtab has been read, > and the ALL_SYMTABS loop finds the symbol. Thanks for the explanation. Shouldn't the code that does the same thing in the (#&@ HPUXHPPA block further down have the same fix applied? Other than that, it looks good to me. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer