[gdb/testsuite] Use ssh -t in remote-*.exp
authorTom de Vries <tdevries@suse.de>
Sat, 29 Oct 2022 07:43:32 +0000 (09:43 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 29 Oct 2022 07:43:32 +0000 (09:43 +0200)
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
...

The problem is that the target board uses ssh -T, which fails to guarantee
that output from the inferior will be available.

Fix this by copying proc ${board}_spawn from local-remote-host.exp, which
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. ]

Likewise for target board remote-stdio-gdbserver.exp.

Tested on x86_64-linux.

gdb/testsuite/boards/remote-gdbserver-on-localhost.exp
gdb/testsuite/boards/remote-stdio-gdbserver.exp

index 27224d39d0b57112d4bee0cef53af800ab84af0d..dacbbfb6f28b7993e324bd34b913702e59081d4d 100644 (file)
@@ -32,6 +32,18 @@ set_board_info protocol standard
 set_board_info username $env(USER)
 set_board_info hostname localhost
 
+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"
 
index e1a2d0ed00746ac642793443c8595262088b1c13..498526b78705eae5cef1cf82917ca5e1ad98d22c 100644 (file)
@@ -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
+}