1 # Copyright
2014-2022 Free Software Foundation
, Inc.
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.
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.
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
/>.
16 # This file is a dejagnu
"board file" and is used to run the testsuite
17 # against local host
, in remote host
mode.
19 # This board file is used to emulate the real remote host testing
, in
20 # which file
system of host and build are not shared. This is achieved
21 # by copying files from source directory to $
{host_dir
}.
24 # bash$ cd $
{build_dir
}/gdb
25 # bash$ make check RUNTESTFLAGS
="--host_board=local-remote-host-native --target_board=local-remote-host-native HOST_DIR=/tmp/foo/"
27 # We
set both target board and host board together to test a native gdb
28 #
(host
== target
) on a remote host
(host
!= build
). $HOST_DIR is the
29 # directory
for copying files to
, to avoid messing up your HOME. When
30 # it is absent
, files are copied to .
/remote
-host.
32 if { $board_type
== "target" } {
33 set_board_info compiler gcc
36 # We have to explicitly specify GDB with the path to the copy in
37 # the build directory because otherwise it will be
set to the
38 # result of
"transform GDB" since the harness thinks we're using
39 # a remote host. See lib
/gdb.exp.
40 set GDB
[file join
[pwd
] "../gdb"]
41 verbose
-log "Overriding setting of GDB to $GDB"
43 set_board_info hostname
127.0.0.1
45 set_board_info username $env
(USER
)
47 # The ssh
key should be correctly
set up that you ssh to
127.0.0.1
48 # without having to type password.
49 set_board_info rsh_prog
/usr
/bin
/ssh
50 set_board_info rcp_prog
/usr
/bin
/scp
51 set_board_info file_transfer
"rsh"
53 if { ![info exists HOST_DIR
] } {
54 set HOST_DIR
[file join
[pwd
] "remote-host"]
57 if { $board_type
== "host" } {
58 set_board_info gdb_opts
"-d \"${HOST_DIR}\""
61 proc $
{board
}_spawn
{ board cmd
} {
64 set remote
[board_info $board hostname
]
65 set username
[board_info $board username
]
66 set RSH
[board_info $board rsh_prog
]
68 spawn $RSH
-t
-l $username $remote $cmd
69 set board_info
($board
,fileid
) $spawn_id
73 proc $
{board
}_download
{ board src dest
} {
76 if { ![file
exists $HOST_DIR
] } {
80 set destfile
[file join $HOST_DIR $dest
]
81 verbose
-log "${board}_download: file copy -force $src $destfile"
82 file copy
-force $src $destfile