From patchwork Tue Mar 21 10:08:19 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: 66671 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 7AF723858C66 for ; Tue, 21 Mar 2023 10:08:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AF723858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679393322; bh=rSZvJvyWyA9nJ/Nk/CKZB1+klwu2M9hJsn76dozSExY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=nEC2KKKpRtSwVSK/kdSIpKrOK8whYhiAWES3+P7BRma5f1/kw4wWOdlK3pXpBu5RI SOmSlE9QxL6b2PZKoy+RCU5LcylQ+Wc6oRkEvl9Y4znyn9Liv7u96BstqonI02edni l8vfhle0Bo79q8ORMZGEJ8imTcLALok4Ec1ykP4M= 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 872CD3858D37 for ; Tue, 21 Mar 2023 10:08:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 872CD3858D37 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 7C8E9219C3 for ; Tue, 21 Mar 2023 10:08:18 +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 6B27F13440 for ; Tue, 21 Mar 2023 10:08:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id TkIZGRKCGWT4IgAAMHmgww (envelope-from ) for ; Tue, 21 Mar 2023 10:08:18 +0000 To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Set remotedir in local-remote-host-native.exp Date: Tue, 21 Mar 2023 11:08:19 +0100 Message-Id: <20230321100819.1789-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 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" In commit ff581559f9d ("[gdb/testsuite] Add gdb.testsuite/board-sanity.exp") I removed handling of HOST_DIR in local-remote-host-native.exp to fix FAILs in test-case gdb.testsuite/board-sanity.exp. Reintroduce handling of HOST_DIR using remotedir, now that using remotedir for a host board no longer make compilation fail due to commit 80d6c79866f ("[gdb/testsuite] Handle remotedir in remote_upload"). This fixes an XFAIL in gdb.testsuite/board-sanity.exp, introduced in commit 3741934fdb0 ("[gdb/testsuite] Set remotedir by default in some boards"). Tested on x86_64-linux. --- .../boards/local-remote-host-native.exp | 25 +++++++++++++++++++ gdb/testsuite/gdb.testsuite/board-sanity.exp | 7 ------ 2 files changed, 25 insertions(+), 7 deletions(-) base-commit: fec61519220148421595a21173f74401416d8d54 diff --git a/gdb/testsuite/boards/local-remote-host-native.exp b/gdb/testsuite/boards/local-remote-host-native.exp index 911310b3072..2851eb09324 100644 --- a/gdb/testsuite/boards/local-remote-host-native.exp +++ b/gdb/testsuite/boards/local-remote-host-native.exp @@ -44,12 +44,37 @@ set_board_info hostname 127.0.0.1 set_board_info username $env(USER) +save_vars {rsh_cmd res} { + set rsh_cmd \ + [join \ + [list \ + [board_info $board rsh_prog] \ + -l [board_info $board username] \ + [board_info $board hostname]]] + + if [info exists HOST_DIR] { + set_board_info remotedir $HOST_DIR + } else { + # Set remotedir by default, to force remote_download target to give an + # absolute file name. + set res [remote_exec build $rsh_cmd pwd] + if { [lindex $res 0] != 0 } { + error "Couldn't set remotedir using pwd" + } + set_board_info remotedir [string trim [lindex $res 1]] + } +} + # The ssh key should be correctly set up that you ssh to 127.0.0.1 # without having to type password. set_board_info rsh_prog /usr/bin/ssh set_board_info rcp_prog /usr/bin/scp set_board_info file_transfer "rsh" +if { $board_type == "host" } { + set_board_info gdb_opts "-d \"${HOST_DIR}\"" +} + proc ${board}_spawn { board cmd } { global board_info diff --git a/gdb/testsuite/gdb.testsuite/board-sanity.exp b/gdb/testsuite/gdb.testsuite/board-sanity.exp index eb19db8699b..835707c9187 100644 --- a/gdb/testsuite/gdb.testsuite/board-sanity.exp +++ b/gdb/testsuite/gdb.testsuite/board-sanity.exp @@ -137,13 +137,6 @@ proc_with_prefix gdb_simple_compile_and_run {} { set result [remote_exec target $target_obj] set status [lindex $result 0] set output [lindex $result 1] - - if { [host_info name] == "local-remote-host-native" - && [target_info name] == "local-remote-host-native" } { - # Setting remotedir on this board has effect on both host and - # target, and it seems to broken for host. Xfail this for now. - setup_xfail *-*-* - } gdb_assert { $status == 0 && $output == "" } remote_file build delete $obj