From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with check-readmore
Date: Sun, 8 May 2022 13:54:58 +0200 [thread overview]
Message-ID: <516fb025-9727-fd3a-b421-dbf00ac4433f@suse.de> (raw)
In-Reply-To: <20220501083627.GA8512@delia.home>
On 5/1/22 10:36, Tom de Vries wrote:
> Hi,
>
> 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.
>
> Any comments?
>
Committed.
Thanks,
- Tom
> [gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with check-readmore
>
> ---
> 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.
prev parent reply other threads:[~2022-05-08 11:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-01 8:36 [PATCH][gdb/testsuite] " Tom de Vries
2022-05-08 11:54 ` Tom de Vries [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=516fb025-9727-fd3a-b421-dbf00ac4433f@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).