[gdb/testsuite] Fix gdb.threads/step-bg-decr-pc-switch-thread.exp for native-gdbserver
authorTom de Vries <tdevries@suse.de>
Mon, 13 Mar 2023 15:47:25 +0000 (16:47 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 13 Mar 2023 15:47:25 +0000 (16:47 +0100)
commit275589d9a0fda6fe898aae678588bb3841d3fed1
tree50128e6c82fa8758b94279af337c0f85809779a5
parent1878b6b5f67ba79ac0903b0fd5768adafeb55109
[gdb/testsuite] Fix gdb.threads/step-bg-decr-pc-switch-thread.exp for native-gdbserver

With test-case gdb.threads/step-bg-decr-pc-switch-thread.exp and target board
native-gdbserver, I run into:
...
(gdb) UNSUPPORTED: gdb.threads/step-bg-decr-pc-switch-thread.exp: \
  switch to main thread
Remote debugging from host ::1, port 43914^M
monitor exit^M
Cannot execute this command while the target is running.^M
Use the "interrupt" command to stop the target^M
and then try again.^M
(gdb) WARNING: Timed out waiting for EOF in server after monitor exit
...

Fix this by following the advice and issuing an interrupt command, allowing
the following monitor exit command to succeed.

Tested on x86_64-linux.
gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp