From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12326 invoked by alias); 24 Oct 2017 10:00:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 12233 invoked by uid 89); 24 Oct 2017 10:00:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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 ESMTP; Tue, 24 Oct 2017 10:00:29 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 95900343379; Tue, 24 Oct 2017 10:00:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 95900343379 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4CC360841; Tue, 24 Oct 2017 10:00:20 +0000 (UTC) Subject: [pushed] Reindent gdb.threads/attach-into-signal.exp (Re: [PATCH 6/6] Drop /proc/PID/status polling from gdb.threads/attach-into-signal.exp) To: Yao Qi References: <1508768307-11531-1-git-send-email-palves@redhat.com> <1508768307-11531-7-git-send-email-palves@redhat.com> <86fua957l7.fsf@gmail.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Tue, 24 Oct 2017 10:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <86fua957l7.fsf@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-10/txt/msg00740.txt.bz2 On 10/24/2017 08:27 AM, Yao Qi wrote: > Pedro Alves writes: > >> gdb/testsuite/ChangeLog: >> yyyy-mm-dd Pedro Alves >> >> * gdb.threads/attach-into-signal.exp: Remove whole "stoppedtry" >> loop. > > Patch is good to me. Thanks. Pushed that one, and as promised, pushed the one below as well. >From eb2bfbadc159ff1463e58daf24c4ad5d1a23796d Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 24 Oct 2017 10:43:45 +0100 Subject: [PATCH] Reindent gdb.threads/attach-into-signal.exp A previous patch removed one nesting level. gdb/testsuite/ChangeLog: 2017-10-24 Pedro Alves * gdb.threads/attach-into-signal.exp (corefunc): Reindent. --- gdb/testsuite/ChangeLog | 4 ++ gdb/testsuite/gdb.threads/attach-into-signal.exp | 76 ++++++++++++------------ 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 25dcd06..d9ed687 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2017-10-24 Pedro Alves + * gdb.threads/attach-into-signal.exp (corefunc): Reindent. + +2017-10-24 Pedro Alves + * gdb.threads/attach-into-signal.exp: Remove whole "stoppedtry" loop. diff --git a/gdb/testsuite/gdb.threads/attach-into-signal.exp b/gdb/testsuite/gdb.threads/attach-into-signal.exp index ab80e82..3158b59 100644 --- a/gdb/testsuite/gdb.threads/attach-into-signal.exp +++ b/gdb/testsuite/gdb.threads/attach-into-signal.exp @@ -56,50 +56,50 @@ proc corefunc { threadtype executable } { set attempt 1 set passes 1 while { $passes < 3 && $attempt <= $attempts } { - set test "attach (pass $passes), pending signal catch" - if {[gdb_test_multiple "attach $testpid" $test { - -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.* received signal SIGALRM.*$gdb_prompt $" { - # nonthreaded: - pass $test - verbose -log "$test succeeded on the attempt # $attempt of $attempts" - set passes [expr $passes + 1] - } - -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { - set ok 0 - - if { $threadtype == "threaded" } { - # In the threaded case, the signal is left - # pending on the second thread. Check for - # that by peeking at the thread's siginfo. - # SIGALRM is 14, SIGSTOP is 19. - - set test2 "thread apply 2 print \$_siginfo.si_signo" - gdb_test_multiple $test2 $test2 { - -re " = 14\r\n$gdb_prompt $" { - set ok 1 - } - -re " = 19\r\n$gdb_prompt $" { - } + set test "attach (pass $passes), pending signal catch" + if {[gdb_test_multiple "attach $testpid" $test { + -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.* received signal SIGALRM.*$gdb_prompt $" { + # nonthreaded: + pass $test + verbose -log "$test succeeded on the attempt # $attempt of $attempts" + set passes [expr $passes + 1] + } + -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { + set ok 0 + + if { $threadtype == "threaded" } { + # In the threaded case, the signal is left + # pending on the second thread. Check for + # that by peeking at the thread's siginfo. + # SIGALRM is 14, SIGSTOP is 19. + + set test2 "thread apply 2 print \$_siginfo.si_signo" + gdb_test_multiple $test2 $test2 { + -re " = 14\r\n$gdb_prompt $" { + set ok 1 + } + -re " = 19\r\n$gdb_prompt $" { } - } else { - # In the nonthreaded case, GDB should tell the - # user about having seen a signal. } + } else { + # In the nonthreaded case, GDB should tell the + # user about having seen a signal. + } - if { $ok == 0} { - # We just lack the luck, we should try it again. - set attempt [expr $attempt + 1] - } else { - pass $test - verbose -log "$test succeeded on the attempt # $attempt of $attempts" - set passes [expr $passes + 1] - } + if { $ok == 0} { + # We just lack the luck, we should try it again. + set attempt [expr $attempt + 1] + } else { + pass $test + verbose -log "$test succeeded on the attempt # $attempt of $attempts" + set passes [expr $passes + 1] } - }] != 0 } { - break } + }] != 0 } { + break + } - gdb_test "detach" "Detaching from.*" "" + gdb_test "detach" "Detaching from.*" "" } if {$passes < 3} { -- 2.5.5