diff options
author | Tom de Vries <tdevries@suse.de> | 2022-10-29 09:43:32 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2022-10-29 09:43:32 +0200 |
commit | 8db6f1bd27086c9623e2b8eb8d01bc4c0a863ca7 (patch) | |
tree | da85f05579a6e4b3f549ac2dac76659010b0f346 /gdb | |
parent | 64ba0c58a79bdec307b722cc09aab724d34ba28b (diff) | |
download | binutils-8db6f1bd27086c9623e2b8eb8d01bc4c0a863ca7.zip binutils-8db6f1bd27086c9623e2b8eb8d01bc4c0a863ca7.tar.gz binutils-8db6f1bd27086c9623e2b8eb8d01bc4c0a863ca7.tar.bz2 |
[gdb/testsuite] Fix gdb.server/multi-ui-errors.exp with local-remote-host-notty
With test-case gdb.server/multi-ui-errors.exp and host board
local-remote-host-notty, I run into:
...
(gdb) PASS: gdb.server/multi-ui-errors.exp: interact with GDB's main UI
Executing on target: kill -9 29666 (timeout = 300)
builtin_spawn -ignore SIGHUP kill -9 29666^M
echo^M
Remote connection closed^M
(gdb) (gdb) FAIL: gdb.server/multi-ui-errors.exp: \
main UI, prompt after gdbserver dies (timeout)
...
In contrast, with local-remote-host (so, everything the same but editing off):
...
(gdb) PASS: gdb.server/multi-ui-errors.exp: interact with GDB's main UI
Executing on target: kill -9 31245 (timeout = 300)
builtin_spawn -ignore SIGHUP kill -9 31245^M
Remote connection closed^M
(gdb) echo^M
(gdb) PASS: gdb.server/multi-ui-errors.exp: main UI, prompt after gdbserver dies
...
The test-case issues a kill, which results in a "Remote connection closed"
message and a prompt.
The problem is that the prompt is not consumed, so the subsequent echo may be
issued before that prompt, which causes a mismatch when matching the result
of the echo.
Fix this by consuming the "Remote connection closed" message and prompt.
Tested on x86_64-linux.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/gdb.server/multi-ui-errors.exp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.server/multi-ui-errors.exp b/gdb/testsuite/gdb.server/multi-ui-errors.exp index 8a1276f..45a2dab 100644 --- a/gdb/testsuite/gdb.server/multi-ui-errors.exp +++ b/gdb/testsuite/gdb.server/multi-ui-errors.exp @@ -112,6 +112,14 @@ remote_exec target "kill -9 $gdbserver_pid" # interpreter now. with_spawn_id $gdb_main_spawn_id { + gdb_test_multiple "" "remote connection closed - main UI" { + -re -wrap "Remote connection closed" { + pass $gdb_test_name + } + } +} + +with_spawn_id $gdb_main_spawn_id { gdb_test "echo" "" \ "main UI, prompt after gdbserver dies" } |