From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18300 invoked by alias); 7 Mar 2014 01:10:51 -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 18170 invoked by uid 89); 7 Mar 2014 01:10:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 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 ESMTP; Fri, 07 Mar 2014 01:10:48 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s271AlWi013466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Mar 2014 20:10:47 -0500 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s271Aej9011362 for ; Thu, 6 Mar 2014 20:10:46 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v3 5/5] Make signal-while-stepping-over-bp-other-thread.exp run against remote targets too. Date: Fri, 07 Mar 2014 01:10:00 -0000 Message-Id: <1394154640-14053-6-git-send-email-palves@redhat.com> In-Reply-To: <1394154640-14053-1-git-send-email-palves@redhat.com> References: <1394154640-14053-1-git-send-email-palves@redhat.com> X-SW-Source: 2014-03/txt/msg00170.txt.bz2 Use pthread_kill instead of the host's "kill". The reason the test wasn't written that way to begin with, is that done this way, before the previous fixes to make GDB step-over all other threads before the stepping thread, the test would fail... Tested on x86_64 Fedora 17, native and gdbserver. 2014-02-25 Pedro Alves * gdb.threads/signal-while-stepping-over-bp-other-thread.c (main): Use pthread_kill to signal thread 2. * gdb.threads/signal-while-stepping-over-bp-other-thread.exp: Adjust to make the test send itself a signal rather than using the host's "kill" command. --- .../signal-while-stepping-over-bp-other-thread.c | 2 ++ .../signal-while-stepping-over-bp-other-thread.exp | 14 ++------------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.c b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.c index a4634f2..8839a6f 100644 --- a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.c +++ b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.c @@ -138,6 +138,8 @@ main () pthread_barrier_wait (&barrier); callme (); /* set wait-thread-3 breakpoint here */ + pthread_kill (child_thread_2, SIGUSR1); + pthread_join (child_thread_2, NULL); pthread_join (child_thread_3, NULL); 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 c46dad2..2a30604 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 @@ -26,11 +26,6 @@ if [target_info exists gdb,nosignals] { return -1 } -# Test uses host "kill". -if { [is_remote target] } { - return -1 -} - if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ executable [list debug "incdir=${objdir}"]] != "" } { return -1 @@ -67,11 +62,6 @@ gdb_breakpoint [gdb_get_line_number "set wait-thread-3 breakpoint here"] gdb_continue_to_breakpoint "run to breakpoint" gdb_test "info threads" "" "info threads with thread 3" -set testpid [get_value "pid" "get pid of inferior"] -if { $testpid == -1 } { - return -1 -} - gdb_test "set scheduler-locking on" gdb_breakpoint [gdb_get_line_number "set breakpoint child_two here"] @@ -94,8 +84,8 @@ gdb_test "p *myp = 0" " = 0" "force loop break in thread 2" # core. gdb_test "handle SIGUSR1 print nostop pass" "" "" -# Queue a signal in thread 2. -remote_exec host "kill -SIGUSR1 ${testpid}" +gdb_test "thread 1" "" "switch to thread 1 to queue signal in thread 2" +gdb_test "next 2" "pthread_join .*" "queue signal in thread 2" gdb_test "thread 3" "" "switch to thread 3 for stepping" set my_number [get_value "my_number" "get my_number"] -- 1.7.11.7