From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 915DB3858C54; Sun, 8 May 2022 11:53:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 915DB3858C54 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with check-readmore X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 07d977417111236a15af7813f723b608bcf67c47 X-Git-Newrev: efd1a8512f9d749861498bb3e9756727cda5e230 Message-Id: <20220508115345.915DB3858C54@sourceware.org> Date: Sun, 8 May 2022 11:53:45 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2022 11:53:45 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Defd1a8512f9d= 749861498bb3e9756727cda5e230 commit efd1a8512f9d749861498bb3e9756727cda5e230 Author: Tom de Vries Date: Sun May 8 13:53:41 2022 +0200 [gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with check-readmo= re =20 When running test-case gdb.threads/fork-plus-threads.exp with check-rea= dmore, 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=3Doff: \ inferior 1 exited (timeout) ... =20 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. =20 Fix this by adopting a line-by-line approach, which deals with those me= ssages one at a time. =20 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/testsuit= e/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 } { =20 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 + } } =20 # Verify that we got all the inferior exits we expected.