/* 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.
#include "gdbsupport/common-utils.h"
#include "cli/cli-utils.h"
#include "disasm.h"
+#include "interps.h"
#include <ctype.h>
#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. */
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". */
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;
}
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);
+ interps_notify_record_changed (current_inferior (), 0, NULL, NULL);
}
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 ();
}
case 'r':
modifiers |= DISASSEMBLY_RAW_INSN;
break;
+ case 'b':
+ modifiers |= DISASSEMBLY_RAW_BYTES;
+ break;
case 'f':
modifiers |= DISASSEMBLY_OMIT_FNAME;
break;
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, "record ", 0, &cmdlist);
- set_cmd_completer (c, filename_completer);
+ &record_cmdlist, 0, &cmdlist);
+ 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,
- "set record ", 0, &setlist);
- add_alias_cmd ("rec", "record", class_obscure, 1, &setlist);
- add_show_prefix_cmd ("record", class_support,
- _("Show record options."), &show_record_cmdlist,
- "show record ", 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,
- "info record ", 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\
&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, "record goto ", 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);
+ &record_goto_cmdlist, 1, &record_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."),