Introduce switch_to_inferior_no_thread
[deliverable/binutils-gdb.git] / gdb / mi / mi-main.c
index 0e99fa39bdda43e0759e72050e646624e3530490..24daf3f883883433856cd0a0ab67e81abad37252 100644 (file)
@@ -1,6 +1,6 @@
 /* MI Command Set.
 
-   Copyright (C) 2000-2019 Free Software Foundation, Inc.
+   Copyright (C) 2000-2020 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions (a Red Hat company).
 
@@ -414,11 +414,7 @@ run_one_inferior (struct inferior *inf, void *arg)
       switch_to_thread (tp);
     }
   else
-    {
-      set_current_inferior (inf);
-      switch_to_no_thread ();
-      set_current_program_space (inf->pspace);
-    }
+    switch_to_inferior_no_thread (inf);
   mi_execute_cli_command (run_cmd, async_p,
                          async_p ? "&" : NULL);
   return 0;
@@ -696,8 +692,9 @@ output_cores (struct ui_out *uiout, const char *field_name, const char *xcores)
   ui_out_emit_list list_emitter (uiout, field_name);
   auto cores = make_unique_xstrdup (xcores);
   char *p = cores.get ();
+  char *saveptr;
 
-  for (p = strtok (p, ","); p;  p = strtok (NULL, ","))
+  for (p = strtok_r (p, ",", &saveptr); p;  p = strtok_r (NULL, ",", &saveptr))
     uiout->field_string (NULL, p);
 }
 
This page took 0.025711 seconds and 4 git commands to generate.