[gdb/testsuite] Fix check-read1 FAIL in attach-many-short-lived-threads.exp
authorTom de Vries <tdevries@suse.de>
Sat, 14 Mar 2020 14:48:26 +0000 (15:48 +0100)
committerTom de Vries <tdevries@suse.de>
Sat, 14 Mar 2020 14:48:26 +0000 (15:48 +0100)
When running test-case gdb.threads/attach-many-short-lived-threads.exp with
check-read1, I ran into:
...
FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 1: \
  no new threads (timeout)
...

Fix this by rewriting the gdb_test_multiple call using -lbl and exp_continue.

Tested on x86_64-linux, with make targets check and check-read1.

gdb/testsuite/ChangeLog:

2020-03-14  Tom de Vries  <tdevries@suse.de>

* gdb.threads/attach-many-short-lived-threads.exp: Read "info threads"
result in line-by-line fashion.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp

index a9c2852251153fc11c4585ac9074d3616108c59a..520e4533fa539733ac56ed973c60bd8a7be51205 100644 (file)
@@ -1,3 +1,8 @@
+2020-03-14  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.threads/attach-many-short-lived-threads.exp: Read "info threads"
+       result in line-by-line fashion.
+
 2020-03-14  Tom de Vries  <tdevries@suse.de>
 
        * lib/gdb.exp (supports_statement_frontiers): New proc.
index 9a08e5738b2cd5480df770d50b3bf55e3284be31..13014347b408e723f898b20d5c9f01b124737f20 100644 (file)
@@ -108,12 +108,18 @@ proc test {} {
            sleep 1
 
            set test "no new threads"
-           gdb_test_multiple "info threads" $test {
-               -re "New .*$gdb_prompt $" {
-                   fail $test
+           set status 1
+           gdb_test_multiple "info threads" $test -lbl {
+               -re "\r\n\[^\r\n\]*New " {
+                   set status 0
+                   exp_continue
                }
-               -re "$gdb_prompt $" {
-                   pass $test
+               -re -wrap "" {
+                   if { $status == 1 } {
+                       pass $gdb_test_name
+                   } else {
+                       fail $gdb_test_name
+                   }
                }
            }