Message ID | 1491253593-4116-1-git-send-email-yao.qi@linaro.org |
---|---|
State | New, archived |
Headers |
Received: (qmail 59925 invoked by alias); 3 Apr 2017 21:06:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 59904 invoked by uid 89); 3 Apr 2017 21:06:37 -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, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Continuing X-HELO: mail-wr0-f173.google.com Received: from mail-wr0-f173.google.com (HELO mail-wr0-f173.google.com) (209.85.128.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Apr 2017 21:06:36 +0000 Received: by mail-wr0-f173.google.com with SMTP id t20so8228946wra.1 for <gdb-patches@sourceware.org>; Mon, 03 Apr 2017 14:06:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=XOXjqEWepLs4kFkhb6YtngUfxtx35zzSUPSS0cIP8NY=; b=KAl/iDa6lrO74k5VJB3tPWhHNZEulwjY4zReqJpBBW/934RMpr0GHU5QFSlBmsvUCG cRSaX5PFIhUcg6760xCVN71mVisq6AvJ0r8gxQX6+q983JJjt0UC+Wwl+3B86HcuQTJ4 68jdDcgaOcf89fvpd6tB/j8ARUD2MHGrocQ7hZcOfJ1Bpe3+Jrz+/H+B8VJq4Qz7Giek 3deAHg49bZf8uLDG573hwNfjgkRd6En6lnmCCq3YkulbOORbomGrOaAQ4bBOXRhk4duj kFKI1TyKVa3yp91eTZLedv3G/zHxvJyh835CyQ2YgylBHkggg2SXh8mDeaEtauw2XXkI rxjQ== X-Gm-Message-State: AFeK/H2fNexC8bUgQddAW1ALYFRwBOsOjmXB626txe6Jyrz1iA8z9Rdx oUg+4mpg9SQIn3Zk X-Received: by 10.28.74.147 with SMTP id n19mr7241009wmi.86.1491253595812; Mon, 03 Apr 2017 14:06:35 -0700 (PDT) Received: from E107787-LIN.Home ([194.214.185.158]) by smtp.gmail.com with ESMTPSA id m14sm5060500wrb.13.2017.04.03.14.06.34 for <gdb-patches@sourceware.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 14:06:35 -0700 (PDT) From: Yao Qi <qiyaoltc@gmail.com> X-Google-Original-From: Yao Qi <yao.qi@linaro.org> To: gdb-patches@sourceware.org Subject: [PATCH] Fix racy test in gdb.threads/thread-specific-bp.exp Date: Mon, 3 Apr 2017 22:06:33 +0100 Message-Id: <1491253593-4116-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes |
Commit Message
Yao Qi
April 3, 2017, 9:06 p.m. UTC
I see the following test fail from time to time, due to the racy test in gdb.threads/thread-specific-bp.exp. continue -a^M Continuing.^M ^M Thread 1 "thread-specific" hit Breakpoint 4, end () at binutils-gdb/gdb/testsuite/gdb.threads/thread-specific-bp.c:29^M 29 }^M (gdb) [Thread 0x40322460 (LWP 12950) exited]^M Thread-specific breakpoint 3 deleted - thread 2 no longer in the thread list.^M FAIL: gdb.threads/thread-specific-bp.exp: non-stop: continue to end (timeout) This patch changes gdb_test to gdb_test_multiple to match prompt only instead of both prompt and anchor. gdb/testsuite: 2017-04-03 Yao Qi <yao.qi@linaro.org> * gdb.threads/thread-specific-bp.exp (check_thread_specific_breakpoint): Use gdb_test_multiple, and don't match anchor. --- gdb/testsuite/gdb.threads/thread-specific-bp.exp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Comments
On 2017-04-03 17:06, Yao Qi wrote: > diff --git a/gdb/testsuite/gdb.threads/thread-specific-bp.exp > b/gdb/testsuite/gdb.threads/thread-specific-bp.exp > index bdf12f8..a652e9c 100644 > --- a/gdb/testsuite/gdb.threads/thread-specific-bp.exp > +++ b/gdb/testsuite/gdb.threads/thread-specific-bp.exp > @@ -87,9 +87,12 @@ proc check_thread_specific_breakpoint {mode} { > } else { > set cmd "continue" > } > - gdb_test "$cmd" \ > - "Breakpoint .* end .* at .*" \ > - "continue to end" > + set test "continue to end" > + gdb_test_multiple "$cmd" $test { > + -re "Breakpoint .* end .* at .*(\[^\r\n\]*)\r\n$gdb_prompt " { I am not sure I understand what this is supposed to match. First are the parenthesis useful, since we're not using any capture group? Then, .* followed with [^\r\n]* doesn't seem useful, since the .* can just match anything the [^\r\n]* doesn't match. What about just this? set test "continue to end" gdb_test_multiple "$cmd" $test { -re "hit Breakpoint $decimal, end \\(\\) at.*$gdb_prompt " { pass $test } } Simon
Simon Marchi <simon.marchi@polymtl.ca> writes: > I am not sure I understand what this is supposed to match. First are > the parenthesis useful, since we're not using any capture group? I don't capture anything. > Then, .* followed with [^\r\n]* doesn't seem useful, since the .* can > just match anything the [^\r\n]* doesn't match. > > What about just this? > > set test "continue to end" > gdb_test_multiple "$cmd" $test { > -re "hit Breakpoint $decimal, end \\(\\) at.*$gdb_prompt " { We should still keep \r\n before $gdb_prompt. > pass $test > } > } The original pattern is "end .* at", so I want to leave it there, and change it to set test "continue to end" gdb_test_multiple "$cmd" $test { -re "Breakpoint .* end .* at .*\r\n$gdb_prompt " { pass $test } }
On 2017-04-04 04:08, Yao Qi wrote: >> Then, .* followed with [^\r\n]* doesn't seem useful, since the .* can >> just match anything the [^\r\n]* doesn't match. >> >> What about just this? >> >> set test "continue to end" >> gdb_test_multiple "$cmd" $test { >> -re "hit Breakpoint $decimal, end \\(\\) at.*$gdb_prompt " { > > We should still keep \r\n before $gdb_prompt. > >> pass $test >> } >> } > > The original pattern is "end .* at", so I want to leave it there, and > change it to > > set test "continue to end" > gdb_test_multiple "$cmd" $test { > -re "Breakpoint .* end .* at .*\r\n$gdb_prompt " { > pass $test > } > } LGTM.
On Tue, Apr 4, 2017 at 2:37 PM, Simon Marchi <simon.marchi@polymtl.ca> wrote: > > LGTM. Patch is pushed in.
diff --git a/gdb/testsuite/gdb.threads/thread-specific-bp.exp b/gdb/testsuite/gdb.threads/thread-specific-bp.exp index bdf12f8..a652e9c 100644 --- a/gdb/testsuite/gdb.threads/thread-specific-bp.exp +++ b/gdb/testsuite/gdb.threads/thread-specific-bp.exp @@ -87,9 +87,12 @@ proc check_thread_specific_breakpoint {mode} { } else { set cmd "continue" } - gdb_test "$cmd" \ - "Breakpoint .* end .* at .*" \ - "continue to end" + set test "continue to end" + gdb_test_multiple "$cmd" $test { + -re "Breakpoint .* end .* at .*(\[^\r\n\]*)\r\n$gdb_prompt " { + pass $test + } + } set test "thread-specific breakpoint was deleted" gdb_test_multiple "info breakpoint" $test {