From: David S. Miller Date: Fri, 7 Apr 2006 21:42:33 +0000 (+0000) Subject: * linux-nat.c (linux_nat_thread_alive): Handle targets that X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9c0dd46b95f82899ba2648fb6c1e7561382098dc;p=binutils-gdb.git * linux-nat.c (linux_nat_thread_alive): Handle targets that do not implement PTRACE_PEEKUSER. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f8a453b3679..f3f2d68444e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2006-04-07 David S. Miller + + * linux-nat.c (linux_nat_thread_alive): Handle targets that + do not implement PTRACE_PEEKUSER. + 2006-04-07 Daniel Jacobowitz * remote.c (remote_wait): Convert warning to error before diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 658c984dfde..a60d8e0caca 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -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;