From patchwork Mon Apr 3 21:06:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 19800 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: 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 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 ; 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 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 14:06:35 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi 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 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 * 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(-) 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 {