aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-03-28 17:48:34 +0200
committerTom de Vries <tdevries@suse.de>2023-03-28 17:48:34 +0200
commit9121a23fa7294542d022c25eda0fe8b9e92c3b59 (patch)
tree4c176cd96f53509deb3e368637308705af9d0478 /gdb
parent357bff173eb9b1d055df5158f3e5214e2bf6c19e (diff)
downloadgdb-9121a23fa7294542d022c25eda0fe8b9e92c3b59.zip
gdb-9121a23fa7294542d022c25eda0fe8b9e92c3b59.tar.gz
gdb-9121a23fa7294542d022c25eda0fe8b9e92c3b59.tar.bz2
[gdb/testsuite] Fix local-remote-host-native.exp for gdb.server tests
When running test-case gdb.server/stop-reply-no-thread-multi.exp with host+target board local-remote-host-native, I run into a time-out: ... (gdb) PASS: gdb.server/stop-reply-no-thread-multi.exp: target-non-stop=off: \ to_disable=: disconnect builtin_spawn /usr/bin/ssh -t -l vries 127.0.0.1 gdbserver --once \ localhost:2346 stop-reply-no-thread-multi^M Process stop-reply-no-thread-multi created; pid = 32600^M Listening on port 2346^M set remote threads-packet off^M FAIL: gdb.server/stop-reply-no-thread-multi.exp: target-non-stop=off: \ to_disable=: set remote threads-packet off (timeout) ... This is due to this line in ${board}_spawn: ... set board_info($board,fileid) $spawn_id ... We have the following series of events: - gdb is spawned, setting fileid - a few gdb commands (set height etc) are send using fileid, arrive at gdb and are successful - gdbserver is spawned, overwriting fileid - the next gdb command is sent using fileid, so it's send to gdbserver instead of gdb, and we run into the timeout. There is some notion of current gdb, tracked in both gdb_spawn_id and fileid of the host board (see switch_gdb_spawn_id). And because the host and target board are the same, spawning something on the target overwrites the fileid on host, and consequently the current gdb. Fix this by only setting fileid when spawning gdb. Tested on x86_64-linux. Now gdb.server/*.exp passes for host+target board local-remote-host-native, except for file-transfer.exp. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29734
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/boards/local-remote-host-native.exp6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/testsuite/boards/local-remote-host-native.exp b/gdb/testsuite/boards/local-remote-host-native.exp
index 21680d8..b83d56e 100644
--- a/gdb/testsuite/boards/local-remote-host-native.exp
+++ b/gdb/testsuite/boards/local-remote-host-native.exp
@@ -83,7 +83,11 @@ proc ${board}_spawn { board cmd } {
set RSH [board_info $board rsh_prog]
spawn $RSH -t -l $username $remote $cmd
- set board_info($board,fileid) $spawn_id
+
+ if { [string match "$::GDB*" $cmd] } {
+ set board_info($board,fileid) $spawn_id
+ }
+
return $spawn_id
}