#include "symfile.h"
#include "gdbsupport/environ.h"
#include "cli/cli-utils.h"
-#include "continuations.h"
#include "arch-utils.h"
#include "target-descriptions.h"
#include "readline/tilde.h"
{
inferior *inf = this;
- discard_all_inferior_continuations (inf);
+ m_continuations.clear ();
inferior_free_data (inf);
- xfree (inf->args);
target_desc_info_free (inf->tdesc_info);
}
return m_terminal.get ();
}
+void
+inferior::add_continuation (std::function<void ()> &&cont)
+{
+ m_continuations.emplace_front (std::move (cont));
+}
+
+void
+inferior::do_all_continuations ()
+{
+ while (!m_continuations.empty ())
+ {
+ auto iter = m_continuations.begin ();
+ (*iter) ();
+ m_continuations.erase (iter);
+ }
+}
+
struct inferior *
add_inferior_silent (int pid)
{
uiout->field_signed ("number", inf->num);
- /* Because target_pid_to_str uses current_top_target,
+ /* Because target_pid_to_str uses the current inferior,
switch the inferior. */
switch_to_inferior_no_thread (inf);
uiout->field_string ("target-id", inferior_pid_to_str (inf->pid));
std::string conn = uiout_field_connection (inf->process_target ());
- uiout->field_string ("connection-id", conn.c_str ());
+ uiout->field_string ("connection-id", conn);
if (inf->pspace->exec_filename != nullptr)
uiout->field_string ("exec", inf->pspace->exec_filename.get ());
struct address_space *aspace;
struct program_space *pspace;
struct inferior *inf;
- struct gdbarch_info info;
/* If all inferiors share an address space on this system, this
doesn't really return a new address space; otherwise, it
/* Setup the inferior's initial arch, based on information obtained
from the global "set ..." options. */
- gdbarch_info_init (&info);
+ gdbarch_info info;
inf->gdbarch = gdbarch_find_by_info (info);
/* The "set ..." options reject invalid settings, so we should
always have a valid arch by now. */