From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35326 invoked by alias); 17 Mar 2015 20:59:49 -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 35266 invoked by uid 89); 17 Mar 2015 20:59:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 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; Tue, 17 Mar 2015 20:59:47 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id CA637C63E3 for ; Tue, 17 Mar 2015 20:59:45 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2HKxjdG013735 for ; Tue, 17 Mar 2015 16:59:45 -0400 Subject: [PATCH 2/2] Add a test for "break thread thread 2". From: Keith Seitz To: gdb-patches@sourceware.org Date: Tue, 17 Mar 2015 20:59:00 -0000 Message-ID: <20150317205945.9650.70051.stgit@valrhona.uglyboxes.com> In-Reply-To: <20150317205942.9650.84728.stgit@valrhona.uglyboxes.com> References: <20150317205942.9650.84728.stgit@valrhona.uglyboxes.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00511.txt.bz2 This is a follow-on patch to prove that we really do need the linespec parser `keyword_ok' state. This test is mentioned in the source code, but it is never actually tested anywhere. This patch adds it. gdb/testsuite/ChangeLog * gdb.threads/bp_in_thread.c (noreturn): Rename to ... (thread): ... this. * gdb.threads/bp_in_thread.exp: Change all references of `noreturn' to `thread'. Add test for setting thread-specific breakpoint on the function called `thread'. --- gdb/testsuite/gdb.threads/bp_in_thread.c | 4 ++-- gdb/testsuite/gdb.threads/bp_in_thread.exp | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.threads/bp_in_thread.c b/gdb/testsuite/gdb.threads/bp_in_thread.c index 3b16b62..4e7e94c 100644 --- a/gdb/testsuite/gdb.threads/bp_in_thread.c +++ b/gdb/testsuite/gdb.threads/bp_in_thread.c @@ -30,7 +30,7 @@ cond_wait (pthread_cond_t *cond, pthread_mutex_t *mut) } void -noreturn (void) +thread (void) { pthread_mutex_t mut; pthread_cond_t cond; @@ -46,7 +46,7 @@ noreturn (void) void * forever_pthread (void *unused) { - noreturn (); + thread (); } void diff --git a/gdb/testsuite/gdb.threads/bp_in_thread.exp b/gdb/testsuite/gdb.threads/bp_in_thread.exp index 306dabe..d6e2353 100644 --- a/gdb/testsuite/gdb.threads/bp_in_thread.exp +++ b/gdb/testsuite/gdb.threads/bp_in_thread.exp @@ -28,14 +28,17 @@ clean_restart $binfile runto_main -gdb_test "break noreturn" \ +gdb_test "break thread" \ "Breakpoint 2 at .*: file .*${srcfile}, line .*" \ - "breakpoint on noreturn" + "breakpoint on thread" # Run the program and make sure GDB reports that we stopped after -# hitting breakpoint 1 in noreturn(). +# hitting breakpoint 1 in thread(). gdb_test "continue" \ - ".*Breakpoint 2, noreturn ().*" \ - "run to noreturn" + ".*Breakpoint 2, thread ().*" \ + "run to thread()" +# Make sure the linespec parser understands that "break thread thread 2" +# is a valid thread-specific location. +gdb_breakpoint "thread thread 2" message