From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8788 invoked by alias); 3 Feb 2003 18:41:58 -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 8741 invoked from network); 3 Feb 2003 18:41:58 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 172.16.49.205 with SMTP; 3 Feb 2003 18:41:58 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h13IfoU23380; Mon, 3 Feb 2003 10:41:50 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Elena Zannoni Cc: gdb-patches@sources.redhat.com, Jim Blandy Subject: Re: [rfa] delete macro SYMBOL_LINKAGE_NAME References: <15934.46400.598795.544205@localhost.redhat.com> From: David Carlton Date: Mon, 03 Feb 2003 18:41:00 -0000 In-Reply-To: <15934.46400.598795.544205@localhost.redhat.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-02/txt/msg00076.txt.bz2 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 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.) >> 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) 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