public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with check-readmore
@ 2022-05-08 11:53 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-05-08 11:53 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=efd1a8512f9d749861498bb3e9756727cda5e230
commit efd1a8512f9d749861498bb3e9756727cda5e230
Author: Tom de Vries <tdevries@suse.de>
Date: Sun May 8 13:53:41 2022 +0200
[gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with check-readmore
When running test-case gdb.threads/fork-plus-threads.exp with check-readmore,
I run into:
...
[Inferior 11 (process 7029) exited normally]^M
[Inferior 1 (process 6956) exited normally]^M
FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: \
inferior 1 exited (timeout)
...
The problem is that the regexp consuming the "Inferior exited normally"
messages:
- consumes more than one of those messages at a time, but
- counts only one of those messages.
Fix this by adopting a line-by-line approach, which deals with those messages
one at a time.
Tested on x86_64-linux with native, check-read1 and check-readmore.
Diff:
---
gdb/testsuite/gdb.threads/fork-plus-threads.exp | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/gdb/testsuite/gdb.threads/fork-plus-threads.exp b/gdb/testsuite/gdb.threads/fork-plus-threads.exp
index 26fbef72941..c05ac4a5a03 100644
--- a/gdb/testsuite/gdb.threads/fork-plus-threads.exp
+++ b/gdb/testsuite/gdb.threads/fork-plus-threads.exp
@@ -88,23 +88,15 @@ proc do_test { detach-on-fork } {
set test "inferior 1 exited"
gdb_test_multiple "" $test {
- -re "Cannot remove breakpoints" {
+ -re "^Cannot remove breakpoints" {
set saw_cannot_remove_breakpoints 1
exp_continue
}
- -re "Thread \[^\r\n\]+ stopped\\." {
+ -re "^\\\[Thread \[^\r\n\]+ stopped\\." {
set saw_thread_stopped 1
exp_continue
}
- -re "(Thread|LWP) \[^\r\n\]+ exited" {
- # Avoid timeout with check-read1
- exp_continue
- }
- -re "New (Thread|LWP) \[^\r\n\]+" {
- # Avoid timeout with check-read1
- exp_continue
- }
- -re "Inferior ($::decimal) \(\[^\r\n\]+\) exited normally" {
+ -re "^\\\[Inferior ($::decimal) \(\[^\r\n\]+\) exited normally\\\]" {
set infnum $expect_out(1,string)
incr num_inferior_exits_seen
incr inferior_exits_seen($infnum) 1
@@ -115,6 +107,10 @@ proc do_test { detach-on-fork } {
exp_continue
}
}
+ -re "^\[^\r\n]*\r\n" {
+ # Skip line.
+ exp_continue
+ }
}
# Verify that we got all the inferior exits we expected.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-08 11:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-08 11:53 [binutils-gdb] [gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with check-readmore 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).