aboutsummaryrefslogtreecommitdiff
path: root/gdb/darwin-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/darwin-nat.c')
-rw-r--r--gdb/darwin-nat.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index cba84ca..4330a60 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1790,7 +1790,7 @@ darwin_ptrace_him (int pid)
darwin_init_thread_list (inf);
- startup_inferior (START_INFERIOR_TRAPS_EXPECTED);
+ gdb_startup_inferior (pid, START_INFERIOR_TRAPS_EXPECTED);
}
static void
@@ -1833,13 +1833,23 @@ darwin_create_inferior (struct target_ops *ops,
const std::string &allargs,
char **env, int from_tty)
{
+ pid_t pid;
+ ptid_t ptid;
+
/* Do the hard work. */
- fork_inferior (exec_file, allargs, env, darwin_ptrace_me, darwin_ptrace_him,
- darwin_pre_ptrace, NULL, darwin_execvp);
+ pid = fork_inferior (exec_file, allargs, env, darwin_ptrace_me,
+ darwin_ptrace_him, darwin_pre_ptrace, NULL,
+ darwin_execvp);
+ ptid = pid_to_ptid (pid);
/* Return now in case of error. */
if (ptid_equal (inferior_ptid, null_ptid))
return;
+
+ /* We have something that executes now. We'll be running through
+ the shell at this point (if startup-with-shell is true), but the
+ pid shouldn't change. */
+ add_thread_silent (ptid);
}