From patchwork Wed Jul 30 11:30:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 2235 Received: (qmail 28240 invoked by alias); 30 Jul 2014 11:30:51 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 28228 invoked by uid 89); 30 Jul 2014 11:30:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 30 Jul 2014 11:30:40 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6UBUZY8031822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Jul 2014 07:30:35 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6UBUXnI001458; Wed, 30 Jul 2014 07:30:34 -0400 Message-ID: <53D8D759.7000602@redhat.com> Date: Wed, 30 Jul 2014 12:30:33 +0100 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Doug Evans , Yao Qi CC: gdb-patches@sourceware.org Subject: [pushed] gdb.threads/signal-command-handle-nopass.exp: Add comment (was: Re: [PATCH v2] Always pass signals to the right thread.) References: <1403183341-12581-1-git-send-email-palves@redhat.com> <53A790DB.40908@codesourcery.com> <53A9648F.1030006@redhat.com> <53ABB36D.6090909@codesourcery.com> <21462.42759.772857.933479@ruffy.mtv.corp.google.com> In-Reply-To: <21462.42759.772857.933479@ruffy.mtv.corp.google.com> On 07/28/2014 08:39 PM, Doug Evans wrote: > Yao Qi writes: > > >> > We want to know whether thread 1 is selected, so using "info threads 1" > > >> > is simpler in the regexp pattern, like > > >> > > > >> > gdb_test "info threads 1" "\\\* 1${ws}Thread .*" "thread 1 selected" > > > The reason I don't like "info threads 1" this is that if the test fails, > > > when you go look at the logs, you don't see which thread was actually > > > current, which tends to make debugging things a little easier. But we > > > can still simplify the patterns. I was aiming at having no wildcards in > > > the middle of the output, but that's really not necessary. > > > I've simplified the patterns now. > > > > OK. > > A good thing to document in the test though, eh? > [i.e., *why* "info threads" is used instead of "info threads 1"] > > [I realize the patch has been pushed, just a thought for future reference.] > OK, done. Thanks. --------------------------------------- [PATCH] gdb.threads/signal-command-handle-nopass.exp: Add comment Explain why we do "info threads". gdb/testsuite/ 2014-07-30 Pedro Alves * gdb.threads/signal-command-handle-nopass.exp (test): Add comment. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a90ee8b..6eb8f3e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-07-30 Pedro Alves + + * gdb.threads/signal-command-handle-nopass.exp (test): Add + comment. + 2014-07-29 Yao Qi PR gdb/17206 diff --git a/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp b/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp index 3ea9cf8..e46a0ab 100644 --- a/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp +++ b/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp @@ -69,6 +69,10 @@ proc test { step_over } { gdb_test "signal SIGUSR1" "handler .*" + # Make sure it was thread 1 that got the signal. Note we list + # all threads instead of just thread 1, so that if something + # goes wrong and another thread ends up selected, we can + # easily see which in the logs. gdb_test "info threads" $pattern "thread 1 got the signal" } }