/* Multi-process control for GDB, the GNU debugger.
- Copyright (C) 2008-2017 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of GDB.
current_inferior_ = inf;
}
+private_inferior::~private_inferior () = default;
+
inferior::~inferior ()
{
inferior *inf = this;
xfree (inf->args);
xfree (inf->terminal);
target_desc_info_free (inf->tdesc_info);
- xfree (inf->priv);
}
inferior::inferior (int pid_)
inf->pid = 0;
inf->fake_pid_p = 0;
- xfree (inf->priv);
inf->priv = NULL;
if (inf->vfork_parent != NULL)
}
inf->pending_detach = 0;
+ /* Reset it. */
+ inf->control = {NO_STOP_QUIETLY};
}
void
exit_inferior_1 (inf, 1);
}
+/* See inferior.h. */
+
void
-detach_inferior (int pid)
+detach_inferior (inferior *inf)
{
- struct inferior *inf = find_inferior_pid (pid);
+ /* Save the pid, since exit_inferior_1 will reset it. */
+ int pid = inf->pid;
exit_inferior_1 (inf, 0);
printf_unfiltered (_("[Inferior %d detached]\n"), pid);
}
+/* See inferior.h. */
+
+void
+detach_inferior (int pid)
+{
+ detach_inferior (find_inferior_pid (pid));
+}
+
void
inferior_appeared (struct inferior *inf, int pid)
{
doesn't really return a new address space; otherwise, it
really does. */
aspace = maybe_new_address_space ();
- pspace = add_program_space (aspace);
+ pspace = new program_space (aspace);
inf = add_inferior (0);
inf->pspace = pspace;
inf->aspace = pspace->aspace;
doesn't really return a new address space; otherwise, it
really does. */
aspace = maybe_new_address_space ();
- pspace = add_program_space (aspace);
+ pspace = new program_space (aspace);
inf = add_inferior (0);
inf->pspace = pspace;
inf->aspace = pspace->aspace;