From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37487 invoked by alias); 2 Mar 2018 23:06:27 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 37465 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=maillist, H*i:sk:2ngPYnY, H*f:sk:2ngPYnY, H*f:sk:jeVMQoV X-HELO: mail-lf0-f52.google.com Received: from mail-lf0-f52.google.com (HELO mail-lf0-f52.google.com) (209.85.215.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Mar 2018 23:06:24 +0000 Received: by mail-lf0-f52.google.com with SMTP id v9so15444353lfa.11 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=JKXuINWQJv8FZePUYcmuMh9HEqRGM60yJDAmNi/z6ZRKjq0gOGey7MJYzSIPrrfESS Izep876rWVl10SXx1/TjfupNojXFFc0h4GXr1wKx9eCj6A5C22s0nSfMnn5TN/4ed4E4 7lRHEwPAfZMoT5atB8O15NEnHL2rWKQcNugb0qUK676L9YKkLqkcxq7+gwBkG6g7ifwK oh9y2KrbuzpYdPyeK8aNEEZd/Rd7ozUZMCm97FpfB38O/Ey3HSGZiQSol26KsJxQy5mf h5KKzTlGU0popMIMJHm1NZxFrM3fwiO///icKNxw/Bf4XrV9TZ5XIh0pkTVTmkkGYFQv 73Ow== X-Gm-Message-State: APf1xPB2psJev76z7ZtE8CbYPpojFsm+W2+UHw82syhua/dcn5es+ens 417GSuv0foIsedy5EtpvDOuAdPX/kAU8oHcMRkE= 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-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00008.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 >