* linux-nat.c (linux_nat_thread_alive): Handle targets that
authorDavid S. Miller <davem@redhat.com>
Fri, 7 Apr 2006 21:42:33 +0000 (21:42 +0000)
committerDavid S. Miller <davem@redhat.com>
Fri, 7 Apr 2006 21:42:33 +0000 (21:42 +0000)
do not implement PTRACE_PEEKUSER.

gdb/ChangeLog
gdb/linux-nat.c

index f8a453b3679468701af8d79531fea2ce99c8e0b7..f3f2d68444e141188af34e96723ce1cc9297414e 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-07  David S. Miller  <davem@sunset.davemloft.net>
+
+       * linux-nat.c (linux_nat_thread_alive): Handle targets that
+       do not implement PTRACE_PEEKUSER.
+
 2006-04-07  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * remote.c (remote_wait): Convert warning to error before
index 658c984dfdeea017254bc1ed7ef6801b9782ffe2..a60d8e0cacac2e7013c9bdea3fd0fb9dc8793534 100644 (file)
@@ -2382,7 +2382,13 @@ linux_nat_thread_alive (ptid_t ptid)
                        "LLTA: PTRACE_PEEKUSER %s, 0, 0 (%s)\n",
                        target_pid_to_str (ptid),
                        errno ? safe_strerror (errno) : "OK");
-  if (errno)
+
+  /* Not every Linux target implements PTRACE_PEEKUSER.
+     But we can handle that case gracefully since ptrace
+     will first do a lookup for the process based upon the
+     passed-in pid.  If that fails we will get either -ESRCH
+     or -EPERM, otherwise the child exists and is alive.  */
+  if (errno == -ESRCH || errno == -EPERM)
     return 0;
 
   return 1;
This page took 0.039661 seconds and 4 git commands to generate.