From: kevinb Date: Fri, 2 Dec 2005 20:52:04 +0000 (+0000) Subject: * ptrace-target.c (ptrace_break_program): Use SIGSTOP instead of X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=79955cb6f356c850b33dc20951dc163ac09b6a59;p=pf3gnuchains%2Fpf3gnuchains3x.git * ptrace-target.c (ptrace_break_program): Use SIGSTOP instead of SIGINT to interrupt inferior process. * thread-db.c (thread_db_break_program): Likewise. --- diff --git a/rda/unix/ChangeLog b/rda/unix/ChangeLog index 504e6584f8..7e23cc99cf 100644 --- a/rda/unix/ChangeLog +++ b/rda/unix/ChangeLog @@ -1,3 +1,9 @@ +2005-12-02 Kevin Buettner + + * 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 * thread-db.c (handle_thread_db_event): Allow underlying target a diff --git a/rda/unix/ptrace-target.c b/rda/unix/ptrace-target.c index 69b016c022..25d5d86e47 100644 --- a/rda/unix/ptrace-target.c +++ b/rda/unix/ptrace-target.c @@ -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 diff --git a/rda/unix/thread-db.c b/rda/unix/thread-db.c index 35b67afd60..9c6da96980 100644 --- a/rda/unix/thread-db.c +++ b/rda/unix/thread-db.c @@ -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