aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-05-18 18:03:30 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-05-18 18:03:30 +0000
commited7319594583dffb825a9602afb95198207b9a0d (patch)
tree58affc9216f86e5ac6dae14b6dec1eaf716a1388 /gdb/linux-nat.c
parent967cff168cc01f56912a7ef9b4755c1502ad761c (diff)
downloadgdb-ed7319594583dffb825a9602afb95198207b9a0d.zip
gdb-ed7319594583dffb825a9602afb95198207b9a0d.tar.gz
gdb-ed7319594583dffb825a9602afb95198207b9a0d.tar.bz2
gdb/
* linux-nat.c (kill_callback): Use SIGKILL first. gdb/testsuite/ * gdb.base/kill-after-signal.c: New file. * gdb.base/kill-after-signal.exp: New file.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 4c4db3b..7668e60 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -3780,6 +3780,18 @@ linux_nat_wait (struct target_ops *ops,
static int
kill_callback (struct lwp_info *lp, void *data)
{
+ /* PTRACE_KILL may resume the inferior. Send SIGKILL first. */
+
+ errno = 0;
+ kill (GET_LWP (lp->ptid), SIGKILL);
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ "KC: kill (SIGKILL) %s, 0, 0 (%s)\n",
+ target_pid_to_str (lp->ptid),
+ errno ? safe_strerror (errno) : "OK");
+
+ /* Some kernels ignore even SIGKILL for processes under ptrace. */
+
errno = 0;
ptrace (PTRACE_KILL, GET_LWP (lp->ptid), 0, 0);
if (debug_linux_nat)