From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15013 invoked by alias); 4 Feb 2003 17:00:28 -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 14993 invoked from network); 4 Feb 2003 17:00:27 -0000 Received: from unknown (HELO mx1.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 4 Feb 2003 17:00:27 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h14H0Rf23975 for ; Tue, 4 Feb 2003 12:00:27 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h14H0Ra27697 for ; Tue, 4 Feb 2003 12:00:27 -0500 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h14H0Mh27582; Tue, 4 Feb 2003 12:00:23 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id 0C212FF79; Tue, 4 Feb 2003 12:04:33 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15935.62113.155403.217351@localhost.redhat.com> Date: Tue, 04 Feb 2003 17:00:00 -0000 To: David Carlton Cc: Elena Zannoni , gdb-patches@sources.redhat.com, Jim Blandy Subject: Re: [rfa] delete macro SYMBOL_LINKAGE_NAME In-Reply-To: References: <15934.46400.598795.544205@localhost.redhat.com> X-SW-Source: 2003-02/txt/msg00117.txt.bz2 David Carlton writes: > On Mon, 3 Feb 2003 13:30:24 -0500, Elena Zannoni said: > > David Carlton writes: > > >> This is the first part of my plan to clean up symbol accessors. It > >> deletes the macro SYMBOL_LINKAGE_NAME: that macro is only used in > >> two places in one function, and is easy to replace by an equivalent > >> use of asm_demangle, SYMBOL_SOURCE_NAME, and SYMBOL_NAME. Given > >> that I'd like to use the name SYMBOL_LINKAGE_NAME for something > >> else, I'd like to get rid of its current use. > > > can you expand a bit? > > As I posted in > , I really Whoops, another mail I overlooked. I just re-read it, yes, I think your plan makes sense. > think that it's important to clean up GDB's use of various names. I > want to make it as easy as possible for people to get at either the > source code names of symbols or the linkage names of symbols, and to > make it clear when they mean the one or the other. For the linkage > names, the best macro name that I've come up with is > SYMBOL_LINKAGE_NAME: so a not-to-distant step in this process will be > to introduce a macro SYMBOL_LINKAGE_NAME whose definition is exactly > the same as the definition of SYMBOL_NAME, but with the extra semantic > benefit that users of that macro will promise that they've actually > thought about the situation and decided that they really want the > linkage name instead of the source code name. > > But to do that, I have to get rid of the existing macro > SYMBOL_LINKAGE_NAME. (Or else think up another name, but here getting > rid of the existing macro seems preferable.) > > I'm certainly open to different names for these macros, if you'd > prefer something else. (Though I do think that getting rid of the > current SYMBOL_LINKAGE_NAME wouldn't be a bad idea, given how little > it's used.) > The one I wasn't sure about was the SYMBOL_PRINT_NAME. But i haven't thought through the whole issue. > >> if (symbol) > >> { > >> name_location = BLOCK_START (SYMBOL_BLOCK_VALUE (symbol)); > >> - if (do_demangle) > >> + if (do_demangle || asm_demangle) > > > why this change? I must be missing something. > > >> name_temp = SYMBOL_SOURCE_NAME (symbol); > >> else > >> - name_temp = SYMBOL_LINKAGE_NAME (symbol); > >> + name_temp = SYMBOL_NAME (symbol); > >> } > > > this one is ok. > > The current SYMBOL_LINKAGE_NAME (that I'm getting rid of) is > equivalent, I think, to > > asm_demangle ? SYMBOL_SOURCE_NAME : SYMBOL_NAME. > > So the old code > > if (do_demangle) > name_temp = SYMBOL_SOURCE_NAME (symbol); > else > name_temp = SYMBOL_LINKAGE_NAME (symbol); > > becomes > > if (do_demangle) > name_temp = SYMBOL_SOURCE_NAME (symbol); > else > { > if (asm_demangle) Ah, never mind, I did some quick grepping and I concluded, erroneously, that do_demangle == demangle, but that's not always the case. yes, this is fine. elena > name_temp = SYMBOL_SOURCE_NAME (symbol); > else > name_temp = SYMBOL_NAME (symbol); > } > > And then I combined the first two if statements into an or statement. > > David Carlton > carlton@math.stanford.edu