From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by sourceware.org (Postfix) with ESMTPS id E58DA3842402 for ; Sat, 4 Jul 2020 04:00:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E58DA3842402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dxu@dxuuu.xyz Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id C4A4E9A6; Sat, 4 Jul 2020 00:00:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 04 Jul 2020 00:00:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=cg7bqqZsrV9weeHf8aIGrTsTqa 7TK1jBzWrLMtJx/yA=; b=PeLTyIoKG5KlAB9uqoBENSHwuRJKefWFjo+gQrzrik ipnVd1JyGzcE+/HfxWpa0+B/y0gg7/wSQI4yZCxsnFrkvW/8nxIRgk4QKu6iHwT+ tndplq3GueU26yLIm5RXhVXg0R+dR5NmiN6Aw0lUUuIVYjmIEZZ8OqE96PssRWaw 5nYUlt0HoE98yDXmLMjSYbAtR0OnfYREAtuCdoRpWrL1/h7hgF6zMQvY7o5N49Gh 5RmDXh5gcNcdafXJRyK0A6GA0PgG6unmrsLj2BS3/RYWY0Sc3/fnleyXp8zVPSsk rDM7B/MjS/VGAJj7MhPDoiepzI5aShegGLo0PLjRl83Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=cg7bqqZsrV9weeHf8 aIGrTsTqa7TK1jBzWrLMtJx/yA=; b=isgEDEhUx9vrNc5FmpzWirZCsEYDr4IO8 +dqL1dCTtS/YJM4hYhq0cz4QGqZPJFbweCfc5mMBG0TtfimG6FhJqhTBhjFI3PGD zqr55tcWKMaFXVQAKDonnlZx+iB8Mg6MOWzFzGrvUTHPJqVaj+oNJ53hK1JBHpH8 q4h8Oo09vba3z6M3+xZ22kMTh5sF0glzvETlAbpMzRAFcYFttRIuGcWUsnRhFeth rBEkMHE2MiUftnyjjVKBpH9FdEVp2XuKONKE0mJxKJmEkUQgX/6/f6jV82/n+1vc EEXRbouXwXPPqP8mcMKzSIDr0Nbuvlere7NGLvyAl9AypmzylfZ/w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrtdejgdejkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhephffvuf ffkffoggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceougiguhes ugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepieffgfelvdffiedtleejvdetfe efiedvfeehieevveejudeiiefgteeiveeiffffnecukfhppeejfedrleefrddvgeejrddu feegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug iguhesugiguhhuuhdrgiihii X-ME-Proxy: Received: from localhost.localdomain (c-73-93-247-134.hsd1.ca.comcast.net [73.93.247.134]) by mail.messagingengine.com (Postfix) with ESMTPA id 6D955306007B; Sat, 4 Jul 2020 00:00:05 -0400 (EDT) From: Daniel Xu To: gdb-patches@sourceware.org, tom@tromey.com Subject: [PATCH] rust: Fix rust modules test Date: Fri, 3 Jul 2020 20:59:53 -0700 Message-Id: <20200704035953.849933-1-dxu@dxuuu.xyz> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_INFOUSMEBIZ, PDS_OTHER_BAD_TLD, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, 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: Sat, 04 Jul 2020 04:00:13 -0000 I noticed that the modules test was failing. Some choice use of `nm` revealed `TWENTY_THREE` was not in the final binary. Fix by taking a pointer to the global, forcing the linker to keep the symbol in. gdb/testsuite/ * gdb.rust/modules.rs: Prevent linker from discarding test symbol Signed-off-by: Daniel Xu --- Changes from V0: * Take pointer to global instead. Should be more reliable than using the global twice. gdb/testsuite/gdb.rust/modules.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.rust/modules.rs b/gdb/testsuite/gdb.rust/modules.rs index 6db082817b..479e6529cd 100644 --- a/gdb/testsuite/gdb.rust/modules.rs +++ b/gdb/testsuite/gdb.rust/modules.rs @@ -60,7 +60,8 @@ pub mod mod1 { let f2 = || println!("lambda f2"); - let copy = ::TWENTY_THREE; + // Prevent linker from discarding symbol + let ptr: *const u16 = &::TWENTY_THREE; f2(); // set breakpoint here f3(); -- 2.27.0