gdb/
[deliverable/binutils-gdb.git] / gdb / record.c
index ac55cdf8a0d210b3455c95fe54e5e1c3bc7fa330..08ffb687e2e0502900e3cba2c12036d198e60f6f 100644 (file)
@@ -33,6 +33,7 @@
 #include "event-loop.h"
 #include "inf-loop.h"
 #include "gdb_bfd.h"
+#include "observer.h"
 
 #include <signal.h>
 
@@ -153,7 +154,7 @@ struct record_entry
 };
 
 /* This is the debug switch for process record.  */
-int record_debug = 0;
+unsigned int record_debug = 0;
 
 /* If true, query if PREC cannot record memory
    change of next instruction.  */
@@ -511,14 +512,14 @@ record_arch_list_add_mem (CORE_ADDR addr, int len)
     fprintf_unfiltered (gdb_stdlog,
                        "Process record: add mem addr = %s len = %d to "
                        "record list.\n",
-                       paddress (target_gdbarch, addr), len);
+                       paddress (target_gdbarch (), addr), len);
 
   if (!addr)   /* FIXME: Why?  Some arch must permit it...  */
     return 0;
 
   rec = record_mem_alloc (addr, len);
 
-  if (record_read_memory (target_gdbarch, addr, record_get_loc (rec), len))
+  if (record_read_memory (target_gdbarch (), addr, record_get_loc (rec), len))
     {
       record_mem_release (rec);
       return -1;
@@ -873,7 +874,7 @@ record_open_1 (char *name, int from_tty)
     error (_("Process record target can't debug inferior in non-stop mode "
             "(non-stop)."));
 
-  if (!gdbarch_process_record_p (target_gdbarch))
+  if (!gdbarch_process_record_p (target_gdbarch ()))
     error (_("Process record: the current architecture doesn't support "
             "record function."));
 
@@ -1001,6 +1002,8 @@ record_open (char *name, int from_tty)
                                  NULL);
 
   record_init_record_breakpoints ();
+
+  observer_notify_record_changed (current_inferior (),  1);
 }
 
 /* "to_close" target method.  Close the process record target.  */
@@ -1683,7 +1686,7 @@ record_xfer_partial (struct target_ops *ops, enum target_object object,
          if (!query (_("Because GDB is in replay mode, writing to memory "
                        "will make the execution log unusable from this "
                        "point onward.  Write memory at address %s?"),
-                      paddress (target_gdbarch, offset)))
+                      paddress (target_gdbarch (), offset)))
            error (_("Process record canceled the operation."));
 
          /* Destroy the record from here forward.  */
@@ -2260,6 +2263,8 @@ cmd_record_stop (char *args, int from_tty)
       unpush_target (&record_ops);
       printf_unfiltered (_("Process record is stopped and all execution "
                            "logs are deleted.\n"));
+
+      observer_notify_record_changed (current_inferior (), 0);
     }
   else
     printf_unfiltered (_("Process record is not started.\n"));
@@ -2982,13 +2987,13 @@ _initialize_record (void)
   init_record_core_ops ();
   add_target (&record_core_ops);
 
-  add_setshow_zinteger_cmd ("record", no_class, &record_debug,
-                           _("Set debugging of record/replay feature."),
-                           _("Show debugging of record/replay feature."),
-                           _("When enabled, debugging output for "
-                             "record/replay feature is displayed."),
-                           NULL, show_record_debug, &setdebuglist,
-                           &showdebuglist);
+  add_setshow_zuinteger_cmd ("record", no_class, &record_debug,
+                            _("Set debugging of record/replay feature."),
+                            _("Show debugging of record/replay feature."),
+                            _("When enabled, debugging output for "
+                              "record/replay feature is displayed."),
+                            NULL, show_record_debug, &setdebuglist,
+                            &showdebuglist);
 
   c = add_prefix_cmd ("record", class_obscure, cmd_record_start,
                      _("Abbreviated form of \"target record\" command."),
This page took 0.025236 seconds and 4 git commands to generate.