[gdb/testsuite] Handle output after prompt in gdb.threads/step-N-all-progress.exp
authorTom de Vries <tdevries@suse.de>
Wed, 7 Jun 2023 09:36:19 +0000 (11:36 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 7 Jun 2023 09:36:19 +0000 (11:36 +0200)
Using "taskset -c 0" I run into this timeout:
...
(gdb) PASS: gdb.threads/step-N-all-progress.exp: non-stop=on: \
  target-non-stop=on: continue to breakpoint: break here
next 3^M
[New Thread 0x7ffff7dbd6c0 (LWP 10202)]^M
50        return 0;^M
(gdb) [Thread 0x7ffff7dbd6c0 (LWP 10202) exited]^M
FAIL: gdb.threads/step-N-all-progress.exp: non-stop=on: target-non-stop=on: \
  next 3 (timeout)
...

The problem is that this test:
...
    gdb_test "next 3" "return 0;"
...
expects no output after the prompt.

Fix this by using -no-prompt-anchor.

Tested on x86_64-linux.

gdb/testsuite/gdb.threads/step-N-all-progress.exp

index 98cc8423f347c5849875f03ef53d4681d6365c22..485028d34e7b90d72a106012155070e46e6680a8 100644 (file)
@@ -44,7 +44,7 @@ proc test {non-stop target-non-stop} {
 
     gdb_continue_to_breakpoint "break here"
 
-    gdb_test "next 3" "return 0;"
+    gdb_test -no-prompt-anchor "next 3" "return 0;"
 }
 
 foreach_with_prefix non-stop {off on} {