From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30416 invoked by alias); 3 Feb 2003 18:30:02 -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 30408 invoked from network); 3 Feb 2003 18:30:01 -0000 Received: from unknown (HELO mx1.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 3 Feb 2003 18:30:01 -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 h13IU1f02944 for ; Mon, 3 Feb 2003 13:30:01 -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 h13IU1a02634 for ; Mon, 3 Feb 2003 13:30:01 -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 h13IS5Q03710; Mon, 3 Feb 2003 13:28:05 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id BE10CFF7B; Mon, 3 Feb 2003 13:30:24 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15934.46400.598795.544205@localhost.redhat.com> Date: Mon, 03 Feb 2003 18:30:00 -0000 To: David Carlton Cc: gdb-patches@sources.redhat.com, Elena Zannoni , Jim Blandy Subject: Re: [rfa] delete macro SYMBOL_LINKAGE_NAME In-Reply-To: References: X-SW-Source: 2003-02/txt/msg00072.txt.bz2 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? > Tested on i686-pc-linux-gnu/GCC3.1/DWARF-2 (and seems obviously > correct by inspection, assuming that you agree that its goal is > valid). OK to commit? > Ok in theory, but I don't understand something, see below. > David Carlton > carlton@math.stanford.edu > > 2003-01-20 David Carlton > > * symtab.h (SYMBOL_LINKAGE_NAME): Delete. > * printcmd.c (build_address_symbolic): Replace uses of > SYMBOL_LINKAGE_NAME by equivalent uses of SYMBOL_SOURCE_NAME, > SYMBOL_NAME, and asm_demangle. > Update copyright. > > Index: symtab.h > =================================================================== > RCS file: /cvs/src/src/gdb/symtab.h,v > retrieving revision 1.55 > diff -u -p -r1.55 symtab.h > --- symtab.h 19 Jan 2003 04:06:46 -0000 1.55 > +++ symtab.h 21 Jan 2003 00:18:36 -0000 > @@ -172,17 +172,6 @@ extern char *symbol_demangled_name (stru > ? SYMBOL_DEMANGLED_NAME (symbol) \ > : SYMBOL_NAME (symbol)) > > -/* Macro that returns the "natural assembly name" of a symbol. In C++ this is > - the "mangled" form of the name if demangle is off, or if demangle is on and > - asm_demangle is off. Otherwise if asm_demangle is on it is the "demangled" > - form. In other languages this is just the symbol name. The result should > - never be NULL. */ > - > -#define SYMBOL_LINKAGE_NAME(symbol) \ > - (demangle && asm_demangle && SYMBOL_DEMANGLED_NAME (symbol) != NULL \ > - ? SYMBOL_DEMANGLED_NAME (symbol) \ > - : SYMBOL_NAME (symbol)) > - > /* Macro that tests a symbol for a match against a specified name string. > First test the unencoded name, then looks for and test a C++ encoded > name if it exists. Note that whitespace is ignored while attempting to > Index: printcmd.c > =================================================================== > RCS file: /cvs/src/src/gdb/printcmd.c,v > retrieving revision 1.50 > diff -u -p -r1.50 printcmd.c > --- printcmd.c 21 Nov 2002 18:54:44 -0000 1.50 > +++ printcmd.c 21 Jan 2003 00:56:47 -0000 > @@ -1,7 +1,7 @@ > /* Print values for GNU debugger GDB. > > Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, > - 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software > + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software > Foundation, Inc. > > This file is part of GDB. > @@ -639,10 +639,10 @@ build_address_symbolic (CORE_ADDR addr, > 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. > if (msymbol != NULL) > @@ -654,10 +654,10 @@ build_address_symbolic (CORE_ADDR addr, > symbol = 0; > symtab = 0; > name_location = SYMBOL_VALUE_ADDRESS (msymbol); > - if (do_demangle) > + if (do_demangle || asm_demangle) > name_temp = SYMBOL_SOURCE_NAME (msymbol); > else > - name_temp = SYMBOL_LINKAGE_NAME (msymbol); > + name_temp = SYMBOL_NAME (msymbol); > } > } > if (symbol == NULL && msymbol == NULL)