From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ywERKo0NmWbcoioAWB0awg (envelope-from ) for ; Thu, 18 Jul 2024 08:41:49 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=VKJB3yWd; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=iP2I9fB9; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=PKlFCAOH; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=O8bASqTH; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 965B51E0C3; Thu, 18 Jul 2024 08:41:49 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 214941E097 for ; Thu, 18 Jul 2024 08:41:47 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 851423860757 for ; Thu, 18 Jul 2024 12:41:46 +0000 (GMT) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id 4D4913860750 for ; Thu, 18 Jul 2024 12:41:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D4913860750 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4D4913860750 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721306487; cv=none; b=XEGINohercB4i0Aqf5ROkAwwul3g7v37clSmSHyAoL5iOVAMB74QJV4bWEryEs1n9ExqrHNjP2lSUipX4SxgK3QtQkohFLAu9ECToOhMj72shioFAWvISnYskYftEjA8D4PflZGuR1/STTaXWgqYG/jlXtGTC57l7sDC4eKxta0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721306487; c=relaxed/simple; bh=EPRk14CLsRuGBc8vTkFNdtYFGMsPXehoDvizTW2FD98=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=eytiBTpLJgKJfs1kvMQWMEpdmpPHiFSR/ZlE2SZE6StgIcI51TUrR29M8i+oIozD5ALXgoq90aqEoLmhLJg4VBQP3jhZ5NEMvi2bIWAF7U+QIrDfFFuLbzbZGwpwVM1GFFl6KCBRP/2Y8qOJUhqvvJRsJdqPy4hmU0kvCWj06P0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6B52821AB4 for ; Thu, 18 Jul 2024 12:41:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721306484; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZaAmG0d0vWuRCI1KYByXC0M5Q43IGqnFcyR3qngihPc=; b=VKJB3yWdjGIzMMv8R5BBu9sODw+HshvcCQRmTgA5ktRXvXncpiUWdzHZDlf/W7RvWE00hv tOnYhgXrPc8oiNbDs2ypA9xE6ixUcpVvg1URUG8IJZ20boMpiayQwPgjuEQysnotGEWrjE qB3Dret/9BSVEo2Ydfp2RPW4uu9TSu0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721306484; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZaAmG0d0vWuRCI1KYByXC0M5Q43IGqnFcyR3qngihPc=; b=iP2I9fB9CofeFgn5LV/JoGpDRsj4CiKTdMLUX8d2kQp1+Xqtgt6rvAR7mR3eYCqkSGSbco LXX5iJRyeoyVRLDQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721306483; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZaAmG0d0vWuRCI1KYByXC0M5Q43IGqnFcyR3qngihPc=; b=PKlFCAOHYNvZL/JUq0q0ap1lde208SNSf/HTZhLBiACI5zl5piTr61F/mC5eYrmCwQdLhS 7rVBM6vWR8IcW+VPkJ6mkICb5Mz9MnE3myK4LqGei15ODr70c305gGo865EcLQOdZUK6PE q3UvH0JTkMybzPJB8wwjo08fBgT3oC0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721306483; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZaAmG0d0vWuRCI1KYByXC0M5Q43IGqnFcyR3qngihPc=; b=O8bASqTHuPp7S9bzyWuxKNiilZNhfj1rVZLNOnIxnlSBodHfUZI2fAKXw2Gx/TFZeRZaWf Z8aCsfwedoy+uqDA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 51814136F7 for ; Thu, 18 Jul 2024 12:41:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id ydk2EnMNmWZUdQAAD6G6ig (envelope-from ) for ; Thu, 18 Jul 2024 12:41:23 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Fix scopes check in gdb.dap/rust-slices.exp Date: Thu, 18 Jul 2024 14:41:32 +0200 Message-Id: <20240718124132.23642-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.996]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.80 X-Spam-Level: X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org When running test-case gdb.dap/rust-slices.exp on aarch64-linux (debian 12/bookworm), I run into: ... {"request_seq": 6, "type": "response", "command": "scopes", "body": {"scopes": [{"variablesReference": 1, "name": "Locals", "presentationHint": "locals", "expensive": false, "namedVariables": 3, "line": 28, "source": {"name": "rust-slices.rs", "path": "/home/linux/gdb/binutils-gdb.git/gdb/testsuite/gdb.dap/rust-slices.rs"}}, {"variablesReference": 2, "name": "Registers", "presentationHint": "registers", "expensive": false, "namedVariables": 261, "line": 28, "source": {"name": "rust-slices.rs", "path": "/home/linux/gdb/binutils-gdb.git/gdb/testsuite/gdb.dap/rust-slices.rs"}}]}, "success": true, "seq": 20}PASS: gdb.dap/rust-slices.exp: get scopes success FAIL: gdb.dap/rust-slices.exp: three scopes PASS: gdb.dap/rust-slices.exp: scope is locals PASS: gdb.dap/rust-slices.exp: locals presentation hint PASS: gdb.dap/rust-slices.exp: three vars in scope ... The test-case expects three scopes due to a rust compiler issue: ... # There are three scopes because an artificial symbol ends up in the # DWARF. See https://github.com/rust-lang/rust/issues/125126. gdb_assert {[llength $scopes] == 3} "three scopes" ... but it seems that the version used here (rustc 1.63.0, llvm 14.0.6) doesn't have this issue. Fix this by allowing two or three scopes, and changing the test name to "two scopes". Tested on aarch64-linux. PR testsuite/31983 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31983 --- gdb/testsuite/gdb.dap/rust-slices.exp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.dap/rust-slices.exp b/gdb/testsuite/gdb.dap/rust-slices.exp index d3bd3050c16..4af8c11e684 100644 --- a/gdb/testsuite/gdb.dap/rust-slices.exp +++ b/gdb/testsuite/gdb.dap/rust-slices.exp @@ -59,9 +59,9 @@ set scopes [dap_check_request_and_response "get scopes" scopes \ [format {o frameId [i %d]} $frame_id]] set scopes [dict get [lindex $scopes 0] body scopes] -# There are three scopes because an artificial symbol ends up in the -# DWARF. See https://github.com/rust-lang/rust/issues/125126. -gdb_assert {[llength $scopes] == 3} "three scopes" +# There may be three scopes instead of two if an artificial symbol ends up in +# the DWARF. See https://github.com/rust-lang/rust/issues/125126. +gdb_assert { [llength $scopes] == 2 || [llength $scopes] == 3 } "two scopes" lassign $scopes scope ignore gdb_assert {[dict get $scope name] == "Locals"} "scope is locals" base-commit: 3ca6c047a42ecf444cf08ce879ba52e5ba0a9e06 -- 2.35.3