GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
record-full.c File Reference
#include "defs.h"
#include "gdbcmd.h"
#include "regcache.h"
#include "gdbthread.h"
#include "inferior.h"
#include "event-top.h"
#include "completer.h"
#include "arch-utils.h"
#include "gdbcore.h"
#include "exec.h"
#include "record.h"
#include "record-full.h"
#include "elf-bfd.h"
#include "gcore.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 "valprint.h"
#include "interps.h"
#include <signal.h>

Go to the source code of this file.

Classes

struct  record_full_mem_entry
 
struct  record_full_reg_entry
 
struct  record_full_end_entry
 
struct  record_full_entry
 
struct  record_full_core_buf_entry
 
class  record_full_base_target
 
class  record_full_target
 
class  record_full_core_target
 
struct  record_full_breakpoint
 

Macros

#define DEFAULT_RECORD_FULL_INSN_MAX_NUM   200000
 
#define RECORD_FULL_IS_REPLAY    (record_full_list->next || ::execution_direction == EXEC_REVERSE)
 
#define RECORD_FULL_FILE_MAGIC   netorder32(0x20091016)
 

Enumerations

enum  record_full_type { record_full_end = 0 , record_full_reg , record_full_mem }
 

Functions

int record_full_is_used (void)
 
static void record_full_goto_insn (struct record_full_entry *entry, enum exec_direction_kind dir)
 
static struct record_full_entryrecord_full_reg_alloc (struct regcache *regcache, int regnum)
 
static void record_full_reg_release (struct record_full_entry *rec)
 
static struct record_full_entryrecord_full_mem_alloc (CORE_ADDR addr, int len)
 
static void record_full_mem_release (struct record_full_entry *rec)
 
static struct record_full_entryrecord_full_end_alloc (void)
 
static void record_full_end_release (struct record_full_entry *rec)
 
static enum record_full_type record_full_entry_release (struct record_full_entry *rec)
 
static void record_full_list_release (struct record_full_entry *rec)
 
static void record_full_list_release_following (struct record_full_entry *rec)
 
static void record_full_list_release_first (void)
 
static void record_full_arch_list_add (struct record_full_entry *rec)
 
static gdb_byte * record_full_get_loc (struct record_full_entry *rec)
 
int record_full_arch_list_add_reg (struct regcache *regcache, int regnum)
 
int record_full_arch_list_add_mem (CORE_ADDR addr, int len)
 
int record_full_arch_list_add_end (void)
 
static void record_full_check_insn_num (void)
 
static void record_full_message (struct regcache *regcache, enum gdb_signal signal)
 
static bool record_full_message_wrapper_safe (struct regcache *regcache, enum gdb_signal signal)
 
scoped_restore_tmpl< int > record_full_gdb_operation_disable_set (void)
 
static void record_full_exec_insn (struct regcache *regcache, struct gdbarch *gdbarch, struct record_full_entry *entry)
 
static void record_full_restore (void)
 
static void record_full_async_inferior_event_handler (gdb_client_data data)
 
static void record_full_core_open_1 (const char *name, int from_tty)
 
static void record_full_open_1 (const char *name, int from_tty)
 
static void record_full_init_record_breakpoints (void)
 
static void record_full_open (const char *name, int from_tty)
 
static void record_full_sig_handler (int signo)
 
static ptid_t record_full_wait_1 (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, target_wait_flags options)
 
static void record_full_registers_change (struct regcache *regcache, int regnum)
 
static void record_full_goto_entry (struct record_full_entry *p)
 
static void bfdcore_read (bfd *obfd, asection *osec, void *buf, int len, int *offset)
 
static uint64_t netorder64 (uint64_t input)
 
static uint32_t netorder32 (uint32_t input)
 
static void bfdcore_write (bfd *obfd, asection *osec, void *buf, int len, int *offset)
 
static void cmd_record_full_restore (const char *args, int from_tty)
 
static void cmd_record_full_start (const char *args, int from_tty)
 
static void set_record_full_insn_max_num (const char *args, int from_tty, struct cmd_list_element *c)
 
static void maintenance_print_record_instruction (const char *args, int from_tty)
 
void _initialize_record_full ()
 

Variables

bool record_full_memory_query = false
 
static detached_regcacherecord_full_core_regbuf = NULL
 
static target_section_table record_full_core_sections
 
static struct record_full_core_buf_entryrecord_full_core_buf_list = NULL
 
static struct record_full_entry record_full_first
 
static struct record_full_entryrecord_full_list = &record_full_first
 
static struct record_full_entryrecord_full_arch_list_head = NULL
 
static struct record_full_entryrecord_full_arch_list_tail = NULL
 
static bool record_full_stop_at_limit = true
 
static unsigned int record_full_insn_max_num = DEFAULT_RECORD_FULL_INSN_MAX_NUM
 
static unsigned int record_full_insn_num = 0
 
static ULONGEST record_full_insn_count
 
static const char record_longname [] = N_("Process record and replay target")
 
static const char record_doc [] = N_("Log program while executing and replay execution from log.")
 
static const target_info record_full_target_info
 
static const target_info record_full_core_target_info
 
static record_full_target record_full_ops
 
static record_full_core_target record_full_core_ops
 
static struct cmd_list_elementset_record_full_cmdlist
 
static struct cmd_list_elementshow_record_full_cmdlist
 
static struct cmd_list_elementrecord_full_cmdlist
 
static int record_full_gdb_operation_disable = 0
 
static enum target_stop_reason record_full_stop_reason = TARGET_STOPPED_BY_NO_REASON
 
static struct async_event_handlerrecord_full_async_inferior_event_token
 
static ptid_t record_full_resume_ptid = null_ptid
 
static int record_full_resume_step = 0
 
static int record_full_resumed = 0
 
static enum exec_direction_kind record_full_execution_dir = EXEC_FORWARD
 
static int record_full_get_sig = 0
 
static std::vector< record_full_breakpointrecord_full_breakpoints
 

Macro Definition Documentation

◆ DEFAULT_RECORD_FULL_INSN_MAX_NUM

#define DEFAULT_RECORD_FULL_INSN_MAX_NUM   200000

Definition at line 67 of file record-full.c.

◆ RECORD_FULL_FILE_MAGIC

#define RECORD_FULL_FILE_MAGIC   netorder32(0x20091016)

Definition at line 72 of file record-full.c.

Referenced by record_full_restore(), and record_full_base_target::save_record().

◆ RECORD_FULL_IS_REPLAY

#define RECORD_FULL_IS_REPLAY    (record_full_list->next || ::execution_direction == EXEC_REVERSE)

Enumeration Type Documentation

◆ record_full_type

Enumerator
record_full_end 
record_full_reg 
record_full_mem 

Definition at line 116 of file record-full.c.

Function Documentation

◆ _initialize_record_full()

void _initialize_record_full ( )

Definition at line 2862 of file record-full.c.

Referenced by initialize_all_files().

◆ bfdcore_read()

static void bfdcore_read ( bfd * obfd,
asection * osec,
void * buf,
int len,
int * offset )
inlinestatic

Definition at line 2284 of file record-full.c.

References record_full_core_buf_entry::buf.

Referenced by record_full_restore().

◆ bfdcore_write()

static void bfdcore_write ( bfd * obfd,
asection * osec,
void * buf,
int len,
int * offset )
inlinestatic

Definition at line 2498 of file record-full.c.

Referenced by record_full_base_target::save_record().

◆ cmd_record_full_restore()

static void cmd_record_full_restore ( const char * args,
int from_tty )
static

Definition at line 2514 of file record-full.c.

References core_file_command(), and record_full_open().

◆ cmd_record_full_start()

static void cmd_record_full_start ( const char * args,
int from_tty )
static

Definition at line 2756 of file record-full.c.

References execute_command().

◆ maintenance_print_record_instruction()

static void maintenance_print_record_instruction ( const char * args,
int from_tty )
static

◆ netorder32()

static uint32_t netorder32 ( uint32_t input)
inlinestatic

◆ netorder64()

static uint64_t netorder64 ( uint64_t input)
inlinestatic

◆ record_full_arch_list_add()

static void record_full_arch_list_add ( struct record_full_entry * rec)
static

◆ record_full_arch_list_add_end()

int record_full_arch_list_add_end ( void )

◆ record_full_arch_list_add_mem()

int record_full_arch_list_add_mem ( CORE_ADDR addr,
int len )

◆ record_full_arch_list_add_reg()

int record_full_arch_list_add_reg ( struct regcache * regcache,
int regnum )

◆ record_full_async_inferior_event_handler()

static void record_full_async_inferior_event_handler ( gdb_client_data data)
static

Definition at line 906 of file record-full.c.

References INF_REG_EVENT, and inferior_event_handler().

Referenced by record_full_open().

◆ record_full_check_insn_num()

static void record_full_check_insn_num ( void )
static

◆ record_full_core_open_1()

static void record_full_core_open_1 ( const char * name,
int from_tty )
static

◆ record_full_end_alloc()

static struct record_full_entry * record_full_end_alloc ( void )
inlinestatic

Definition at line 445 of file record-full.c.

References record_full_end, and record_full_entry::type.

Referenced by record_full_arch_list_add_end(), and record_full_restore().

◆ record_full_end_release()

static void record_full_end_release ( struct record_full_entry * rec)
inlinestatic

Definition at line 458 of file record-full.c.

References xfree().

Referenced by record_full_entry_release().

◆ record_full_entry_release()

static enum record_full_type record_full_entry_release ( struct record_full_entry * rec)
inlinestatic

◆ record_full_exec_insn()

static void record_full_exec_insn ( struct regcache * regcache,
struct gdbarch * gdbarch,
struct record_full_entry * entry )
inlinestatic

◆ record_full_gdb_operation_disable_set()

scoped_restore_tmpl< int > record_full_gdb_operation_disable_set ( void )

◆ record_full_get_loc()

static gdb_byte * record_full_get_loc ( struct record_full_entry * rec)
inlinestatic

◆ record_full_goto_entry()

static void record_full_goto_entry ( struct record_full_entry * p)
static

◆ record_full_goto_insn()

static void record_full_goto_insn ( struct record_full_entry * entry,
enum exec_direction_kind dir )
static

◆ record_full_init_record_breakpoints()

static void record_full_init_record_breakpoints ( void )
static

Definition at line 1733 of file record-full.c.

References all_bp_locations(), bp_loc_software_breakpoint, loc, and record_full_breakpoints.

Referenced by record_full_open().

◆ record_full_is_used()

int record_full_is_used ( void )

◆ record_full_list_release()

static void record_full_list_release ( struct record_full_entry * rec)
static

◆ record_full_list_release_first()

static void record_full_list_release_first ( void )
static

◆ record_full_list_release_following()

static void record_full_list_release_following ( struct record_full_entry * rec)
static

◆ record_full_mem_alloc()

static struct record_full_entry * record_full_mem_alloc ( CORE_ADDR addr,
int len )
inlinestatic

◆ record_full_mem_release()

static void record_full_mem_release ( struct record_full_entry * rec)
inlinestatic

◆ record_full_message()

static void record_full_message ( struct regcache * regcache,
enum gdb_signal signal )
static

◆ record_full_message_wrapper_safe()

static bool record_full_message_wrapper_safe ( struct regcache * regcache,
enum gdb_signal signal )
static

Definition at line 782 of file record-full.c.

References exception_print(), gdb_stderr, and record_full_message().

Referenced by record_full_wait_1().

◆ record_full_open()

static void record_full_open ( const char * name,
int from_tty )
static

◆ record_full_open_1()

static void record_full_open_1 ( const char * name,
int from_tty )
static

◆ record_full_reg_alloc()

static struct record_full_entry * record_full_reg_alloc ( struct regcache * regcache,
int regnum )
inlinestatic

◆ record_full_reg_release()

static void record_full_reg_release ( struct record_full_entry * rec)
inlinestatic

◆ record_full_registers_change()

static void record_full_registers_change ( struct regcache * regcache,
int regnum )
static

◆ record_full_restore()

static void record_full_restore ( void )
static

◆ record_full_sig_handler()

static void record_full_sig_handler ( int signo)
static

◆ record_full_wait_1()

static ptid_t record_full_wait_1 ( struct target_ops * ops,
ptid_t ptid,
struct target_waitstatus * status,
target_wait_flags options )
static

Definition at line 1141 of file record-full.c.

References all_non_exited_threads(), reg_buffer::arch(), regcache::aspace(), target_ops::beneath(), target_ops::commit_resumed(), process_stratum_target::commit_resumed_state, current_inferior(), delete_single_step_breakpoints(), record_full_entry::end, EXEC_FORWARD, EXEC_REVERSE, execution_direction, gdb_printf(), gdb_stdlog, gdbarch_software_single_step_p(), get_current_regcache(), handle_sigint(), inferior_ptid, insert_single_step_breakpoints(), record_full_entry::next, target_terminal::ours(), paddress(), record_full_entry::prev, inferior::process_target(), record_check_stopped_by_breakpoint(), record_debug, record_full_core_ops, record_full_end, record_full_exec_insn(), record_full_execution_dir, record_full_first, record_full_gdb_operation_disable_set(), record_full_get_sig, RECORD_FULL_IS_REPLAY, record_full_list, record_full_message_wrapper_safe(), record_full_resume_ptid, record_full_resume_step, record_full_resumed, record_full_sig_handler(), record_full_stop_reason, reg_buffer::regcache, regcache_read_pc(), registers_changed(), reinit_frame_cache(), target_ops::resume(), set_executing(), record_full_end_entry::sigval, status, switch_to_thread(), TARGET_STOPPED_BY_NO_REASON, target_stopped_by_watchpoint(), TARGET_STOPPED_BY_WATCHPOINT, target_thread_architecture(), TARGET_WAITKIND_IGNORE, TARGET_WAITKIND_STOPPED, TARGET_WNOHANG, record_full_entry::type, record_full_entry::u, and target_ops::wait().

Referenced by record_full_base_target::wait().

◆ set_record_full_insn_max_num()

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

Variable Documentation

◆ record_doc

const char record_doc[] = N_("Log program while executing and replay execution from log.")
static

Definition at line 214 of file record-full.c.

◆ record_full_arch_list_head

struct record_full_entry* record_full_arch_list_head = NULL
static

◆ record_full_arch_list_tail

struct record_full_entry* record_full_arch_list_tail = NULL
static

◆ record_full_async_inferior_event_token

struct async_event_handler* record_full_async_inferior_event_token
static

◆ record_full_breakpoints

std::vector<record_full_breakpoint> record_full_breakpoints
static

◆ record_full_cmdlist

struct cmd_list_element* record_full_cmdlist
static

Definition at line 377 of file record-full.c.

◆ record_full_core_buf_list

struct record_full_core_buf_entry* record_full_core_buf_list = NULL
static

◆ record_full_core_ops

record_full_core_target record_full_core_ops
static

Definition at line 327 of file record-full.c.

Referenced by record_full_core_open_1(), record_full_is_used(), and record_full_wait_1().

◆ record_full_core_regbuf

detached_regcache* record_full_core_regbuf = NULL
static

◆ record_full_core_sections

target_section_table record_full_core_sections
static

◆ record_full_core_target_info

const target_info record_full_core_target_info
static
Initial value:
= {
"record-core",
}
static const char record_doc[]
static const char record_longname[]

Definition at line 293 of file record-full.c.

Referenced by record_full_core_target::info().

◆ record_full_execution_dir

enum exec_direction_kind record_full_execution_dir = EXEC_FORWARD
static

◆ record_full_first

struct record_full_entry record_full_first
static

◆ record_full_gdb_operation_disable

int record_full_gdb_operation_disable = 0
static

◆ record_full_get_sig

int record_full_get_sig = 0
static

Definition at line 1109 of file record-full.c.

Referenced by record_full_sig_handler(), and record_full_wait_1().

◆ record_full_insn_count

ULONGEST record_full_insn_count
static

◆ record_full_insn_max_num

unsigned int record_full_insn_max_num = DEFAULT_RECORD_FULL_INSN_MAX_NUM
static

◆ record_full_insn_num

unsigned int record_full_insn_num = 0
static

◆ record_full_list

struct record_full_entry* record_full_list = &record_full_first
static

◆ record_full_memory_query

bool record_full_memory_query = false

◆ record_full_ops

record_full_target record_full_ops
static

Definition at line 326 of file record-full.c.

Referenced by record_full_is_used(), and record_full_open_1().

◆ record_full_resume_ptid

ptid_t record_full_resume_ptid = null_ptid
static

Definition at line 1034 of file record-full.c.

Referenced by record_full_wait_1(), and record_full_target::resume().

◆ record_full_resume_step

int record_full_resume_step = 0
static

◆ record_full_resumed

int record_full_resumed = 0
static

◆ record_full_stop_at_limit

bool record_full_stop_at_limit = true
static

Definition at line 202 of file record-full.c.

Referenced by record_full_check_insn_num().

◆ record_full_stop_reason

enum target_stop_reason record_full_stop_reason = TARGET_STOPPED_BY_NO_REASON
static

◆ record_full_target_info

const target_info record_full_target_info
static
Initial value:
= {
"record-full",
}

Definition at line 260 of file record-full.c.

Referenced by record_full_target::info().

◆ record_longname

const char record_longname[] = N_("Process record and replay target")
static

Definition at line 212 of file record-full.c.

◆ set_record_full_cmdlist

struct cmd_list_element* set_record_full_cmdlist
static

Definition at line 373 of file record-full.c.

◆ show_record_full_cmdlist

struct cmd_list_element* show_record_full_cmdlist
static

Definition at line 374 of file record-full.c.