public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pedro Alves <palves@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Tighten gdb.threads/no-unwaited-for-left.exp regexps
Date: Wed, 13 Jul 2022 21:31:46 +0000 (GMT)	[thread overview]
Message-ID: <20220713213146.5C0D53858D1E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9779607aff84cad92d8800290dce4eb17c17ce12

commit 9779607aff84cad92d8800290dce4eb17c17ce12
Author: Pedro Alves <pedro@palves.net>
Date:   Wed Jun 15 15:30:23 2022 +0100

    Tighten gdb.threads/no-unwaited-for-left.exp regexps
    
    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:
    
     (gdb) PASS: gdb.threads/no-unwaited-for-left.exp: enable scheduler-locking, 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=140737351558976, thread_return=0x0, clockid=<optimized out>, abstime=<optimized out>, block=<optimized out>) at pthread_join_common.c:145
       4    Thread 1251861.1251861 "no-unwaited-for" <unavailable> in ?? ()
    
     The current thread <Thread ID 1> has terminated.  See `help thread'.
     (gdb) PASS: gdb.threads/no-unwaited-for-left.exp: only thread 3 left, main thread terminated
    
    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.
    
    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/testsuite/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"
 
 gdb_test "info threads" \
-	 "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *1 *Thread \[^\r\n\]* \[^\r\n\]*.*The current thread <Thread ID 2> has terminated.*" \
+	 "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *1 *Thread \[^\r\n\]* \[^\r\n\]*\[\r\n\]*The current thread <Thread ID 2> has terminated.*" \
 	 "only main thread left, thread 2 terminated"
 
 # 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"
 
 gdb_test "info threads" \
-	 "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *3 *Thread \[^\r\n\]* \[^\r\n\]*.*The current thread <Thread ID 1> has terminated.*" \
+	 "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n *3 *Thread \[^\r\n\]* \[^\r\n\]*\[\r\n\]*The current thread <Thread ID 1> has terminated.*" \
 	 "only thread 3 left, main thread terminated"
 
 # Make sure thread apply all works when we have exited threads in the


                 reply	other threads:[~2022-07-13 21:31 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=20220713213146.5C0D53858D1E@sourceware.org \
    --to=palves@sourceware.org \
    --cc=gdb-cvs@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).