From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway36.websitewelcome.com (gateway36.websitewelcome.com [192.185.186.5]) by sourceware.org (Postfix) with ESMTPS id CB3E7385E006 for ; Wed, 25 Mar 2020 20:10:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CB3E7385E006 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway36.websitewelcome.com (Postfix) with ESMTP id BF4B540248979 for ; Wed, 25 Mar 2020 14:23:42 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id HCJ5jRjG9Sl8qHCJ5jz4Xx; Wed, 25 Mar 2020 15:07:19 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=67kjQbybtFY+kLHLBYPeV2cbYDvnvydgdPJ/2sBNls4=; b=hAjfnO8MJ/3DRNkN3b4GMKf92A HlNa29Hch7zWDBkIWKN8GS82kpkjp1YM/cg+5qXMEVh138ybJJC6W4dgmYa1L95dhOAGZkiYrbaVZ C4ROQf4AIiVC4lM0MKh3F1iG1; Received: from 97-118-117-21.hlrn.qwest.net ([97.118.117.21]:38026 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jHCJ5-001VYp-0U; Wed, 25 Mar 2020 14:07:19 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 09/10] Fix Rust test cases Date: Wed, 25 Mar 2020 14:07:14 -0600 Message-Id: <20200325200715.12947-10-tom@tromey.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200325200715.12947-1-tom@tromey.com> References: <20200325200715.12947-1-tom@tromey.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.118.117.21 X-Source-L: No X-Exim-ID: 1jHCJ5-001VYp-0U X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-117-21.hlrn.qwest.net (bapiya.Home) [97.118.117.21]:38026 X-Source-Auth: tom+tromey.com X-Email-Count: 10 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-24.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2020 20:10:51 -0000 PR rust/25025 notes that some Rust test cases fail. Debugging gdb revealed that the Rust compiler emits different linkage names that demangle to the same result. Enabling complaints when reading the test case is enough to show it: During symbol reading: Computed physname > does not match demangled (from linkage <_ZN8generics8identity17h8540b320af6656d6E>) - DIE at 0x424 [in module /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.rust/generics/generics] During symbol reading: Computed physname > does not match demangled (from linkage <_ZN8generics8identity17hae302fad0c33bd7dE>) - DIE at 0x459 [in module /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.rust/generics/generics] ... This patch changes the DWARF reader to prefer the computed physname, rather than the output of the demangler, for Rust. This fixes the bug. gdb/ChangeLog 2020-03-25 Tom Tromey PR rust/25025: * dwarf2/read.c (dwarf2_physname): Do not demangle for Rust. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2/read.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 1e824ca399d..088306ee072 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -10306,7 +10306,8 @@ dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu) if (!die_needs_namespace (die, cu)) return dwarf2_compute_name (name, die, cu, 1); - mangled = dw2_linkage_name (die, cu); + if (cu->language != language_rust) + mangled = dw2_linkage_name (die, cu); /* DW_AT_linkage_name is missing in some cases - depend on what GDB has computed. */ -- 2.17.2