Make program_space::deleted_solibs a vector of std::string
[deliverable/binutils-gdb.git] / gdb / inferior.c
index bcac98180a295a88bb021c53df2d1c73b0281c53..c88a23c241d63b4e4bef7b96eefcdd93112bf76e 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -71,6 +71,8 @@ set_current_inferior (struct inferior *inf)
   current_inferior_ = inf;
 }
 
+private_inferior::~private_inferior () = default;
+
 inferior::~inferior ()
 {
   inferior *inf = this;
@@ -80,7 +82,6 @@ inferior::~inferior ()
   xfree (inf->args);
   xfree (inf->terminal);
   target_desc_info_free (inf->tdesc_info);
-  xfree (inf->priv);
 }
 
 inferior::inferior (int pid_)
@@ -209,7 +210,6 @@ exit_inferior_1 (struct inferior *inftoex, int silent)
 
   inf->pid = 0;
   inf->fake_pid_p = 0;
-  xfree (inf->priv);
   inf->priv = NULL;
 
   if (inf->vfork_parent != NULL)
@@ -224,6 +224,8 @@ exit_inferior_1 (struct inferior *inftoex, int silent)
     }
 
   inf->pending_detach = 0;
+  /* Reset it.  */
+  inf->control = {NO_STOP_QUIETLY};
 }
 
 void
@@ -253,10 +255,13 @@ exit_inferior_num_silent (int num)
   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);
 
@@ -264,6 +269,14 @@ detach_inferior (int pid)
     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)
 {
@@ -771,7 +784,7 @@ add_inferior_with_spaces (void)
      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;
@@ -915,7 +928,7 @@ clone_inferior_command (const char *args, int from_tty)
         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;
This page took 0.026213 seconds and 4 git commands to generate.