+2014-05-21 Pedro Alves <palves@redhat.com>
+
+ * inf-child.c (inf_child_mourn_inferior): New function.
+ * inf-child.h (inf_child_mourn_inferior): New declaration.
+ * darwin-nat.c (darwin_mourn_inferior): Use
+ inf_child_mourn_inferior.
+ * gnu-nat.c (gnu_mourn_inferior): Likewise.
+ * inf-ptrace.c (inf_ptrace_mourn_inferior): Likewise.
+ * inf-ttrace.c (inf_ttrace_mourn_inferior): Likewise.
+ * nto-procfs.c (procfs_mourn_inferior): Likewise.
+ * windows-nat.c (windows_mourn_inferior): Likewise.
+
2014-05-21 Doug Evans <xdje42@gmail.com>
* scm-breakpoint.c (breakpoint_functions): Fix typo.
xfree (inf->private);
inf->private = NULL;
- generic_mourn_inferior ();
- inf_child_maybe_unpush_target (ops);
+ inf_child_mourn_inferior (ops);
}
static void
{
inf_debug (gnu_current_inf, "rip");
inf_detach (gnu_current_inf);
- generic_mourn_inferior ();
- inf_child_maybe_unpush_target (ops);
+ inf_child_mourn_inferior (ops);
}
\f
inf_child_explicitly_opened = 0;
}
+void
+inf_child_mourn_inferior (struct target_ops *ops)
+{
+ generic_mourn_inferior ();
+ inf_child_maybe_unpush_target (ops);
+}
+
/* See inf-child.h. */
void
extern void inf_child_open_target (struct target_ops *target,
char *arg, int from_tty);
+/* To be called by the native target's to_mourn_inferior routine. */
+
+extern void inf_child_mourn_inferior (struct target_ops *ops);
+
/* Unpush the target if it wasn't explicitly open with "target native"
and there are no live inferiors left. Note: if calling this as a
result of a mourn or detach, the current inferior shall already
only report its exit status to its original parent. */
waitpid (ptid_get_pid (inferior_ptid), &status, 0);
- generic_mourn_inferior ();
-
- inf_child_maybe_unpush_target (ops);
+ inf_child_mourn_inferior (ops);
}
/* Attach to the process specified by ARGS. If FROM_TTY is non-zero,
}
inf_ttrace_page_dict.count = 0;
- generic_mourn_inferior ();
- inf_child_maybe_unpush_target (ops);
+ inf_child_mourn_inferior (ops);
}
/* Assuming we just attached the debugger to a new inferior, create
}
inferior_ptid = null_ptid;
init_thread_list ();
- generic_mourn_inferior ();
- inf_child_maybe_unpush_target (ops);
+ inf_child_mourn_inferior (ops);
}
/* This function breaks up an argument string into an argument
CHECK (CloseHandle (current_process_handle));
open_process_used = 0;
}
- generic_mourn_inferior ();
- inf_child_maybe_unpush_target (ops);
+ inf_child_mourn_inferior (ops);
}
/* Send a SIGINT to the process group. This acts just like the user typed a