static void inf_ptrace_create_inferior (struct target_ops *ops, char *exec_file, char *allargs, char **env, int from_tty) { int pid; pid = fork_inferior (exec_file, allargs, env, inf_ptrace_me, NULL, NULL, NULL); push_target (ops); /* On some targets, there must be some explicit synchronization between the parent and child processes after the debugger forks, and before the child execs the debuggee program. This call basically gives permission for the child to exec. */ target_acknowledge_created_inferior (pid); /* START_INFERIOR_TRAPS_EXPECTED is defined in inferior.h, and will be 1 or 2 depending on whether we're starting without or with a shell. */ startup_inferior (START_INFERIOR_TRAPS_EXPECTED); /* On some targets, there must be some explicit actions taken after the inferior has been started up. */ target_post_startup_inferior (pid_to_ptid (pid)); }
static void inf_ptrace_him (int pid) { push_target (ptrace_ops_hack); /* On some targets, there must be some explicit synchronization between the parent and child processes after the debugger forks, and before the child execs the debuggee program. This call basically gives permission for the child to exec. */ target_acknowledge_created_inferior (pid); /* START_INFERIOR_TRAPS_EXPECTED is defined in inferior.h, and will be 1 or 2 depending on whether we're starting without or with a shell. */ startup_inferior (START_INFERIOR_TRAPS_EXPECTED); /* On some targets, there must be some explicit actions taken after the inferior has been started up. */ target_post_startup_inferior (pid_to_ptid (pid)); }