+2012-04-10 Tristan Gingold <gingold@adacore.com>
+
+ * darwin-nat.c (darwin_kill_inferior): Always use the no ptrace
+ code to kill the inferior.
+
2012-04-09 Mark Kettenis <kettenis@gnu.org>
* ada-exp.y (yyss, yysslim, yyssp, yystacksize, yyvs, yyvsp): New
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 ();
}