diff options
author | Joel Brobecker <brobecker@gnat.com> | 2011-07-01 18:36:28 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2011-07-01 18:36:28 +0000 |
commit | a7aa0d73a26241ba616f42563bfe19bd0077312c (patch) | |
tree | f2780e6c8edb39feedd0581b8137d50e05dc720f /gdb/sparc-tdep.c | |
parent | 5e9bc145ee7e5d1e5651a996bcf81d9888b34cf1 (diff) | |
download | gdb-a7aa0d73a26241ba616f42563bfe19bd0077312c.zip gdb-a7aa0d73a26241ba616f42563bfe19bd0077312c.tar.gz gdb-a7aa0d73a26241ba616f42563bfe19bd0077312c.tar.bz2 |
[Darwin] Do not crash (failed assertion) after PT_KILL ptrace error
It might not be a debugger bug that caused the PT_KILL ptrace operation
to fail. So emit a warning instead, and try to continue.
This patch also tries to handle the case where ptrace return -1,
but left errno set to zero. According to the ptrace man page,
it is possible for some ptrace operations to return -1 in non-error
situations, and to detect those situations, it explains that errno
should be set prior to calling ptrace, and then checked again after.
gdb/ChangeLog:
* darwin-nat.c (darwin_ptrace): Add documentation.
Set errno to zero before calling ptrace. If ptrace returns
-1 and errno is zero, then change then return zero.
(darwin_kill_inferior): Issue a warning instead of triggering
a failed assertion when the PT_KILL ptrace operations returned
nonzero.
Diffstat (limited to 'gdb/sparc-tdep.c')
0 files changed, 0 insertions, 0 deletions