aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-12-08 10:28:58 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-12-08 10:28:58 +0000
commit784867a51b37a1c8a7babd63563d3cf5bf38bc79 (patch)
tree154c623e8005fb4173242e954dde3958fa9efc6a /gdb
parent7cd3876c8ab2a90706699224ee41dd69178a304f (diff)
downloadgdb-784867a51b37a1c8a7babd63563d3cf5bf38bc79.zip
gdb-784867a51b37a1c8a7babd63563d3cf5bf38bc79.tar.gz
gdb-784867a51b37a1c8a7babd63563d3cf5bf38bc79.tar.bz2
gdb/gdbserver/
* linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist. Print new debug message for such case.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/linux-low.c27
2 files changed, 23 insertions, 9 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 060aac3..e08900a 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-08 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
+ Print new debug message for such case.
+
2011-12-06 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix overlapping memcpy.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 4b5279c..8afbc8b 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -862,17 +862,26 @@ linux_kill (int pid)
thread in the list, so do so now. */
lwp = find_lwp_pid (pid_to_ptid (pid));
- if (debug_threads)
- fprintf (stderr, "lk_1: killing lwp %ld, for pid: %d\n",
- lwpid_of (lwp), pid);
-
- do
+ if (lwp == NULL)
{
- ptrace (PTRACE_KILL, lwpid_of (lwp), 0, 0);
+ if (debug_threads)
+ fprintf (stderr, "lk_1: cannot find lwp %ld, for pid: %d\n",
+ lwpid_of (lwp), pid);
+ }
+ else
+ {
+ if (debug_threads)
+ fprintf (stderr, "lk_1: killing lwp %ld, for pid: %d\n",
+ lwpid_of (lwp), pid);
- /* Make sure it died. The loop is most likely unnecessary. */
- lwpid = linux_wait_for_event (lwp->head.id, &wstat, __WALL);
- } while (lwpid > 0 && WIFSTOPPED (wstat));
+ do
+ {
+ ptrace (PTRACE_KILL, lwpid_of (lwp), 0, 0);
+
+ /* Make sure it died. The loop is most likely unnecessary. */
+ lwpid = linux_wait_for_event (lwp->head.id, &wstat, __WALL);
+ } while (lwpid > 0 && WIFSTOPPED (wstat));
+ }
the_target->mourn (process);