Make signal-while-stepping-over-bp-other-thread.exp run against remote targets too.
authorPedro Alves <palves@redhat.com>
Thu, 20 Mar 2014 13:26:33 +0000 (13:26 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 20 Mar 2014 13:44:32 +0000 (13:44 +0000)
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.

gdb/testsuite/
2014-03-20  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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.c
gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp

index 9b64750ea2798bee93ad739416b187db45675726..bc6d6dfbedc9cde57a628f06e905183df733022b 100644 (file)
@@ -1,3 +1,11 @@
+2014-03-20  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.
+
 2014-03-20  Pedro Alves  <palves@redhat.com>
 
        * gdb.threads/multiple-step-overs.c: New file.
index a4634f2320392d05de6cda40842bbec2bec00561..8839a6f92bd787235192e998d43090dd73e1db01 100644 (file)
@@ -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);
 
index c46dad26e0bda145976b0f399900f107945aaa82..2a306040053b303bde531c224035af0bd0c0bdbb 100644 (file)
@@ -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"]