[gdb/testsuite] Fix gdb.threads/multi-create-ns-info-thr.exp
authorTom de Vries <tdevries@suse.de>
Tue, 8 Jun 2021 08:04:44 +0000 (10:04 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 8 Jun 2021 08:04:44 +0000 (10:04 +0200)
With a testsuite setup modified to make expect wait a little bit longer for
gdb output (see PR27957), I reliably run into:
...
PASS: gdb.threads/multi-create-ns-info-thr.exp: continue to breakpoint 1
FAIL: gdb.threads/multi-create-ns-info-thr.exp: continue to breakpoint 2 \
  (timeout)
...

This is due to this regexp:
...
       -re "Breakpoint $decimal,.*$srcfile:$bp_location1" {
...
consuming several lines using the ".*" part, while it's intended to match one
line looking like this:
...
Thread 1 "multi-create-ns" hit Breakpoint 2, create_function () \
  at multi-create.c:45^M
...

Fix this by limiting the regexp to one line.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-06-08  Tom de Vries  <tdevries@suse.de>

* gdb.threads/multi-create-ns-info-thr.exp: Limit breakpoint regexp to
one line.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/multi-create-ns-info-thr.exp

index d89ef4a00cf9c6cc320ae26edf434c138b0e0511..dc921257de18d32e55e5765bdcdd749f9322ece0 100644 (file)
@@ -1,3 +1,8 @@
+2021-06-08  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.threads/multi-create-ns-info-thr.exp: Limit breakpoint regexp to
+       one line.
+
 2021-06-08  Tom de Vries  <tdevries@suse.de>
 
        * gdb.base/sect-cmd.exp: Use gdb_test.  Use -wrap "".  Fix
index 2fb522387985e6e4485be045f12391174b99d2e9..1b32637e877341595667521b2fe19c4a83587ced 100644 (file)
@@ -45,7 +45,7 @@ gdb_test_multiple $test $test {
 for {set i 0} {$i < 32} {incr i} {
     set test "continue to breakpoint $i"
     gdb_test_multiple "" $test {
-       -re "Breakpoint $decimal,.*$srcfile:$bp_location1" {
+       -re "Breakpoint $decimal,\[^\r\n\]*$srcfile:$bp_location1" {
            pass $test
        }
     }
This page took 0.034064 seconds and 4 git commands to generate.