summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2012-04-10 15:31:25 +0000
committerTristan Gingold <gingold@adacore.com>2012-04-10 15:31:25 +0000
commit23fb6ff04e76c4fedac2d303a821643bbcfb729f (patch)
tree80d8de6a67f561f1502524152b3746db8d9746ca /gdb
parent014d62fa7f6a2a296acd42c784377f2a4610e359 (diff)
downloadgdb-23fb6ff04e76c4fedac2d303a821643bbcfb729f.tar.gz
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')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/darwin-nat.c31
2 files changed, 14 insertions, 22 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 304ca3ac4ff..4c7c2e34fb1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 010700cd377..df2b7611421 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 ();
}