From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37488 invoked by alias); 2 Mar 2018 23:06:27 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 37466 invoked by uid 89); 2 Mar 2018 23:06:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*i:sk:2ngPYnY, H*f:sk:2ngPYnY, H*i:sk:jeVMQoV, H*f:r_fOscEQCMUD X-HELO: mail-lf0-f41.google.com Received: from mail-lf0-f41.google.com (HELO mail-lf0-f41.google.com) (209.85.215.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Mar 2018 23:06:24 +0000 Received: by mail-lf0-f41.google.com with SMTP id q69so15506760lfi.10 for ; Fri, 02 Mar 2018 15:06:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+GRJbXdd2ANiU5oxQVUykcT54eBHa7lS5I+KiuVJpLg=; b=pXBeyvB23r9Jy8OqKVrjfKmTFv0+5wfz2razr3Cxz3whbtuSSVCnDlRAQAEP8ZQGFc goMfZi7RbCtXdlKPadzJuHyLiaS24ku6hO6vUKVZi6zT9jJYlilX1rpmlqevdZ5YJRdT LWy4Ydr4hqLOrK/+Gg/Bu7Mz+y6nmFbgxThrcMbfgMDxbyCFyuM0Z8Gs1CXtpEpbbMZG JdbApqMH4O9b58mtpyZZRj2ybAnFeV5QU1Hd4SdcfO/HcD0vz71EuUTN//wFYj04i/Bq kQj1yaI8ukSrMpyxkwAyYfgSibpt4q15RJGmLT/7TpuxsJ+gNULkemGKzrPxTQWTw2t4 9dig== X-Gm-Message-State: APf1xPDaMUjyBAIXzy7sYM8ubd5MBL0qTnBAC8H4KYm+LLvaLJzY/Vep Ny/NEkdNReOv8MlyS2KiZjiW6HKKL+gdEE3GhUw= X-Google-Smtp-Source: AG47ELvxWkmy/GHVHT+t0lkMfPjVXYRlnoKxNYYNjqczM+UnPFXPxVVe1BKAnsYL42xjNPb/OxCVfLYS/M61KITg6hQ= X-Received: by 10.46.85.157 with SMTP id g29mr4743482lje.118.1520031982130; Fri, 02 Mar 2018 15:06:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.62.7 with HTTP; Fri, 2 Mar 2018 15:06:21 -0800 (PST) In-Reply-To: References: <1517667601.3405.123.camel@gnu.org> <1b58e2df-5425-4f22-510c-d2e9f51040ba@polymtl.ca> <39845077-6bdf-f60d-9bfc-a491e7fa4fc7@gmail.com> <132fbd97-4f0d-020f-1c0f-1d4097800233@polymtl.ca> From: Roman Popov Date: Fri, 02 Mar 2018 23:06:00 -0000 Message-ID: Subject: Re: gdb 8.x - g++ 7.x compatibility To: Jason Merrill Cc: Andrew Pinski , Richard Biener , Simon Marchi , Martin Sebor , Manfred , GDB Development , GCC Development Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-03/txt/msg00017.txt.bz2 Ok, sounds reasonable. In case of debugger we are indeed "linking" RTTI name with name in debuginfo. I've checked LLVM docs, they generate Debuginfo from LLVM "Metadata", and metadata for types already contains mangled names in "identifier" field: https://llvm.org/docs/LangRef.html#dicompositetype . So it should not be hard to propagate it to object file. I will ask on LLVM maillist if they can emit it. 2018-03-01 13:03 GMT-08:00 Jason Merrill : > On Thu, Mar 1, 2018 at 3:26 PM, Andrew Pinski wrote: > > On Thu, Mar 1, 2018 at 12:18 PM, Roman Popov wrote: > >> Is there any progress on this problem? > >> > >> I'm not familiar with G++ , but I have little experience with LLVM. I > can > >> try make LLVM emitting mangled names to DW_AT_name, instead of demangled > >> ones. > >> This way GDB can match DW_AT_name against RTTI. And for display it can > >> call abi::__cxa_demangle(name, NULL, NULL, &status), from #include > >> . > >> > >> Will it work? > > > > > > Reading http://wiki.dwarfstd.org/index.php?title=Best_Practices: > > the DW_AT_name attribute should contain the name of the corresponding > > program object as it appears in the source code, without any > > qualifiers such as namespaces, containing classes, or modules (see > > Section 2.15). A consumer can easily reconstruct the fully-qualified > > name from the DIE hierarchy. In general, the value of DW_AT_name > > should be such that a fully-qualified name constructed from the > > DW_AT_name attributes of the object and its containing objects will > > uniquely represent that object in a form natural to the source > > language. > > > > > > So having the mangled symbol in DW_AT_name seems backwards and not the > > point of it. > > If we add the mangled name, which seems reasonable, it should be in > DW_AT_linkage_name. > > Jason >