diff options
author | Tristan Gingold <gingold@adacore.com> | 2012-04-10 15:31:29 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2012-04-10 15:31:29 +0000 |
commit | ee41036f97eacbeac8248b55b52812900a8e7fa9 (patch) | |
tree | 16111236fb33e1d746af5aa8f335bd8e822969a8 /gdb/darwin-nat.c | |
parent | eea771433207dc469c9a9f8d1abee361437b35c2 (diff) | |
download | gdb-ee41036f97eacbeac8248b55b52812900a8e7fa9.zip gdb-ee41036f97eacbeac8248b55b52812900a8e7fa9.tar.gz gdb-ee41036f97eacbeac8248b55b52812900a8e7fa9.tar.bz2 |
2012-04-10 Tristan Gingold <gingold@adacore.com>
* darwin-nat.c (darwin_kill_inferior): Always use the no ptrace
code to kill the inferior.
Diffstat (limited to 'gdb/darwin-nat.c')
-rw-r--r-- | gdb/darwin-nat.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 010700c..df2b761 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -1313,35 +1313,22 @@ darwin_kill_inferior (struct target_ops *ops) gdb_assert (inf != NULL); - if (!inf->private->no_ptrace) - { - darwin_stop_inferior (inf); - - res = PTRACE (PT_KILL, inf->pid, 0, 0); - if (res != 0) - warning (_("Failed to kill inferior: ptrace returned %d " - "[%s] (pid=%d)"), - res, safe_strerror (errno), inf->pid); + kret = darwin_restore_exception_ports (inf->private); + MACH_CHECK_ERROR (kret); - darwin_reply_to_all_pending_messages (inf); + darwin_reply_to_all_pending_messages (inf); - darwin_resume_inferior (inf); + res = kill (inf->pid, 9); - ptid = darwin_wait (inferior_ptid, &wstatus); - } - else + if (res == 0) { - kret = darwin_restore_exception_ports (inf->private); - MACH_CHECK_ERROR (kret); - - darwin_reply_to_all_pending_messages (inf); - darwin_resume_inferior (inf); - - res = kill (inf->pid, 9); - + ptid = darwin_wait (inferior_ptid, &wstatus); } + else if (errno != ESRCH) + warning (_("Failed to kill inferior: kill (%d, 9) returned [%s]"), + inf->pid, safe_strerror (errno)); target_mourn_inferior (); } |