Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed][gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with readnow
@ 2021-05-05  7:08 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2021-05-05  7:08 UTC (permalink / raw)
  To: gdb-patches

Hi,

When running test-case gdb.threads/fork-plus-threads.exp with target board
readnow, I run into:
...
[LWP 9362 exited]^M
[New LWP 9365]^M
[New LWP 9363]^M
[New LWP 9364]^M
FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: \
  inferior 1 exited (timeout)
...

There is code in the test-case to prevent timeouts with readnow:
...
       -re "Thread \[^\r\n\]+ exited" {
           # Avoid timeout with check-read1
           exp_continue
       }
       -re "New Thread \[^\r\n\]+" {
           # Avoid timeout with check-read1
           exp_continue
       }
...
but this doesn't trigger because we get LWP rather than Thread.

Fix this by making these regexps accept LWP as well.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with readnow

gdb/testsuite/ChangeLog:

2021-05-05  Tom de Vries  <tdevries@suse.de>

	* gdb.threads/fork-plus-threads.exp: Handle "New LWP <n>" and
	"LWP <n> exited" messages.

---
 gdb/testsuite/gdb.threads/fork-plus-threads.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.threads/fork-plus-threads.exp b/gdb/testsuite/gdb.threads/fork-plus-threads.exp
index f5cfb279ce7..7fe3c603bcd 100644
--- a/gdb/testsuite/gdb.threads/fork-plus-threads.exp
+++ b/gdb/testsuite/gdb.threads/fork-plus-threads.exp
@@ -87,11 +87,11 @@ proc do_test { detach-on-fork } {
 	    set saw_thread_stopped 1
 	    exp_continue
 	}
-	-re "Thread \[^\r\n\]+ exited" {
+	-re "(Thread|LWP) \[^\r\n\]+ exited" {
 	    # Avoid timeout with check-read1
 	    exp_continue
 	}
-	-re "New Thread \[^\r\n\]+" {
+	-re "New (Thread|LWP) \[^\r\n\]+" {
 	    # Avoid timeout with check-read1
 	    exp_continue
 	}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-05  7:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05  7:08 [committed][gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with readnow Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox