From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30679 invoked by alias); 4 May 2011 17:33:02 -0000 Received: (qmail 30641 invoked by uid 22791); 4 May 2011 17:33:01 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate4.uk.ibm.com (HELO mtagate4.uk.ibm.com) (194.196.100.164) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 May 2011 17:32:46 +0000 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate4.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p44HWiQ6017322 for ; Wed, 4 May 2011 17:32:44 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p44HXuFo2461708 for ; Wed, 4 May 2011 18:33:56 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p44HWi6Q008807 for ; Wed, 4 May 2011 11:32:44 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p44HWhvj008763; Wed, 4 May 2011 11:32:43 -0600 Message-Id: <201105041732.p44HWhvj008763@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 04 May 2011 19:32:43 +0200 Subject: Re: Is physname mangled or not? (PR c++/8216) To: jan.kratochvil@redhat.com (Jan Kratochvil) Date: Wed, 04 May 2011 17:33:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, keiths@redhat.com (Keith Seitz) In-Reply-To: <20110504150846.GA27179@host1.jankratochvil.net> from "Jan Kratochvil" at May 04, 2011 05:08:46 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00101.txt.bz2 Jan Kratochvil wrote: > This physname change broke more issues, thanks for finding this one. > The change I described in the bottom patch of: > Re: [RFA] Typedef'd method parameters [2/4] > http://sourceware.org/ml/gdb-patches/2011-04/msg00524.html > that is the part: > The mangled symbol name is not available for full symbols. */ > #define SYMBOL_LINKAGE_NAME(symbol) (symbol)->ginfo.name Hmm, unless I'm missing something your comment + For full symbols return its demangled form of view of the linker, that is + with typedefs and toplevel const/volatile qualifiers of parameters removed, + for `f(int_typedef const)' it is `f(int)'. If no typedefs/qualifiers are + in use it's the same as SYMBOL_NATURAL_NAME. The mangled symbol name is not + available for full symbols. */ is not fully accurate either. As far as I can tell, that *is* true for symbols read in by the DWARF reader. However, for symbols read in by the stabs reads (or any of the others), SYMBOL_LINKAGE_NAME still refers to the mangled name ... (Which strikes me as quite odd in the first place; how is common code supposed to use this field?) > > So I guess my question is, how is this supposed to work? Should > > is_constructor_name accept demangled names? > > It cannot - it does not know the type name, does it? Right, good point. > > Should there be some generic routine that instead tests a demangled name for > > whether it is a constructor (or destructor)? > > With a GCC debug/ fix it should work. Do you agree with its filing? It seems that by now we have agreement that GCC is correct here. So I guess I see two options remaining: - Code a test that compares class name and (demangled) function name, but explicitly removes template instance parameters first or - Have the symbol reader call is_constructor_name on the mangled name while it is still available, and store that information somewhere in the type information Thoughts? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com