]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/boards/local-remote-host.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / boards / local-remote-host.exp
1 # Copyright 2012-2023 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16 # This file is a dejagnu "board file" and is used to run the testsuite
17 # against local host, in remote host mode.
18 #
19 # To use this file:
20 # bash$ cd ${build_dir}/gdb
21 # bash$ make check RUNTESTFLAGS="--host_board=local-remote-host"
22
23 # Like local-remote-host-notty, but with readline/editing enabled.
24
25 global GDB
26 set GDB [file join [pwd] "../gdb"]
27
28 set_board_info hostname 127.0.0.1
29
30 set_board_info username $env(USER)
31
32 # The ssh key should be correctly set up that you ssh to 127.0.0.1
33 # without having to type password.
34 set_board_info rsh_prog /usr/bin/ssh
35 set_board_info rcp_prog /usr/bin/scp
36 set_board_info file_transfer "rsh"
37
38 proc ${board}_file { dest op args } {
39 if { $op == "delete" } {
40 return 0
41 }
42 return [eval [list standard_file $dest $op] $args]
43 }
44
45 proc ${board}_download { board src dest } {
46
47 # If file name is a relative, convert it to absolute, otherwise file can't
48 # be found on host, because the current directory usually is /home/$USER.
49 # This also bypasses the real download to the host.
50 if { [file pathtype $src] == "relative" } {
51 return [file join [pwd] $src]
52 } else {
53 return $src
54 }
55 }
56
57 # Like standard_spawn, but force pseudo-tty allocation, with 'ssh -t'.
58
59 proc ${board}_spawn { board cmd } {
60 global board_info
61
62 set remote [board_info $board hostname]
63 set username [board_info $board username]
64 set RSH [board_info $board rsh_prog]
65
66 spawn $RSH -t -l $username $remote $cmd
67 set board_info($board,fileid) $spawn_id
68 return $spawn_id
69 }
70
71 set GDBFLAGS "${GDBFLAGS} -iex \"set style enabled off\""