2012-04-10 Tristan Gingold <gingold@adacore.com>

* darwin-nat.c (darwin_kill_inferior): Always use the no ptrace
	code to kill the inferior.
This commit is contained in:
Tristan Gingold 2012-04-10 15:31:29 +00:00
parent eea7714332
commit ee41036f97
2 changed files with 17 additions and 25 deletions

View File

@ -1,3 +1,8 @@
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

View File

@ -1313,35 +1313,22 @@ darwin_kill_inferior (struct target_ops *ops)
gdb_assert (inf != NULL);
if (!inf->private->no_ptrace)
kret = darwin_restore_exception_ports (inf->private);
MACH_CHECK_ERROR (kret);
darwin_reply_to_all_pending_messages (inf);
res = kill (inf->pid, 9);
if (res == 0)
{
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);
darwin_reply_to_all_pending_messages (inf);
darwin_resume_inferior (inf);
ptid = darwin_wait (inferior_ptid, &wstatus);
}
else
{
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 ();
}