aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/boards
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-03-14 14:11:01 +0100
committerTom de Vries <tdevries@suse.de>2023-03-14 14:11:01 +0100
commitff581559f9d6586d1d05c5a25d777c78edab3517 (patch)
treea4406dead38cf4768eaee3b4eac0491e6c61d802 /gdb/testsuite/boards
parent7506fc9bf1fef7904a213c89a2df915e652ed3b9 (diff)
downloadbinutils-ff581559f9d6586d1d05c5a25d777c78edab3517.zip
binutils-ff581559f9d6586d1d05c5a25d777c78edab3517.tar.gz
binutils-ff581559f9d6586d1d05c5a25d777c78edab3517.tar.bz2
[gdb/testsuite] Add gdb.testsuite/board-sanity.exp
Add a test-case that tests the sanity of target/host boards. It contains a number of tests related to remote file manipulation, exercising: - remote_upload - remote_download - remote_file exists - remote_file delete which check that these work together as expected. Tested on x86_64-linux, with all relevant gdb/testsuite/boards/*.exp boards. For target board remote-stdio-gdbserver.exp, this revealed a trivial problem with the return value of proc ${board}_file for delete, so fix this. The test-case shows that the proc ${board}_download in local-remote-host-native.exp is broken, so remove it. Likewise for board local-remote-host.exp, so remove proc ${board}_download and associated ${board}_file. Tested on x86_64-linux.
Diffstat (limited to 'gdb/testsuite/boards')
-rw-r--r--gdb/testsuite/boards/local-remote-host-native.exp22
-rw-r--r--gdb/testsuite/boards/local-remote-host.exp19
-rw-r--r--gdb/testsuite/boards/remote-stdio-gdbserver.exp3
3 files changed, 2 insertions, 42 deletions
diff --git a/gdb/testsuite/boards/local-remote-host-native.exp b/gdb/testsuite/boards/local-remote-host-native.exp
index 6409ac4..911310b 100644
--- a/gdb/testsuite/boards/local-remote-host-native.exp
+++ b/gdb/testsuite/boards/local-remote-host-native.exp
@@ -50,14 +50,6 @@ set_board_info rsh_prog /usr/bin/ssh
set_board_info rcp_prog /usr/bin/scp
set_board_info file_transfer "rsh"
-if { ![info exists HOST_DIR] } {
- set HOST_DIR [file join [pwd] "remote-host"]
-}
-
-if { $board_type == "host" } {
- set_board_info gdb_opts "-d \"${HOST_DIR}\""
-}
-
proc ${board}_spawn { board cmd } {
global board_info
@@ -70,20 +62,6 @@ proc ${board}_spawn { board cmd } {
return $spawn_id
}
-proc ${board}_download { board src dest } {
- global HOST_DIR
-
- if { ![file exists $HOST_DIR] } {
- file mkdir $HOST_DIR
- }
-
- set destfile [file join $HOST_DIR $dest]
- verbose -log "${board}_download: file copy -force $src $destfile"
- file copy -force $src $destfile
-
- return $destfile
-}
-
if { $board_type == "host" } {
set GDBFLAGS "${GDBFLAGS} -iex \"set style enabled off\""
}
diff --git a/gdb/testsuite/boards/local-remote-host.exp b/gdb/testsuite/boards/local-remote-host.exp
index ff74183..e208504 100644
--- a/gdb/testsuite/boards/local-remote-host.exp
+++ b/gdb/testsuite/boards/local-remote-host.exp
@@ -35,25 +35,6 @@ set_board_info rsh_prog /usr/bin/ssh
set_board_info rcp_prog /usr/bin/scp
set_board_info file_transfer "rsh"
-proc ${board}_file { dest op args } {
- if { $op == "delete" } {
- return 0
- }
- return [eval [list standard_file $dest $op] $args]
-}
-
-proc ${board}_download { board src dest } {
-
- # If file name is a relative, convert it to absolute, otherwise file can't
- # be found on host, because the current directory usually is /home/$USER.
- # This also bypasses the real download to the host.
- if { [file pathtype $src] == "relative" } {
- return [file join [pwd] $src]
- } else {
- return $src
- }
-}
-
# Like standard_spawn, but force pseudo-tty allocation, with 'ssh -t'.
proc ${board}_spawn { board cmd } {
diff --git a/gdb/testsuite/boards/remote-stdio-gdbserver.exp b/gdb/testsuite/boards/remote-stdio-gdbserver.exp
index 479dfb0..53e40d8 100644
--- a/gdb/testsuite/boards/remote-stdio-gdbserver.exp
+++ b/gdb/testsuite/boards/remote-stdio-gdbserver.exp
@@ -72,7 +72,8 @@ proc get_target_remote_pipe_cmd { } {
proc ${board}_file { dest op args } {
if { $op == "delete" } {
- return [remote_exec target "rm -f $args"]
+ set res [remote_exec target "rm -f $args"]
+ return [lindex $res 0]
}
return [eval [list standard_file $dest $op] $args]
}