GDB (xrefs)

Macros | Functions | Variables
/tmp/gdb-8.1/gdb/record.c File Reference
`#include "defs.h"`
`#include "gdbcmd.h"`
`#include "completer.h"`
`#include "record.h"`
`#include "observer.h"`
`#include "inferior.h"`
`#include "common/common-utils.h"`
`#include "cli/cli-utils.h"`
`#include "disasm.h"`
`#include <ctype.h>`

Go to the source code of this file.

## Macros
#define | DEBUG(msg, args...)

## Functions
struct target_ops * | find_record_target (void)
static struct target_ops * | require_record_target (void)
void | record_preopen (void)
void | record_start (const char *method, const char *format, int from_tty)
void | record_stop (int from_tty)
int | record_read_memory (struct gdbarch *gdbarch, CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
static void | record_stop (struct target_ops *t)
static void | record_unpush (struct target_ops *t)
void | record_disconnect (struct target_ops *t, const char *args, int from_tty)
void | record_detach (struct target_ops *t, const char *args, int from_tty)
void | record_mourn_inferior (struct target_ops *t)
void | record_kill (struct target_ops *t)
int | record_check_stopped_by_breakpoint (const address_space *aspace, CORE_ADDR pc, enum target_stop_reason *reason)
static void | show_record_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void | cmd_record_start (const char *args, int from_tty)
static void | cmd_record_delete (const char *args, int from_tty)
static void | cmd_record_stop (const char *args, int from_tty)
static void | set_record_command (const char *args, int from_tty)
static void | show_record_command (const char *args, int from_tty)
static void | info_record_command (const char *args, int from_tty)
static void | cmd_record_save (const char *args, int from_tty)
void | record_goto (const char *arg)
static void | cmd_record_goto (const char *arg, int from_tty)
static void | cmd_record_goto_begin (const char *arg, int from_tty)
static void | cmd_record_goto_end (const char *arg, int from_tty)
static ULONGEST | get_insn_number (const char **arg)
static int | get_context_size (const char **arg)
static void | no_chunk (const char *arg)
static gdb_disassembly_flags | get_insn_history_modifiers (const char **arg)
static int | command_size_to_target_size (unsigned int size)
static void | cmd_record_insn_history (const char *arg, int from_tty)
static int | get_call_history_modifiers (const char **arg)
static void | cmd_record_call_history (const char *arg, int from_tty)
static void | validate_history_size (unsigned int *command_var, unsigned int *setting)
static void | set_record_insn_history_size (const char *args, int from_tty, struct cmd_list_element *c)
static void | set_record_call_history_size (const char *args, int from_tty, struct cmd_list_element *c)
void | _initialize_record (void)

## Variables
unsigned int | record_debug = 0
static unsigned int | record_insn_history_size = 10
static unsigned int | record_insn_history_size_setshow_var
static unsigned int | record_call_history_size = 10
static unsigned int | record_call_history_size_setshow_var
struct cmd_list_element * | record_cmdlist = NULL
struct cmd_list_element * | record_goto_cmdlist = NULL
struct cmd_list_element * | set_record_cmdlist = NULL
struct cmd_list_element * | show_record_cmdlist = NULL
struct cmd_list_element * | info_record_cmdlist = NULL

## Macro Definition Documentation

## ◆ DEBUG

#define DEBUG | ( |  | msg,
|  |  | args...
| ) |  |

Value:
if (record_debug) \
fprintf_unfiltered (gdb_stdlog, "record: " msg "\n", ##args)
record_debug
unsigned int record_debug
Definition: record.c:33
gdb_stdlog
#define gdb_stdlog
Definition: utils.h:349

Definition at line 56 of file record.c.

Referenced by record_detach(), record_disconnect(), record_kill(), record_mourn_inferior(), record_read_memory(), record_stop(), and record_unpush().

## Function Documentation

## ◆ _initialize_record()

void _initialize_record | ( | void |  | ) |

Definition at line 781 of file record.c.

References _, add_alias_cmd(), add_cmd(), add_com_alias(), add_prefix_cmd(), add_setshow_uinteger_cmd(), add_setshow_zuinteger_cmd(), class_obscure, class_support, cmd_record_call_history(), cmd_record_delete(), cmd_record_goto(), cmd_record_goto_begin(), cmd_record_goto_end(), cmd_record_insn_history(), cmd_record_save(), cmd_record_start(), cmd_record_stop(), cmdlist, filename_completer(), info_record_cmdlist, info_record_command(), infolist, no_class, record_call_history_size, record_call_history_size_setshow_var, record_cmdlist, record_debug, record_goto_cmdlist, record_insn_history_size, record_insn_history_size_setshow_var, set_cmd_completer(), set_record_call_history_size(), set_record_cmdlist, set_record_command(), set_record_insn_history_size(), setdebuglist, setlist, show_record_cmdlist, show_record_command(), show_record_debug(), showdebuglist, and showlist.

## ◆ cmd_record_call_history()

static void cmd_record_call_history | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 673 of file record.c.

References command_size_to_target_size(), dont_repeat(), flags, get_call_history_modifiers(), get_context_size(), get_insn_number(), no_chunk(), record_call_history_size, require_record_target(), size, skip_spaces(), target_call_history(), target_call_history_from(), and target_call_history_range().

Referenced by _initialize_record().

## ◆ cmd_record_delete()

static void cmd_record_delete | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 276 of file record.c.

References _, inferior_ptid, printf_unfiltered(), query(), require_record_target(), target_delete_record(), target_record_is_replaying(), and target_supports_delete_record().

Referenced by _initialize_record().

## ◆ cmd_record_goto()

static void cmd_record_goto | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 398 of file record.c.

References record_goto().

Referenced by _initialize_record().

## ◆ cmd_record_goto_begin()

static void cmd_record_goto_begin | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 406 of file record.c.

References _, error(), require_record_target(), and target_goto_record_begin().

Referenced by _initialize_record().

## ◆ cmd_record_goto_end()

static void cmd_record_goto_end | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 418 of file record.c.

References _, error(), require_record_target(), and target_goto_record_end().

Referenced by _initialize_record().

## ◆ cmd_record_insn_history()

static void cmd_record_insn_history | ( | const char * | arg,
|  | int | from_tty
| ) |  |
| static

Definition at line 556 of file record.c.

References command_size_to_target_size(), dont_repeat(), flags, get_context_size(), get_insn_history_modifiers(), get_insn_number(), no_chunk(), record_insn_history_size, require_record_target(), size, skip_spaces(), target_insn_history(), target_insn_history_from(), and target_insn_history_range().

Referenced by _initialize_record().

## ◆ cmd_record_save()

static void cmd_record_save | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 356 of file record.c.

References inferior_ptid, ptid_get_pid(), require_record_target(), target_save_record(), and xsnprintf().

Referenced by _initialize_record().

## ◆ cmd_record_start()

static void cmd_record_start | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 267 of file record.c.

References execute_command().

Referenced by _initialize_record().

## ◆ cmd_record_stop()

static void cmd_record_stop | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 302 of file record.c.

References _, current_inferior(), observer_notify_record_changed(), printf_unfiltered(), record_stop(), record_unpush(), and require_record_target().

Referenced by _initialize_record().

## ◆ command_size_to_target_size()

static int command_size_to_target_size | ( | unsigned int | size | ) |
| static

Definition at line 543 of file record.c.

References gdb_assert, INT_MAX, size, and UINT_MAX.

Referenced by cmd_record_call_history(), and cmd_record_insn_history().

## ◆ find_record_target()

struct target_ops* find_record_target | ( | void |  | ) |

Definition at line 63 of file record.c.

References find_target_at(), and record_stratum.

Referenced by gdbpy_current_recording(), info_record_command(), record_full_is_used(), record_preopen(), require_record_target(), and use_displaced_stepping().

## ◆ get_call_history_modifiers()

static int get_call_history_modifiers | ( | const char ** | arg | ) |
| static

Definition at line 619 of file record.c.

References _, error(), RECORD_PRINT_INDENT_CALLS, RECORD_PRINT_INSN_RANGE, RECORD_PRINT_SRC_LINE, and skip_spaces().

Referenced by cmd_record_call_history().

## ◆ get_context_size()

static int get_context_size | ( | const char ** | arg | ) |
| static

Definition at line 451 of file record.c.

References _, error(), and skip_spaces().

Referenced by cmd_record_call_history(), and cmd_record_insn_history().

## ◆ get_insn_history_modifiers()

static gdb_disassembly_flags get_insn_history_modifiers | ( | const char ** | arg | ) |
| static

Definition at line 478 of file record.c.

References _, DISASSEMBLY_FILENAME, DISASSEMBLY_OMIT_FNAME, DISASSEMBLY_OMIT_PC, DISASSEMBLY_RAW_INSN, DISASSEMBLY_SOURCE, error(), and skip_spaces().

Referenced by cmd_record_insn_history().

## ◆ get_insn_number()

static ULONGEST get_insn_number | ( | const char ** | arg | ) |
| static

Definition at line 430 of file record.c.

References _, error(), skip_spaces(), and strtoulst().

Referenced by cmd_record_call_history(), and cmd_record_insn_history().

## ◆ info_record_command()

static void info_record_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 338 of file record.c.

References _, find_record_target(), printf_filtered(), target_ops::to_info_record, and target_ops::to_shortname.

Referenced by _initialize_record().

## ◆ no_chunk()

static void no_chunk | ( | const char * | arg | ) |
| static

Definition at line 469 of file record.c.

References _, and error().

Referenced by cmd_record_call_history(), and cmd_record_insn_history().

## ◆ record_check_stopped_by_breakpoint()

int record_check_stopped_by_breakpoint | ( | const address_space * | aspace,
|  | CORE_ADDR | pc,
|  | enum target_stop_reason * | reason
| ) |  |

Definition at line 237 of file record.c.

References breakpoint_inserted_here_p(), hardware_breakpoint_inserted_here_p(), TARGET_STOPPED_BY_HW_BREAKPOINT, TARGET_STOPPED_BY_NO_REASON, and TARGET_STOPPED_BY_SW_BREAKPOINT.

Referenced by record_btrace_replay_at_breakpoint(), and record_full_wait_1().

## ◆ record_detach()

void record_detach | ( | struct target_ops * | t,
|  | const char * | args,
|  | int | from_tty
| ) |  |

Definition at line 190 of file record.c.

References DEBUG, gdb_assert, record_stop(), record_stratum, record_unpush(), target_detach(), target_ops::to_shortname, and target_ops::to_stratum.

Referenced by init_record_btrace_ops(), and init_record_full_ops().

## ◆ record_disconnect()

void record_disconnect | ( | struct target_ops * | t,
|  | const char * | args,
|  | int | from_tty
| ) |  |

Definition at line 175 of file record.c.

References DEBUG, gdb_assert, record_stop(), record_stratum, record_unpush(), target_disconnect(), target_ops::to_shortname, and target_ops::to_stratum.

Referenced by init_record_full_ops().

## ◆ record_goto()

void record_goto | ( | const char * | arg | ) |

Definition at line 379 of file record.c.

References _, error(), parse_and_eval_long(), require_record_target(), and target_goto_record().

Referenced by cmd_record_goto(), and record_full_goto_bookmark().

## ◆ record_kill()

void record_kill | ( | struct target_ops * | t | ) |

Definition at line 221 of file record.c.

References DEBUG, gdb_assert, record_stratum, record_unpush(), target_kill(), target_ops::to_shortname, and target_ops::to_stratum.

Referenced by init_record_btrace_ops(), and init_record_full_ops().

## ◆ record_mourn_inferior()

void record_mourn_inferior | ( | struct target_ops * | t | ) |

Definition at line 205 of file record.c.

References DEBUG, gdb_assert, inferior_ptid, record_stratum, record_unpush(), target_mourn_inferior(), target_ops::to_shortname, and target_ops::to_stratum.

Referenced by init_record_btrace_ops(), and init_record_full_ops().

## ◆ record_preopen()

void record_preopen | ( | void |  | ) |

Definition at line 86 of file record.c.

References _, error(), and find_record_target().

Referenced by record_btrace_open(), and record_full_open().

## ◆ record_read_memory()

int record_read_memory | ( | struct gdbarch * | gdbarch,
|  | CORE_ADDR | memaddr,
|  | gdb_byte * | myaddr,
|  | ssize_t | len
| ) |  |

Definition at line 139 of file record.c.

References DEBUG, paddress(), and target_read_memory().

Referenced by i386_process_record(), i386_record_lea_modrm_addr(), i386_record_modrm(), record_full_arch_list_add_mem(), and record_full_exec_insn().

## ◆ record_start()

void record_start | ( | const char * | method,
|  | const char * | format,
|  | int | from_tty
| ) |  |

Definition at line 97 of file record.c.

References _, error(), and execute_command_to_string().

Referenced by gdbpy_start_recording().

## ◆ record_stop() [1/2]

void record_stop | ( | int | from_tty | ) |

Definition at line 131 of file record.c.

References execute_command_to_string().

Referenced by cmd_record_stop(), gdbpy_stop_recording(), record_detach(), and record_disconnect().

## ◆ record_stop() [2/2]

static void record_stop | ( | struct target_ops * | t | ) |
| static

Definition at line 155 of file record.c.

References DEBUG, target_ops::to_shortname, and target_ops::to_stop_recording.

## ◆ record_unpush()

static void record_unpush | ( | struct target_ops * | t | ) |
| static

Definition at line 165 of file record.c.

References DEBUG, target_ops::to_shortname, and unpush_target().

Referenced by cmd_record_stop(), record_detach(), record_disconnect(), record_kill(), and record_mourn_inferior().

## ◆ require_record_target()

static struct target_ops* require_record_target | ( | void |  | ) |
| static

Definition at line 71 of file record.c.

References _, error(), and find_record_target().

Referenced by cmd_record_call_history(), cmd_record_delete(), cmd_record_goto_begin(), cmd_record_goto_end(), cmd_record_insn_history(), cmd_record_save(), cmd_record_stop(), and record_goto().

## ◆ set_record_call_history_size()

static void set_record_call_history_size | ( | const char * | args,
|  | int | from_tty,
|  | struct cmd_list_element * | c
| ) |  |
| static

Definition at line 773 of file record.c.

References record_call_history_size, record_call_history_size_setshow_var, and validate_history_size().

Referenced by _initialize_record().

## ◆ set_record_command()

static void set_record_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 320 of file record.c.

References _, all_commands, gdb_stdout, help_list(), printf_unfiltered(), and set_record_cmdlist.

Referenced by _initialize_record().

## ◆ set_record_insn_history_size()

static void set_record_insn_history_size | ( | const char * | args,
|  | int | from_tty,
|  | struct cmd_list_element * | c
| ) |  |
| static

Definition at line 761 of file record.c.

References record_insn_history_size, record_insn_history_size_setshow_var, and validate_history_size().

Referenced by _initialize_record().

## ◆ show_record_command()

static void show_record_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 330 of file record.c.

References cmd_show_list(), and show_record_cmdlist.

Referenced by _initialize_record().

## ◆ show_record_debug()

static void show_record_debug | ( | struct ui_file * | file,
|  | int | from_tty,
|  | struct cmd_list_element * | c,
|  | const char * | value
| ) |  |
| static

Definition at line 257 of file record.c.

References _, and fprintf_filtered().

Referenced by _initialize_record().

## ◆ validate_history_size()

static void validate_history_size | ( | unsigned int * | command_var,
|  | unsigned int * | setting
| ) |  |
| static

Definition at line 741 of file record.c.

References _, error(), INT_MAX, and UINT_MAX.

Referenced by set_record_call_history_size(), and set_record_insn_history_size().

## Variable Documentation

## ◆ info_record_cmdlist

struct cmd_list_element* info_record_cmdlist = NULL

Definition at line 54 of file record.c.

Referenced by _initialize_record().

## ◆ record_call_history_size

unsigned int record_call_history_size = 10
| static

Definition at line 44 of file record.c.

Referenced by _initialize_record(), cmd_record_call_history(), and set_record_call_history_size().

## ◆ record_call_history_size_setshow_var

unsigned int record_call_history_size_setshow_var
| static

Definition at line 48 of file record.c.

Referenced by _initialize_record(), and set_record_call_history_size().

## ◆ record_cmdlist

struct cmd_list_element* record_cmdlist = NULL

Definition at line 50 of file record.c.

Referenced by _initialize_record(), _initialize_record_btrace(), and _initialize_record_full().

## ◆ record_debug

unsigned int record_debug = 0

Definition at line 33 of file record.c.

Referenced by _initialize_record(), aarch64_record_asimd_load_store(), aarch64_record_data_proc_simd_fp(), aarch64_record_load_store(), arm_process_record(), decode_insn(), ftrace_update_insns(), i386_process_record(), moxie_process_readu(), moxie_process_record(), record_full_arch_list_add(), record_full_arch_list_add_end(), record_full_arch_list_add_mem(), record_full_arch_list_add_reg(), record_full_close(), record_full_core_kill(), record_full_exec_insn(), record_full_get_bookmark(), record_full_goto_bookmark(), record_full_open(), record_full_open_1(), record_full_restore(), record_full_save(), record_full_sig_handler(), record_full_wait_1(), record_full_xfer_partial(), record_linux_msghdr(), record_linux_sockaddr(), and record_linux_system_call().

## ◆ record_goto_cmdlist

struct cmd_list_element* record_goto_cmdlist = NULL

Definition at line 51 of file record.c.

Referenced by _initialize_record().

## ◆ record_insn_history_size

unsigned int record_insn_history_size = 10
| static

Definition at line 36 of file record.c.

Referenced by _initialize_record(), cmd_record_insn_history(), and set_record_insn_history_size().

## ◆ record_insn_history_size_setshow_var

unsigned int record_insn_history_size_setshow_var
| static

Definition at line 41 of file record.c.

Referenced by _initialize_record(), and set_record_insn_history_size().

## ◆ set_record_cmdlist

struct cmd_list_element* set_record_cmdlist = NULL

Definition at line 52 of file record.c.

Referenced by _initialize_record(), _initialize_record_btrace(), _initialize_record_full(), and set_record_command().

## ◆ show_record_cmdlist

struct cmd_list_element* show_record_cmdlist = NULL

Definition at line 53 of file record.c.

Referenced by _initialize_record(), _initialize_record_btrace(), _initialize_record_full(), and show_record_command().