aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/boards
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-03-07 14:46:24 +0100
committerTom de Vries <tdevries@suse.de>2023-03-07 14:46:24 +0100
commit1b79c725e40e4258bdd9254e7a250c4b807d28b6 (patch)
tree9b40211cab0bd466059f3cdac9babf2ec9a7c271 /gdb/testsuite/boards
parenta50a8e305d4406d96adb5b2967236d7b8767997f (diff)
downloadbinutils-1b79c725e40e4258bdd9254e7a250c4b807d28b6.zip
binutils-1b79c725e40e4258bdd9254e7a250c4b807d28b6.tar.gz
binutils-1b79c725e40e4258bdd9254e7a250c4b807d28b6.tar.bz2
[gdb/testsuite] Fix gdb.base/signals-state-child.exp for remote-gdbserver-on-localhost
With test-case gdb.base/signals-state-child.exp on target board remote-gdbserver-on-localhost I run into: ... builtin_spawn /usr/bin/ssh -t -l remote-target localhost \ $outputs/gdb.base/signals-state-child/signals-state-child-standalone^M bash: $outputs/gdb.base/signals-state-child/signals-state-child-standalone: \ Permission denied^M Connection to localhost closed.^M^M FAIL: gdb.base/signals-state-child.exp: collect standalone signals state ... The problem is that we're trying to run an executable on the target board using a host path. After fixing this by downloading the exec to the target board, we run into: ... builtin_spawn /usr/bin/ssh -t -l remote-target localhost \ signals-state-child-standalone^M bash: signals-state-child-standalone: command not found^M Connection to localhost closed.^M^M FAIL: gdb.base/signals-state-child.exp: collect standalone signals state ... Fix this by using an absolute path name for the exec on the target board. The dejagnu proc standard_file does not support op == "absolute" for target boards, so add an implementation in remote-gdbserver-on-localhost.exp. Also: - fix a PATH-in-test-name issue - cleanup gdb.txt and standalone.txt on target board Tested on x86_64-linux.
Diffstat (limited to 'gdb/testsuite/boards')
-rw-r--r--gdb/testsuite/boards/remote-gdbserver-on-localhost.exp21
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/testsuite/boards/remote-gdbserver-on-localhost.exp b/gdb/testsuite/boards/remote-gdbserver-on-localhost.exp
index 160d09f..a08d2d1 100644
--- a/gdb/testsuite/boards/remote-gdbserver-on-localhost.exp
+++ b/gdb/testsuite/boards/remote-gdbserver-on-localhost.exp
@@ -55,6 +55,27 @@ if { [board_info $board username] != $env(USER) } {
chmod go-rx ."
}
+proc ${board}_file { dest op args } {
+ global board_info
+ set username [board_info $dest username]
+
+ if { $op == "absolute" } {
+ set file [lindex $args 0]
+
+ if { [file pathtype $file] == "relative" } {
+ # Make sure we get an absolute file name relative to home
+ # dir of $username, not $env(USER).
+ set pwd [regsub $::env(USER) $::env(HOME) $username]
+ set file [remote_file build join $pwd $file]
+ }
+
+ return [remote_file build $op $file]
+ }
+
+ # Fall back to standard_file.
+ return [standard_file $dest $op {*}$args]
+}
+
proc ${board}_spawn { board cmd } {
global board_info