gdb/gdbserver/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 8 Dec 2011 10:28:58 +0000 (10:28 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Thu, 8 Dec 2011 10:28:58 +0000 (10:28 +0000)
* linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
Print new debug message for such case.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c

index 060aac393f84de2f109db4914521530c18012a6f..e08900ac0d3d96f79b57c70504f04ebde3376b69 100644 (file)
@@ -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.
index 4b5279c3f735fdae295273c2e9ea9a8fff2e8caa..8afbc8b9cfa4afe6fceda627914fc6f95c093995 100644 (file)
@@ -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);
 
This page took 0.033753 seconds and 4 git commands to generate.