Introduce switch_to_inferior_no_thread
[deliverable/binutils-gdb.git] / gdb / inferior.c
index 3969ace13a848a411b6944ef45cf9cbfe0f7fcf8..0c5e2c74d4ea63ae29fc417b1f284690c03cb6b4 100644 (file)
@@ -575,6 +575,16 @@ kill_inferior_command (const char *args, int from_tty)
   bfd_cache_close_all ();
 }
 
+/* See inferior.h.  */
+
+void
+switch_to_inferior_no_thread (inferior *inf)
+{
+  set_current_inferior (inf);
+  switch_to_no_thread ();
+  set_current_program_space (inf->pspace);
+}
+
 static void
 inferior_command (const char *args, int from_tty)
 {
@@ -605,9 +615,7 @@ inferior_command (const char *args, int from_tty)
     }
   else
     {
-      set_current_inferior (inf);
-      switch_to_no_thread ();
-      set_current_program_space (inf->pspace);
+      switch_to_inferior_no_thread (inf);
 
       gdb::observers::user_selected_context_changed.notify
        (USER_SELECTED_INFERIOR);
@@ -737,11 +745,8 @@ add_inferior_command (const char *args, int from_tty)
       if (exec != NULL)
        {
          /* Switch over temporarily, while reading executable and
-            symbols.q.  */
-         set_current_program_space (inf->pspace);
-         set_current_inferior (inf);
-         switch_to_no_thread ();
-
+            symbols.  */
+         switch_to_inferior_no_thread (inf);
          exec_file_attach (exec.get (), from_tty);
          symbol_file_add_main (exec.get (), add_flags);
        }
This page took 0.02538 seconds and 4 git commands to generate.