hurd: fix gnu_debug_flag type
[deliverable/binutils-gdb.git] / gdb / record-full.c
index 1fd72d5c7c99cf3f969c8f65171c401c6797021e..9d6e403e57611562a47419ffdcaa5d97d84d222e 100644 (file)
 #include "record-full.h"
 #include "elf-bfd.h"
 #include "gcore.h"
-#include "event-loop.h"
+#include "gdbsupport/event-loop.h"
 #include "inf-loop.h"
 #include "gdb_bfd.h"
 #include "observable.h"
 #include "infrun.h"
 #include "gdbsupport/gdb_unlinker.h"
 #include "gdbsupport/byte-vector.h"
+#include "async-event.h"
 
 #include <signal.h>
 
@@ -1228,6 +1229,8 @@ record_full_wait_1 (struct target_ops *ops,
                     interested in the event.  */
 
                  registers_changed ();
+                 switch_to_thread (current_inferior ()->process_target (),
+                                   ret);
                  regcache = get_current_regcache ();
                  tmp_pc = regcache_read_pc (regcache);
                  const struct address_space *aspace = regcache->aspace ();
@@ -1260,14 +1263,17 @@ record_full_wait_1 (struct target_ops *ops,
 
                       if (gdbarch_software_single_step_p (gdbarch))
                        {
+                         process_stratum_target *proc_target
+                           = current_inferior ()->process_target ();
+
                          /* Try to insert the software single step breakpoint.
                             If insert success, set step to 0.  */
-                         set_executing (inferior_ptid, 0);
+                         set_executing (proc_target, inferior_ptid, false);
                          reinit_frame_cache ();
 
                          step = !insert_single_step_breakpoints (gdbarch);
 
-                         set_executing (inferior_ptid, 1);
+                         set_executing (proc_target, inferior_ptid, true);
                        }
 
                      if (record_debug)
@@ -1290,6 +1296,8 @@ record_full_wait_1 (struct target_ops *ops,
     }
   else
     {
+      switch_to_thread (current_inferior ()->process_target (),
+                       record_full_resume_ptid);
       struct regcache *regcache = get_current_regcache ();
       struct gdbarch *gdbarch = regcache->arch ();
       const struct address_space *aspace = regcache->aspace ();
@@ -2786,27 +2794,9 @@ set_record_full_insn_max_num (const char *args, int from_tty,
     }
 }
 
-/* The "set record full" command.  */
-
-static void
-set_record_full_command (const char *args, int from_tty)
-{
-  printf_unfiltered (_("\"set record full\" must be followed "
-                      "by an appropriate subcommand.\n"));
-  help_list (set_record_full_cmdlist, "set record full ", all_commands,
-            gdb_stdout);
-}
-
-/* The "show record full" command.  */
-
-static void
-show_record_full_command (const char *args, int from_tty)
-{
-  cmd_show_list (show_record_full_cmdlist, from_tty, "");
-}
-
+void _initialize_record_full ();
 void
-_initialize_record_full (void)
+_initialize_record_full ()
 {
   struct cmd_list_element *c;
 
@@ -2835,13 +2825,13 @@ Argument is filename.  File must be created with 'record save'."),
   set_cmd_completer (c, filename_completer);
   deprecate_cmd (c, "record full restore");
 
-  add_prefix_cmd ("full", class_support, set_record_full_command,
-                 _("Set record options."), &set_record_full_cmdlist,
-                 "set record full ", 0, &set_record_cmdlist);
+  add_basic_prefix_cmd ("full", class_support,
+                       _("Set record options."), &set_record_full_cmdlist,
+                       "set record full ", 0, &set_record_cmdlist);
 
-  add_prefix_cmd ("full", class_support, show_record_full_command,
-                 _("Show record options."), &show_record_full_cmdlist,
-                 "show record full ", 0, &show_record_cmdlist);
+  add_show_prefix_cmd ("full", class_support,
+                      _("Show record options."), &show_record_full_cmdlist,
+                      "show record full ", 0, &show_record_cmdlist);
 
   /* Record instructions number limit command.  */
   add_setshow_boolean_cmd ("stop-at-limit", no_class,
This page took 0.026117 seconds and 4 git commands to generate.