]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/record.c
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / record.c
index 7dae18f77b4f3d6c4798558f3c4fe292aab946c8..f7c95153537448f2267e9a6882806b3633318767 100644 (file)
@@ -1,6 +1,6 @@
 /* Process record and replay target for GDB, the GNU debugger.
 
-   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+   Copyright (C) 2008-2023 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -55,7 +55,7 @@ struct cmd_list_element *info_record_cmdlist = NULL;
 
 #define DEBUG(msg, args...)                                            \
   if (record_debug)                                                    \
-    fprintf_unfiltered (gdb_stdlog, "record: " msg "\n", ##args)
+    gdb_printf (gdb_stdlog, "record: " msg "\n", ##args)
 
 /* See record.h.  */
 
@@ -257,8 +257,8 @@ static void
 show_record_debug (struct ui_file *file, int from_tty,
                   struct cmd_list_element *c, const char *value)
 {
-  fprintf_filtered (file, _("Debugging of process record target is %s.\n"),
-                   value);
+  gdb_printf (file, _("Debugging of process record target is %s.\n"),
+             value);
 }
 
 /* Alias for "target record".  */
@@ -279,14 +279,14 @@ cmd_record_delete (const char *args, int from_tty)
 
   if (!target_record_is_replaying (inferior_ptid))
     {
-      printf_unfiltered (_("Already at end of record list.\n"));
+      gdb_printf (_("Already at end of record list.\n"));
       return;
     }
 
   if (!target_supports_delete_record ())
     {
-      printf_unfiltered (_("The current record target does not support "
-                          "this operation.\n"));
+      gdb_printf (_("The current record target does not support "
+                   "this operation.\n"));
       return;
     }
 
@@ -308,8 +308,8 @@ cmd_record_stop (const char *args, int from_tty)
   record_stop (t);
   record_unpush (t);
 
-  printf_unfiltered (_("Process record is stopped and all execution "
-                      "logs are deleted.\n"));
+  gdb_printf (_("Process record is stopped and all execution "
+               "logs are deleted.\n"));
 
   gdb::observers::record_changed.notify (current_inferior (), 0, NULL, NULL);
 }
@@ -325,11 +325,11 @@ info_record_command (const char *args, int from_tty)
   t = find_record_target ();
   if (t == NULL)
     {
-      printf_filtered (_("No recording is currently active.\n"));
+      gdb_printf (_("No recording is currently active.\n"));
       return;
     }
 
-  printf_filtered (_("Active record target: %s\n"), t->shortname ());
+  gdb_printf (_("Active record target: %s\n"), t->shortname ());
   t->info_record ();
 }
 
@@ -494,6 +494,9 @@ get_insn_history_modifiers (const char **arg)
            case 'r':
              modifiers |= DISASSEMBLY_RAW_INSN;
              break;
+           case 'b':
+             modifiers |= DISASSEMBLY_RAW_BYTES;
+             break;
            case 'f':
              modifiers |= DISASSEMBLY_OMIT_FNAME;
              break;
@@ -785,24 +788,30 @@ A size of \"unlimited\" means unlimited lines.  The default is 10."),
                            set_record_call_history_size, NULL,
                            &set_record_cmdlist, &show_record_cmdlist);
 
-  c = add_prefix_cmd ("record", class_obscure, cmd_record_start,
+  cmd_list_element *record_cmd
+    = add_prefix_cmd ("record", class_obscure, cmd_record_start,
                      _("Start recording."),
                      &record_cmdlist, 0, &cmdlist);
-  set_cmd_completer (c, filename_completer);
+  set_cmd_completer (record_cmd, filename_completer);
+
+  add_com_alias ("rec", record_cmd, class_obscure, 1);
+
+  set_show_commands setshow_record_cmds
+    = add_setshow_prefix_cmd ("record", class_support,
+                             _("Set record options."),
+                             _("Show record options."),
+                             &set_record_cmdlist, &show_record_cmdlist,
+                             &setlist, &showlist);
+
+
+  add_alias_cmd ("rec", setshow_record_cmds.set, class_obscure, 1, &setlist);
+  add_alias_cmd ("rec", setshow_record_cmds.show, class_obscure, 1, &showlist);
 
-  add_com_alias ("rec", "record", class_obscure, 1);
-  add_basic_prefix_cmd ("record", class_support,
-                       _("Set record options."), &set_record_cmdlist,
-                       0, &setlist);
-  add_alias_cmd ("rec", "record", class_obscure, 1, &setlist);
-  add_show_prefix_cmd ("record", class_support,
-                      _("Show record options."), &show_record_cmdlist,
-                      0, &showlist);
-  add_alias_cmd ("rec", "record", class_obscure, 1, &showlist);
-  add_prefix_cmd ("record", class_support, info_record_command,
-                 _("Info record options."), &info_record_cmdlist,
-                 0, &infolist);
-  add_alias_cmd ("rec", "record", class_obscure, 1, &infolist);
+  cmd_list_element *info_record_cmd
+    = add_prefix_cmd ("record", class_support, info_record_command,
+                     _("Info record options."), &info_record_cmdlist,
+                     0, &infolist);
+  add_alias_cmd ("rec", info_record_cmd, class_obscure, 1, &infolist);
 
   c = add_cmd ("save", class_obscure, cmd_record_save,
               _("Save the execution log to a file.\n\
@@ -811,26 +820,31 @@ Default filename is 'gdb_record.PROCESS_ID'."),
               &record_cmdlist);
   set_cmd_completer (c, filename_completer);
 
-  add_cmd ("delete", class_obscure, cmd_record_delete,
-          _("Delete the rest of execution log and start recording it anew."),
-          &record_cmdlist);
-  add_alias_cmd ("d", "delete", class_obscure, 1, &record_cmdlist);
-  add_alias_cmd ("del", "delete", class_obscure, 1, &record_cmdlist);
-
-  add_cmd ("stop", class_obscure, cmd_record_stop,
-          _("Stop the record/replay target."),
-          &record_cmdlist);
-  add_alias_cmd ("s", "stop", class_obscure, 1, &record_cmdlist);
+  cmd_list_element *record_delete_cmd
+    =  add_cmd ("delete", class_obscure, cmd_record_delete,
+               _("Delete the rest of execution log and start recording it \
+anew."),
+           &record_cmdlist);
+  add_alias_cmd ("d", record_delete_cmd, class_obscure, 1, &record_cmdlist);
+  add_alias_cmd ("del", record_delete_cmd, class_obscure, 1, &record_cmdlist);
+
+  cmd_list_element *record_stop_cmd
+    = add_cmd ("stop", class_obscure, cmd_record_stop,
+              _("Stop the record/replay target."),
+              &record_cmdlist);
+  add_alias_cmd ("s", record_stop_cmd, class_obscure, 1, &record_cmdlist);
 
   add_prefix_cmd ("goto", class_obscure, cmd_record_goto, _("\
 Restore the program to its state at instruction number N.\n\
 Argument is instruction number, as shown by 'info record'."),
                  &record_goto_cmdlist, 1, &record_cmdlist);
 
-  add_cmd ("begin", class_obscure, cmd_record_goto_begin,
-          _("Go to the beginning of the execution log."),
-          &record_goto_cmdlist);
-  add_alias_cmd ("start", "begin", class_obscure, 1, &record_goto_cmdlist);
+  cmd_list_element *record_goto_begin_cmd
+    = add_cmd ("begin", class_obscure, cmd_record_goto_begin,
+              _("Go to the beginning of the execution log."),
+              &record_goto_cmdlist);
+  add_alias_cmd ("start", record_goto_begin_cmd, class_obscure, 1,
+                &record_goto_cmdlist);
 
   add_cmd ("end", class_obscure, cmd_record_goto_end,
           _("Go to the end of the execution log."),