From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13813 invoked by alias); 2 Oct 2002 20:02:15 -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 13781 invoked from network); 2 Oct 2002 20:02:14 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 2 Oct 2002 20:02:14 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17wqcW-0004rq-00; Wed, 02 Oct 2002 16:01:25 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17wph5-0001IO-00; Wed, 02 Oct 2002 16:02:03 -0400 Date: Wed, 02 Oct 2002 13:02:00 -0000 From: Daniel Jacobowitz To: David Carlton Cc: Jim Blandy , gdb-patches@sources.redhat.com Subject: Re: RFA: Search for symbol names the same way they're hashed. Message-ID: <20021002200203.GA4762@nevyn.them.org> Mail-Followup-To: David Carlton , Jim Blandy , gdb-patches@sources.redhat.com References: <200210020329.g923TE702388@zenia.red-bean.com> 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-10/txt/msg00071.txt.bz2 On Wed, Oct 02, 2002 at 12:41:46PM -0700, David Carlton wrote: > On 02 Oct 2002 14:18:51 -0500, Jim Blandy said: > > David Carlton writes: > > >> 1) This concept of 'a name that is as demangled as possible' is a > >> pretty important one and occurs in multiple places in GDB's sources, > > > Yeah, I think we need something like that, too. > > > How about SYMBOL_DEMANGLEDEST_NAME? Um. > > Um indeed. Dare I suggest SYMBOL_SEARCH_NAME? That is, the only name we should search for when we're looking up this function in symbol tables. Since that's the other use. > > I just did a quick survey of the uses of SYMBOL_SOURCE_NAME. > > Thanks! I'd been meaning to do that, but I hadn't gotten around to it > yet. Also, somebody should look at all uses of SYMBOL_DEMANGLED_NAME > to see which ones are part of a chunk of code that could be replaced > by SYMBOL_BEST_NAME. > > > They all fall into two categories: > > - printing symbol names, and > > - sort comparison functions. > > > The first usage is exactly correct: the way a symbol prints should > > respect the current demangling setting. > > > The second usage seems wrong to me: if you sort under one demangling > > setting, but then search under a different one, well, ... duh. > > Right. That's exactly what I was afraid of: we should make it clear > that SYMBOL_SOURCE_NAME is for external use only. (Both by comments > and by renaming it, as you suggest below.) Blech. There's some of these left? I swear I fixed them! I see, in symtab.c, bogus uses in lookup_partial_symbol and lookup_block_symbol, but only in the linear search code. So I think I got the rest. The ones for sort_search_symbols are benign. > > The source code name of a symbol does not depend depend on the current > > demangling setting; the way it should be printed obviously does. So > > I'd suggest: > > - changing the first category of uses to use SYMBOL_PRINT_NAME, > > a new macro which will be defined just like the current > > SYMBOL_SOURCE_NAME (or David's defn below looks nice, too), and > > - defining a new SYMBOL_SOURCE_NAME which does what David's > > SYMBOL_BEST_NAME does above. > > I agree. I agree about SYMBOL_PRINT_NAME... or, how about SYMBOL_PRINTABLE_NAME? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer