From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id E879C385843D; Sat, 29 Oct 2022 07:43:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E879C385843D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667029426; bh=Yyw/2eR2n4ZfklRoESNtqEJMhIYJ89rXE4src6UR/AY=; h=From:To:Subject:Date:From; b=nzRG3+YpND2ZYRGka7EOiByX3NbB0v4hTnCsGuvuztQTRJein4tsu+Rg4aBvRRzyD Cj7EFXOOqNXckERf8zxFhkoOj25LbraB6SAXLEpfLBuFv/S2F2MAyTMbhKCEpLLUyg Kzco2161gfDezykc5NBOZ3VmHcbcIYVEsD8GCARY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Use ssh -t in remote-*.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 8db6f1bd27086c9623e2b8eb8d01bc4c0a863ca7 X-Git-Newrev: 58d8e5fab3798ed91378b661088f5e6b175bbd98 Message-Id: <20221029074346.E879C385843D@sourceware.org> Date: Sat, 29 Oct 2022 07:43:46 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D58d8e5fab379= 8ed91378b661088f5e6b175bbd98 commit 58d8e5fab3798ed91378b661088f5e6b175bbd98 Author: Tom de Vries Date: Sat Oct 29 09:43:32 2022 +0200 [gdb/testsuite] Use ssh -t in remote-*.exp =20 When running test-case gdb.server/multi-ui-errors.exp on target board remote-gdbserver-on-localhost.exp, I run into: ... (gdb) PASS: gdb.server/multi-ui-errors.exp: connect to gdbserver continue^M Continuing.^M PASS: gdb.server/multi-ui-errors.exp: continue - extra UI Remote debugging from host ::1, port 35466^M FAIL: gdb.server/multi-ui-errors.exp: ensure inferior is running ... =20 The problem is that the target board uses ssh -T, which fails to guaran= tee that output from the inferior will be available. =20 Fix this by copying proc ${board}_spawn from local-remote-host.exp, whi= ch ensures using ssh -t. [ It would be nice to define an ssh base board to get rid of the copies, but I'm not addressing that in this commit. ] =20 Likewise for target board remote-stdio-gdbserver.exp. =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/boards/remote-gdbserver-on-localhost.exp | 12 ++++++++++++ gdb/testsuite/boards/remote-stdio-gdbserver.exp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/gdb/testsuite/boards/remote-gdbserver-on-localhost.exp b/gdb/t= estsuite/boards/remote-gdbserver-on-localhost.exp index 27224d39d0b..dacbbfb6f28 100644 --- a/gdb/testsuite/boards/remote-gdbserver-on-localhost.exp +++ b/gdb/testsuite/boards/remote-gdbserver-on-localhost.exp @@ -32,6 +32,18 @@ set_board_info protocol standard set_board_info username $env(USER) set_board_info hostname localhost =20 +proc ${board}_spawn { board cmd } { + global board_info + + set remote [board_info $board hostname] + set username [board_info $board username] + set RSH [board_info $board rsh_prog] + + spawn $RSH -t -l $username $remote $cmd + set board_info($board,fileid) $spawn_id + return $spawn_id +} + # We will be using the standard GDB remote protocol set_board_info gdb_protocol "remote" =20 diff --git a/gdb/testsuite/boards/remote-stdio-gdbserver.exp b/gdb/testsuit= e/boards/remote-stdio-gdbserver.exp index e1a2d0ed007..498526b7870 100644 --- a/gdb/testsuite/boards/remote-stdio-gdbserver.exp +++ b/gdb/testsuite/boards/remote-stdio-gdbserver.exp @@ -78,3 +78,15 @@ proc ${board}_file { dest op args } { } return [eval [list standard_file $dest $op] $args] } + +proc ${board}_spawn { board cmd } { + global board_info + + set remote [board_info $board hostname] + set username [board_info $board username] + set RSH [board_info $board rsh_prog] + + spawn $RSH -t -l $username $remote $cmd + set board_info($board,fileid) $spawn_id + return $spawn_id +}