- /* This version of Unix doesn't require a meaningful "post startup
- inferior" operation by a debugger. */
+ if (args != NULL)
+ error (_("Argument given to \"disconnect\"."));
+
+ /* This offers to detach/kill current inferiors, and then pops all
+ targets. */
+ target_preopen (from_tty);
+}
+
+/* Implement the to_close target_ops method. */
+
+static void
+inf_child_close (struct target_ops *target)
+{
+ /* In case we were forcibly closed. */
+ 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
+inf_child_maybe_unpush_target (struct target_ops *ops)
+{
+ if (!inf_child_explicitly_opened && !have_inferiors ())
+ unpush_target (ops);
+}
+
+static void
+inf_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
+{
+ /* This target doesn't require a meaningful "post startup inferior"
+ operation by a debugger. */