Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with readnow
Date: Wed, 5 May 2021 09:08:53 +0200	[thread overview]
Message-ID: <20210505070851.GA11045@delia> (raw)

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
 	}

                 reply	other threads:[~2021-05-05  7:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210505070851.GA11045@delia \
    --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