diff options
author | David S. Miller <davem@redhat.com> | 2006-04-07 21:42:33 +0000 |
---|---|---|
committer | David S. Miller <davem@redhat.com> | 2006-04-07 21:42:33 +0000 |
commit | 9c0dd46b95f82899ba2648fb6c1e7561382098dc (patch) | |
tree | b5fd8a649f513ba451c2faa492501b2411989868 /gdb/linux-nat.c | |
parent | 670aa98f98df20aebd704523716949ddd578c95e (diff) | |
download | gdb-9c0dd46b95f82899ba2648fb6c1e7561382098dc.zip gdb-9c0dd46b95f82899ba2648fb6c1e7561382098dc.tar.gz gdb-9c0dd46b95f82899ba2648fb6c1e7561382098dc.tar.bz2 |
* linux-nat.c (linux_nat_thread_alive): Handle targets that
do not implement PTRACE_PEEKUSER.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 658c984..a60d8e0 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; |