OSDN Git Service

* ptrace-target.c (ptrace_break_program): Use SIGSTOP instead of
authorkevinb <kevinb>
Fri, 2 Dec 2005 20:52:04 +0000 (20:52 +0000)
committerkevinb <kevinb>
Fri, 2 Dec 2005 20:52:04 +0000 (20:52 +0000)
SIGINT to interrupt inferior process.
* thread-db.c (thread_db_break_program): Likewise.

rda/unix/ChangeLog
rda/unix/ptrace-target.c
rda/unix/thread-db.c

index 504e658..7e23cc9 100644 (file)
@@ -1,3 +1,9 @@
+2005-12-02  Kevin Buettner  <kevinb@redhat.com>
+
+       * ptrace-target.c (ptrace_break_program): Use SIGSTOP instead of
+       SIGINT to interrupt inferior process.
+       * thread-db.c (thread_db_break_program): Likewise.
+
 2005-12-01  Kevin Buettner  <kevinb@redhat.com>
 
        * thread-db.c (handle_thread_db_event): Allow underlying target a
index 69b016c..25d5d86 100644 (file)
@@ -443,9 +443,11 @@ ptrace_break_program (struct gdbserv *serv)
 {
   struct child_process *process = gdbserv_target_data (serv);
 
+  /* We send SIGSTOP (rather than some other signal such as SIGINT)
+     because SIGSTOP cannot be blocked or ignored.  */
   if (process->debug_backend)
-    fprintf (stderr, " -- send SIGINT to child %d\n", process->pid);
-  kill (process->pid, SIGINT);
+    fprintf (stderr, " -- send SIGSTOP to child %d\n", process->pid);
+  kill (process->pid, SIGSTOP);
 }
 
 /* get_trap_number vector
index 35b67af..9c6da96 100644 (file)
@@ -2073,10 +2073,15 @@ thread_db_break_program (struct gdbserv *serv)
 
   /* We always send the signal to the main thread.  It's not correct
      to use process->pid; that's whatever thread last reported a
-     status, and it may well have been exiting.  */
+     status, and it may well have been exiting.
+
+     We send SIGSTOP, rather than some other signal such as SIGINT,
+     because SIGSTOP cannot be blocked or ignored.  On Linux, using
+     a signal that can be blocked means that the process never gets
+     interrupted, since it's the kernel which does the blocking.  */
   if (process->debug_backend)
-    fprintf (stderr, " -- send SIGINT to child %d\n", proc_handle.pid);
-  kill (proc_handle.pid, SIGINT);
+    fprintf (stderr, " -- send SIGSTOP to child %d\n", proc_handle.pid);
+  kill (proc_handle.pid, SIGSTOP);
 }
 
 /* Function: check_child_state