Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 6/6] Make signal-while-stepping-over-bp-other-thread.exp run against remote targets too.
Date: Tue, 25 Feb 2014 21:08:00 -0000	[thread overview]
Message-ID: <1393360363-5603-7-git-send-email-palves@redhat.com> (raw)
In-Reply-To: <1393360363-5603-1-git-send-email-palves@redhat.com>

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  <palves@redhat.com>

	* 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


  parent reply	other threads:[~2014-02-25 21:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 20:32 [PATCH 0/6] Fix a bunch of run control bugs Pedro Alves
2014-02-25 20:32 ` [PATCH 3/6] Fix missing breakpoing/watchpoint hits, eliminate deferred_step_ptid Pedro Alves
2014-03-04  6:05   ` Yao Qi
2014-03-05 16:10     ` Pedro Alves
2014-02-25 20:32 ` [PATCH 2/6] PR breakpoints/7143 - Watchpoint does not trigger when first set Pedro Alves
2014-03-05 15:35   ` Pedro Alves
2014-02-25 20:32 ` [PATCH 1/6] PR gdb/16575: stale breakpoint instructions in the code cache Pedro Alves
2014-03-04  4:02   ` Yao Qi
2014-03-05 15:13     ` Pedro Alves
2014-03-05 15:14   ` Pedro Alves
2014-02-25 20:33 ` [PATCH 4/6] Fix for even more missed events; eliminate thread-hop code Pedro Alves
2014-03-05 15:45   ` Pedro Alves
2014-02-25 20:33 ` [PATCH 5/6] Handle multiple step-overs Pedro Alves
2014-02-25 21:08 ` Pedro Alves [this message]
2014-02-26 13:36 ` [PATCH 3.5/6] Multiple Ada task-specific breakpoints at the same address Pedro Alves
2014-02-26 14:19   ` Joel Brobecker
2014-02-26 14:27     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393360363-5603-7-git-send-email-palves@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox