summaryrefslogtreecommitdiff
path: root/gdb/linux-fork.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2008-07-10 22:58:37 +0000
committerPedro Alves <pedro@codesourcery.com>2008-07-10 22:58:37 +0000
commit85fdbde9dfc62928a36ece6c53a42b59e28b31e7 (patch)
treee0a91cb0175ef39074aa0b6a6482790b34762e63 /gdb/linux-fork.c
parentc462612a8868f57b873bde5decb0a01095a886fe (diff)
downloadgdb-85fdbde9dfc62928a36ece6c53a42b59e28b31e7.tar.gz
Non-stop linux native.
* linux-nat.c (linux_test_for_tracefork): Block events while we're here. (get_pending_status): Implement non-stop mode. (linux_nat_detach): Stop threads before detaching. (linux_nat_resume): In non-stop mode, always resume only a single PTID. (linux_handle_extended_wait): On a clone event, in non-stop mode, add new lwp to GDB's thread table, and mark as running, executing and stopped appropriately. (linux_nat_filter_event): Don't assume there are other running threads when a thread exits. (linux_nat_wait): Mark the main thread as running and executing. In non-stop mode, don't stop all lwps. (linux_nat_kill): Stop lwps before killing them. (linux_nat_thread_alive): Use signal 0 to detect if a thread is alive. (send_sigint_callback): New. (linux_nat_stop): New. (linux_nat_add_target): Set to_stop to linux_nat_stop. * linux-nat.h (thread_db_attach_lwp): Declare. * linux-thread-db.c (thread_get_info_callback): Check for new threads if we have none. (thread_from_lwp, enable_thread_event): Set proc_handle.pid to the stopped lwp. Check for new threads if we have none. (thread_db_attach_lwp): New. (thread_db_init): Set proc_handle.pid to inferior_ptid. (check_event): Set proc_handle.pid to the stopped lwp. (thread_db_find_new_threads): Set proc_handle.pid to any stopped lwp available, bail out if there is none. * linux-fork.c (linux_fork_killall): Use SIGKILL instead of PTRACE_KILL.
Diffstat (limited to 'gdb/linux-fork.c')
-rw-r--r--gdb/linux-fork.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index a9f5faecfbe..fcc8a29e7ad 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -337,7 +337,9 @@ linux_fork_killall (void)
{
pid = PIDGET (fp->ptid);
do {
- ptrace (PT_KILL, pid, 0, 0);
+ /* Use SIGKILL instead of PTRACE_KILL because the former works even
+ if the thread is running, while the later doesn't. */
+ kill (pid, SIGKILL);
ret = waitpid (pid, &status, 0);
/* We might get a SIGCHLD instead of an exit status. This is
aggravated by the first kill above - a child has just