From patchwork Wed Apr 1 22:14:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 5973 Received: (qmail 98406 invoked by alias); 1 Apr 2015 22:14:33 -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 98202 invoked by uid 89); 1 Apr 2015 22:14:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD 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, 01 Apr 2015 22:14:30 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 60CCAC659A for ; Wed, 1 Apr 2015 22:14:29 +0000 (UTC) Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t31MEEtw009701 for ; Wed, 1 Apr 2015 18:14:28 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 13/17] Fix signal-while-stepping-over-bp-other-thread.exp on targets always in non-stop Date: Wed, 1 Apr 2015 23:14:10 +0100 Message-Id: <1427926454-16431-14-git-send-email-palves@redhat.com> In-Reply-To: <1427926454-16431-1-git-send-email-palves@redhat.com> References: <1427926454-16431-1-git-send-email-palves@redhat.com> With "maint set target-non-stop on" we get: -PASS: gdb.threads/signal-while-stepping-over-bp-other-thread.exp: step +FAIL: gdb.threads/signal-while-stepping-over-bp-other-thread.exp: step The issue is simply that switch_back_to_stepped_thread is not used in non-stop mode, thus infrun doesn't output the expected "signal arrived while stepping over breakpoint" log. gdb/testsuite/ChangeLog: 2015-04-01 Pedro Alves * signal-while-stepping-over-bp-other-thread.exp: Use gdb_test_sequence. Expect "restart threads" as alternative to "switching back to stepped thread". --- .../signal-while-stepping-over-bp-other-thread.exp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp index bb00c50..1d5eabd 100644 --- a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp +++ b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp @@ -95,19 +95,19 @@ gdb_test "set scheduler-locking off" # Make sure we're exercising the paths we want to. gdb_test "set debug infrun 1" -gdb_test \ - "step" \ - ".*need to step-over.*resume \\(step=1.*signal arrived while stepping over breakpoint.*switching back to stepped thread.*stepped to a different line.*callme.*" \ - "step" +set test "step" +gdb_test_sequence $test $test { + "need to step-over \[^\r\n\]* first" + "resume \\(step=1" + "Program received signal SIGUSR1" + "(restart threads|signal arrived while stepping over breakpoint)" + "stepped to a different line" + "callme \\(\\);" +} set cnt_after [get_value "args\[$my_number\]" "get count after step"] # Test that GDB doesn't inadvertently resume the stepped thread when a # signal arrives while stepping over a breakpoint in another thread. -set test "stepped thread under control" -if { $cnt_before + 1 == $cnt_after } { - pass $test -} else { - fail $test -} +gdb_assert { $cnt_before + 1 == $cnt_after } "stepped thread under control"