From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id B00F03858C3A for ; Thu, 9 Mar 2023 09:45:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B00F03858C3A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E839521DA8 for ; Thu, 9 Mar 2023 09:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1678355134; 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=FmCOEt99Rmznt3d6RRsP9suklz7ge32wZknha4/dHyQ=; b=a1YG6aBM9+F2hEklEeSm5FbK0TYryJPZ8WyhQBA2izboai9+Ouf2hpDyd5g22jCV6ipyuZ Pr+XgIapvltD1tMAp80SiEcyGguaGDQb1SURR/i3FW5M+UyerX/CuYKdWE43DHuUQap9YH P023VCtj46Iv4ARdBsYVS53pYkeRCVg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1678355134; 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=FmCOEt99Rmznt3d6RRsP9suklz7ge32wZknha4/dHyQ=; b=qpKMck9kuElpvV618ST/YpQpZXLmVnkwXFRlhOebcidv5qdjEhWjhg8/QoYJxXcgkzZ5vY zAZb8LEHGQ079hBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D40941391B for ; Thu, 9 Mar 2023 09:45:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rLdzMr6qCWS8FwAAMHmgww (envelope-from ) for ; Thu, 09 Mar 2023 09:45:34 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 1/7] [gdb/testsuite] Fix gdb.server/connect-with-no-symbol-file.exp for remote target Date: Thu, 9 Mar 2023 10:45:39 +0100 Message-Id: <20230309094545.4537-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 List-Id: Test-case gdb.server/connect-with-no-symbol-file.exp fails with target board remote-gdbserver-on-localhost. The problem is here: ... set target_exec [gdb_remote_download target $binfile.bak $binfile] ... A "gdb_remote_download target" copies from build to target. So $binfile is assumed to be a target path, but it's actually a build path. Fix this by: - fist copying $binfile.bak to $binfile, and - simply doing [gdb_remote_download target $binfile]. Then, $binfile.bak is created here: ... # Make sure we have the original symbol file in a safe place to copy from. gdb_remote_download host $binfile $binfile.bak ... and since "gdb_remote_download host" copies from build to host, $binfile.bak is assumed to be a host path, but it's actually a build path. This happens to cause no problems in this configuration (because build == host), but it would for a remote host configuration. So let's fix this by making build rather than host the "safe place to copy from". Tested on x86_64-linux. --- gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp b/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp index b98e566e2d6..efddccd2a19 100644 --- a/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp +++ b/gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp @@ -43,8 +43,11 @@ proc connect_no_symbol_file { sysroot action } { global binfile with_test_prefix "setup" { + # Restore original $binfile. + gdb_remote_download build $binfile.bak $binfile + # Copy the symbol file to the target. - set target_exec [gdb_remote_download target $binfile.bak $binfile] + set target_exec [gdb_remote_download target $binfile] # Make sure we're disconnected, in case we're testing with an # extended-remote board, therefore already connected. @@ -89,7 +92,7 @@ proc connect_no_symbol_file { sysroot action } { } # Make sure we have the original symbol file in a safe place to copy from. -gdb_remote_download host $binfile $binfile.bak +gdb_remote_download build $binfile $binfile.bak # Start with no executable loaded. clean_restart base-commit: bf0e35375461ef2a17e2872e7f5c1446a5924b64 -- 2.35.3