From patchwork Tue Mar 28 15:48:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 67024 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BCFE238515C1 for ; Tue, 28 Mar 2023 15:49:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BCFE238515C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680018570; bh=1iNLWsqiZ+zCEzQorJNnH9BQWbxb7r5flDMixXSzatE=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=BgAwTMP+Q27mg9VX5DyeI6CePNef/w/cKIjiHbPv6POZX3K7JHzki9MEiqpRyquwl bHL8kSlVMuOiDgyaqUZj7oemZu35e2OuUJrw7ZkXTFCa2gVmBjvpm4uTifvCSrfghr TsFYsKsy4+BWz8EJTAhdIu0E5S3JUXFIlQD2ur2w= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 29ED63858C1F for ; Tue, 28 Mar 2023 15:48:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 29ED63858C1F 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 5D3C0219D3 for ; Tue, 28 Mar 2023 15:48:53 +0000 (UTC) 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 4A3231390B for ; Tue, 28 Mar 2023 15:48:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MI/pEGUMI2TfJgAAMHmgww (envelope-from ) for ; Tue, 28 Mar 2023 15:48:53 +0000 To: gdb-patches@sourceware.org Subject: [pushed 5/6] [gdb/testsuite] Fix gdb.server/sysroot.exp for remote host Date: Tue, 28 Mar 2023 17:48:54 +0200 Message-Id: <20230328154855.32238-6-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230328154855.32238-1-tdevries@suse.de> References: <20230328154855.32238-1-tdevries@suse.de> MIME-Version: 1.0 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Fix test-case gdb.server/sysroot.exp for remote host, by: - using gdb_remote_download, and - disabling the "local" scenario for remote host/target, unless remote host == remote target. Tested on x86_64-linux. --- gdb/testsuite/gdb.server/sysroot.exp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.server/sysroot.exp b/gdb/testsuite/gdb.server/sysroot.exp index ac2a03d0c8f..35f15d6c60e 100644 --- a/gdb/testsuite/gdb.server/sysroot.exp +++ b/gdb/testsuite/gdb.server/sysroot.exp @@ -28,11 +28,16 @@ if {[build_executable "failed to prepare" $testfile $srcfile "additional_flags=- } set target_binfile [gdb_remote_download target $binfile] +set host_binfile [gdb_remote_download host $binfile] # Run once with sysroot set to the local filesystem and once set to the remote # target. set modes {} -if { ![is_remote target] } { +if { ( ![is_remote host] && ![is_remote target ] ) + || [board_info host name] == [board_info target name] } { + # Local means that gdb and gdbserver look at the same file system. That's + # not the case for remote host or remote target, unless + # remote host == remote target. lappend modes "local" } lappend modes "remote" @@ -44,7 +49,7 @@ foreach_with_prefix sysroot $modes { if { $sysroot == "local" } { set sysroot_command "/" - set reading_symbols "Reading symbols from $binfile..." + set reading_symbols "Reading symbols from $host_binfile..." set timeout_factor 1 } else { set sysroot_command "target:"