From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1551) id 5C0D53858D1E; Wed, 13 Jul 2022 21:31:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C0D53858D1E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pedro Alves To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Tighten gdb.threads/no-unwaited-for-left.exp regexps X-Act-Checkin: binutils-gdb X-Git-Author: Pedro Alves X-Git-Refname: refs/heads/master X-Git-Oldrev: 2b8b0dca3b6b9ad40e0c11754bf2f972bd8de890 X-Git-Newrev: 9779607aff84cad92d8800290dce4eb17c17ce12 Message-Id: <20220713213146.5C0D53858D1E@sourceware.org> Date: Wed, 13 Jul 2022 21:31:46 +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: Wed, 13 Jul 2022 21:31:46 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D9779607aff84= cad92d8800290dce4eb17c17ce12 commit 9779607aff84cad92d8800290dce4eb17c17ce12 Author: Pedro Alves Date: Wed Jun 15 15:30:23 2022 +0100 Tighten gdb.threads/no-unwaited-for-left.exp regexps =20 A WIP version of a patch (https://sourceware.org/pipermail/gdb-patches/2022-June/190202.html) resulted in a bug that went unnoticed by the testuite, like so: =20 (gdb) PASS: gdb.threads/no-unwaited-for-left.exp: enable scheduler-loc= king, for main thread continue Continuing. [New Thread 1251861.1251861] No unwaited-for children left. (gdb) PASS: gdb.threads/no-unwaited-for-left.exp: continue stops when = the main thread exits info threads Id Target Id Frame 3 Thread 1251861.1251863 "no-unwaited-for" __pthread_clockjoin_ex= (threadid=3D140737351558976, thread_return=3D0x0, clockid=3D, abstime=3D, block=3D) at pthread_join_comm= on.c:145 4 Thread 1251861.1251861 "no-unwaited-for" in ?? () =20 The current thread has terminated. See `help thread'. (gdb) PASS: gdb.threads/no-unwaited-for-left.exp: only thread 3 left, = main thread terminated =20 Somehow, above, GDB re-added the zombie leader back before printing "No unwaited-for children left.". The "only thread 3 left, main thread terminated" test should have caught this, but didn't. That is because the test's regexp has a ".*" after the part that matches thread 3. This commit tightens that regexp to catch such a bug. It also tightens the "only main thread left, thread 2 terminated" test's regexp in the same way. =20 Change-Id: I8744f327a0aa0e2669d1ddda88247e99b91cefff Diff: --- gdb/testsuite/gdb.threads/no-unwaited-for-left.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.threads/no-unwaited-for-left.exp b/gdb/tests= uite/gdb.threads/no-unwaited-for-left.exp index cfeb495594d..6773aa46d71 100644 --- a/gdb/testsuite/gdb.threads/no-unwaited-for-left.exp +++ b/gdb/testsuite/gdb.threads/no-unwaited-for-left.exp @@ -42,7 +42,7 @@ gdb_test "continue" \ "continue stops when thread 2 exits" =20 gdb_test "info threads" \ - "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *1 *Thr= ead \[^\r\n\]* \[^\r\n\]*.*The current thread has terminated.= *" \ + "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *1 *Thr= ead \[^\r\n\]* \[^\r\n\]*\[\r\n\]*The current thread has term= inated.*" \ "only main thread left, thread 2 terminated" =20 # Select the main thread, let the third thread start, and stop at the @@ -63,7 +63,7 @@ gdb_test "continue" \ "continue stops when the main thread exits" =20 gdb_test "info threads" \ - "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *3 *Thr= ead \[^\r\n\]* \[^\r\n\]*.*The current thread has terminated.= *" \ + "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *3 *Thr= ead \[^\r\n\]* \[^\r\n\]*\[\r\n\]*The current thread has term= inated.*" \ "only thread 3 left, main thread terminated" =20 # Make sure thread apply all works when we have exited threads in the