33 #include "filenames.h"
90 #define DEBUG(msg, args...) \
93 if (record_debug != 0) \
94 fprintf_unfiltered (gdb_stdlog, \
95 "[record-btrace] " msg "\n", ##args); \
174 DEBUG (
"attach thread observer");
176 record_btrace_thread_observer
186 if (record_btrace_thread_observer == NULL)
189 DEBUG (
"detach thread observer");
192 record_btrace_thread_observer = NULL;
216 error (
_(
"The program is not being run."));
219 error (
_(
"Record btrace can't debug inferior in non-stop mode."));
221 gdb_assert (record_btrace_thread_observer == NULL);
236 record_btrace_async_inferior_event_handler
253 DEBUG (
"stop recording");
269 if (record_btrace_async_inferior_event_handler != NULL)
304 if ((sz & ((1u << 30) - 1)) == 0)
309 else if ((sz & ((1u << 20) - 1)) == 0)
314 else if ((sz & ((1u << 10) - 1)) == 0)
388 unsigned int insns, calls, gaps;
441 gaps = btinfo->
ngaps;
445 "for thread %d (%s).\n"), insns, calls, gaps,
462 errstr =
_(
"unknown");
477 errstr =
_(
"instruction overflow");
481 errstr =
_(
"unknown instruction");
486 #if defined (HAVE_LIBIPT)
492 errstr =
_(
"trace decode cancelled");
497 errstr =
_(
"disabled");
502 errstr =
_(
"overflow");
507 errstr = pt_errstr (pt_errcode (errcode));
592 unsigned int context, covered;
597 context = abs (size);
599 error (
_(
"Bad record instruction-history-size."));
607 DEBUG (
"insn-history (0x%x): %d", flags, size);
636 begin = history->
begin;
639 DEBUG (
"insn-history (0x%x): %d, prev: [%u; %u)", flags, size,
679 unsigned int low, high;
688 DEBUG (
"insn-history (0x%x): [%u; %u)", flags, low, high);
691 if (low != from || high != to)
701 error (
_(
"Range out of bounds."));
729 context = abs (size);
731 error (
_(
"Bad record instruction-history-size."));
740 begin = from - context + 1;
745 end = from + context - 1;
761 unsigned int begin, end,
size;
767 end = begin + size - 1;
781 int *pbegin,
int *pend)
803 if (sal.symtab != symtab || sal.line == 0)
806 begin =
min (begin, sal.line);
807 end =
max (end, sal.line);
861 else if (msym != NULL)
914 for (i = 0; i < level; ++i)
920 else if (msym != NULL)
951 unsigned int context, covered;
956 context = abs (size);
958 error (
_(
"Bad record function-call-history-size."));
966 DEBUG (
"call-history (0x%x): %d", flags, size);
998 begin = history->
begin;
1001 DEBUG (
"call-history (0x%x): %d, prev: [%u; %u)", flags, size,
1039 struct cleanup *uiout_cleanup;
1041 unsigned int low, high;
1050 DEBUG (
"call-history (0x%x): [%u; %u)", flags, low, high);
1053 if (low != from || high != to)
1063 error (
_(
"Range out of bounds."));
1091 context = abs (size);
1093 error (
_(
"Bad record function-call-history-size."));
1102 begin = from - context + 1;
1107 end = from + context - 1;
1135 const char *annex,
gdb_byte *readbuf,
1153 if (writebuf != NULL)
1161 if (section != NULL)
1166 & SEC_READONLY) != 0)
1183 offset, len, xfered_len);
1273 if (regno >= 0 && regno != pcreg)
1298 error (
_(
"This record target does not allow writing registers."));
1346 return htab_hash_pointer (cache->
frame);
1371 slot = htab_find_slot (
bfcache, cache, INSERT);
1390 slot = htab_find_slot (
bfcache, &pattern, NO_INSERT);
1407 cache = *this_cache;
1411 if (bfun->
up == NULL)
1412 return UNWIND_UNAVAILABLE;
1414 return UNWIND_NO_REASON;
1427 cache = *this_cache;
1440 DEBUG (
"[frame] %s id: (!stack, pc=%s, special=%s)",
1448 static struct value *
1462 if (pcreg < 0 || regnum != pcreg)
1464 _(
"Registers are not available in btrace record history"));
1466 cache = *this_cache;
1473 _(
"No caller in btrace record history"));
1488 DEBUG (
"[frame] unwound PC in %s on level %d: %s",
1533 DEBUG (
"[frame] sniffed frame for %s on level %d",
1541 *this_cache = cache;
1571 DEBUG (
"[frame] sniffed tailcall frame for %s on level %d",
1579 *this_cache = cache;
1591 slot = htab_find_slot (
bfcache, cache, NO_INSERT);
1594 htab_remove_elt (
bfcache, cache);
1654 error (
_(
"Thread already moving."));
1659 btinfo->
flags |= flag;
1689 if (btinfo->
begin == NULL)
1711 int upd_step_frame_id, upd_step_stack_frame_id;
1725 replay =
xmalloc (
sizeof (*replay));
1750 if (upd_step_frame_id)
1752 if (upd_step_stack_frame_id)
1795 enum gdb_signal signal)
1807 error (
_(
"Cannot find thread to resume."));
1818 return ops->
to_resume (ops, ptid, step, signal);
1885 status.
value.
sig = GDB_SIGNAL_TRAP;
1918 btinfo = &tp->btrace;
2002 while (insn == NULL);
2011 DEBUG (
"stepping %d (%s) ... %s", tp->num,
2042 while (insn == NULL);
2044 DEBUG (
"reverse-stepping %d (%s) ... %s", tp->num,
2069 return ops->
to_wait (ops, ptid, status, options);
2200 if (it == NULL || it->
function == NULL)
2204 if (btinfo->
replay == NULL)
2253 unsigned int number;
2260 error (
_(
"Instruction number out of range."));
2266 error (
_(
"No such instruction."));
2305 ops->
to_doc =
"Collect control-flow trace and provide the execution history.";
2356 if (args != NULL && *args != 0)
2357 error (
_(
"Invalid argument."));
2378 if (args != NULL && *args != 0)
2379 error (
_(
"Invalid argument."));
2400 if (args != NULL && *args != 0)
2401 error (
_(
"Invalid argument."));
2459 "by an appropriate subcommand.\n"));
2460 help_list (set_record_btrace_bts_cmdlist,
"set record btrace bts ",
2469 cmd_show_list (show_record_btrace_bts_cmdlist, from_tty,
"");
2478 "by an appropriate subcommand.\n"));
2479 help_list (set_record_btrace_pt_cmdlist,
"set record btrace pt ",
2488 cmd_show_list (show_record_btrace_pt_cmdlist, from_tty,
"");
2521 _(
"Start branch trace recording."), &record_btrace_cmdlist,
2527 Start branch trace recording in Branch Trace Store (BTS) format.\n\n\
2528 The processor stores a from/to record for each branch into a cyclic buffer.\n\
2529 This format may not be available on all processors."),
2530 &record_btrace_cmdlist);
2535 Start branch trace recording in Intel(R) Processor Trace format.\n\n\
2536 This format may not be available on all processors."),
2537 &record_btrace_cmdlist);
2541 _(
"Set record options"), &set_record_btrace_cmdlist,
2545 _(
"Show record options"), &show_record_btrace_cmdlist,
2550 Set what memory accesses are allowed during replay."),
_(
"\
2551 Show what memory accesses are allowed during replay."),
2552 _(
"Default is READ-ONLY.\n\n\
2553 The btrace record target does not trace data.\n\
2554 The memory therefore corresponds to the live target and not \
2555 to the current replay position.\n\n\
2556 When READ-ONLY, allow accesses to read-only memory during replay.\n\
2557 When READ-WRITE, allow accesses to read-only and read-write memory during \
2560 &set_record_btrace_cmdlist,
2561 &show_record_btrace_cmdlist);
2564 _(
"Set record btrace bts options"),
2565 &set_record_btrace_bts_cmdlist,
2566 "set record btrace bts ", 0, &set_record_btrace_cmdlist);
2569 _(
"Show record btrace bts options"),
2570 &show_record_btrace_bts_cmdlist,
2571 "show record btrace bts ", 0, &show_record_btrace_cmdlist);
2575 _(
"Set the record/replay bts buffer size."),
2576 _(
"Show the record/replay bts buffer size."),
_(
"\
2577 When starting recording request a trace buffer of this size. \
2578 The actual buffer size may differ from the requested size. \
2579 Use \"info record\" to see the actual buffer size.\n\n\
2580 Bigger buffers allow longer recording but also take more time to process \
2581 the recorded execution trace.\n\n\
2582 The trace buffer size may not be changed while recording."), NULL,
2584 &set_record_btrace_bts_cmdlist,
2585 &show_record_btrace_bts_cmdlist);
2588 _(
"Set record btrace pt options"),
2589 &set_record_btrace_pt_cmdlist,
2590 "set record btrace pt ", 0, &set_record_btrace_cmdlist);
2593 _(
"Show record btrace pt options"),
2594 &show_record_btrace_pt_cmdlist,
2595 "show record btrace pt ", 0, &show_record_btrace_cmdlist);
2599 _(
"Set the record/replay pt buffer size."),
2600 _(
"Show the record/replay pt buffer size."),
_(
"\
2601 Bigger buffers allow longer recording but also take more time to process \
2602 the recorded execution.\n\
2603 The actual buffer size may differ from the requested size. Use \"info record\" \
2605 &set_record_btrace_pt_cmdlist,
2606 &show_record_btrace_pt_cmdlist);
struct frame_id step_stack_frame_id
static void record_btrace_insn_history_from(struct target_ops *self, ULONGEST from, int size, int flags)
struct gdbarch * target_gdbarch(void)
#define target_can_async_p()
static int bfcache_eq(const void *arg1, const void *arg2)
void add_target(struct target_ops *t)
struct cmd_list_element * show_record_cmdlist
static int record_btrace_supports_stopped_by_hw_breakpoint(struct target_ops *ops)
const struct frame_unwind record_btrace_tailcall_frame_unwind
struct btrace_config_bts bts
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
unsigned int btrace_insn_prev(struct btrace_insn_iterator *it, unsigned int stride)
const char * symtab_to_filename_for_display(struct symtab *symtab)
const struct btrace_function * bfun
struct thread_info * find_thread_ptid(ptid_t ptid)
int(* to_supports_stopped_by_hw_breakpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
struct frame_info * get_selected_frame(const char *message)
static struct target_waitstatus btrace_step_stopped(void)
void(* to_goto_record_begin)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
static void record_btrace_update_thread_list(struct target_ops *ops)
int ptid_is_pid(ptid_t ptid)
#define SYMBOL_PRINT_NAME(symbol)
static void record_btrace_insn_history(struct target_ops *self, int size, int flags)
void ui_out_field_int(struct ui_out *uiout, const char *fldname, int value)
struct frame_info * get_current_frame(void)
int ptid_equal(ptid_t ptid1, ptid_t ptid2)
static void record_btrace_prepare_to_store(struct target_ops *ops, struct regcache *regcache)
static struct cmd_list_element * set_record_btrace_cmdlist
static struct cmd_list_element * show_record_btrace_pt_cmdlist
static enum exec_direction_kind record_btrace_resume_exec_dir
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
int number_is_in_list(const char *list, int number)
void add_setshow_enum_cmd(const char *name, enum command_class theclass, const char *const *enumlist, const char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void warning(const char *fmt,...)
void(* to_stop_recording)(struct target_ops *) TARGET_DEFAULT_IGNORE()
struct cmd_list_element * set_record_cmdlist
static void btrace_insn_history(struct ui_out *uiout, const struct btrace_thread_info *btinfo, const struct btrace_insn_iterator *begin, const struct btrace_insn_iterator *end, int flags)
static int record_btrace_stopped_by_sw_breakpoint(struct target_ops *ops)
struct btrace_insn_iterator * replay
void push_target(struct target_ops *t)
int(* to_insert_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_FUNC(memory_insert_breakpoint)
static hashval_t bfcache_hash(const void *arg)
void record_preopen(void)
struct btrace_call_history * call_history
static void record_btrace_goto_end(struct target_ops *ops)
int gdb_insn_length(struct gdbarch *gdbarch, CORE_ADDR addr)
struct ui_file * gdb_stdout
static enum exec_direction_kind record_btrace_execution_direction(struct target_ops *self)
void(* to_insn_history_from)(struct target_ops *, ULONGEST from, int size, int flags) TARGET_DEFAULT_NORETURN(tcomplain())
void record_disconnect(struct target_ops *t, const char *args, int from_tty)
static int record_btrace_is_replaying(struct target_ops *self)
static void cmd_record_btrace_bts_start(char *args, int from_tty)
void internal_error(const char *file, int line, const char *fmt,...)
struct thread_info * inferior_thread(void)
static void record_btrace_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
void delete_async_event_handler(async_event_handler **async_handler_ptr)
void(* to_call_history)(struct target_ops *, int size, int flags) TARGET_DEFAULT_NORETURN(tcomplain())
int ui_out_is_mi_like_p(struct ui_out *uiout)
unsigned int btrace_call_number(const struct btrace_call_iterator *it)
void(* to_close)(struct target_ops *)
enum btrace_function_flag flags
static void btrace_call_history_insn_range(struct ui_out *uiout, const struct btrace_function *bfun)
static void record_btrace_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regno)
void mark_async_event_handler(async_event_handler *async_handler_ptr)
static int record_btrace_remove_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static const char * btrace_get_bfun_name(const struct btrace_function *bfun)
static void cmd_show_record_btrace_pt(char *args, int from_tty)
const struct btrace_thread_info * btinfo
static void record_btrace_resume_thread(struct thread_info *tp, enum btrace_thread_flag flag)
enum btrace_thread_flag flags
const struct frame_unwind *(* to_get_tailcall_unwinder)(struct target_ops *self) TARGET_DEFAULT_RETURN(NULL)
const struct btrace_function * function
struct inferior * find_inferior_ptid(ptid_t ptid)
int(* to_remove_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_FUNC(memory_remove_breakpoint)
ptid_t(* to_wait)(struct target_ops *, ptid_t, struct target_waitstatus *, int TARGET_DEBUG_PRINTER(target_debug_print_options)) TARGET_DEFAULT_NORETURN(noprocess())
static void cmd_record_btrace_pt_start(char *args, int from_tty)
char * target_pid_to_str(ptid_t ptid)
void(* to_info_record)(struct target_ops *) TARGET_DEFAULT_IGNORE()
struct btrace_call_iterator begin
void execute_command(char *, int)
static void cmd_show_record_btrace_bts(char *args, int from_tty)
struct btrace_insn_history * insn_history
static void record_btrace_goto(struct target_ops *self, ULONGEST insn)
int btrace_call_cmp(const struct btrace_call_iterator *lhs, const struct btrace_call_iterator *rhs)
static void record_btrace_auto_disable(void)
void btrace_insn_begin(struct btrace_insn_iterator *it, const struct btrace_thread_info *btinfo)
static void show_record_bts_buffer_size_value(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static struct thread_info * record_btrace_find_thread_to_move(ptid_t ptid)
void btrace_set_call_history(struct btrace_thread_info *btinfo, const struct btrace_call_iterator *begin, const struct btrace_call_iterator *end)
void ui_out_field_fmt(struct ui_out *uiout, const char *fldname, const char *format,...)
static void btrace_call_history(struct ui_out *uiout, const struct btrace_thread_info *btinfo, const struct btrace_call_iterator *begin, const struct btrace_call_iterator *end, enum record_print_flag flags)
void btrace_disable(struct thread_info *tp)
struct regcache * get_current_regcache(void)
static struct cmd_list_element * show_record_btrace_cmdlist
void ui_out_text(struct ui_out *uiout, const char *string)
#define FRAME_OBSTACK_ZALLOC(TYPE)
static struct observer * record_btrace_thread_observer
const struct frame_unwind record_btrace_frame_unwind
static const char * record_btrace_adjust_size(unsigned int *size)
static struct target_waitstatus btrace_step_no_history(void)
void(* to_insn_history_range)(struct target_ops *, ULONGEST begin, ULONGEST end, int flags) TARGET_DEFAULT_NORETURN(tcomplain())
struct btrace_insn_iterator end
unsigned int btrace_insn_number(const struct btrace_insn_iterator *it)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
void null_cleanup(void *arg)
static int record_btrace_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
#define MSYMBOL_PRINT_NAME(symbol)
int frame_id_eq(struct frame_id l, struct frame_id r)
static struct cmd_list_element * show_record_btrace_bts_cmdlist
static void record_btrace_goto_begin(struct target_ops *self)
static void record_btrace_open(const char *args, int from_tty)
#define VEC_iterate(T, V, I, P)
struct frame_id get_frame_id(struct frame_info *fi)
#define CATCH(EXCEPTION, MASK)
void(* to_prepare_to_generate_core)(struct target_ops *) TARGET_DEFAULT_IGNORE()
struct address_space * aspace
static void record_btrace_print_pt_conf(const struct btrace_config_pt *conf)
void(* to_call_history_range)(struct target_ops *, ULONGEST begin, ULONGEST end, int flags) TARGET_DEFAULT_NORETURN(tcomplain())
void btrace_teardown(struct thread_info *tp)
static struct btrace_thread_info * require_btrace(void)
void inferior_event_handler(enum inferior_event_type event_type, gdb_client_data client_data)
static void record_btrace_handle_async_inferior_event(gdb_client_data data)
static void init_record_btrace_ops(void)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
struct cleanup * make_cleanup_ui_out_tuple_begin_end(struct ui_out *uiout, const char *id)
struct frame_id step_frame_id
const char * btrace_format_string(enum btrace_format format)
struct btrace_function * begin
void btrace_insn_end(struct btrace_insn_iterator *it, const struct btrace_thread_info *btinfo)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
static void record_btrace_close(struct target_ops *self)
void add_setshow_uinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static const char *const replay_memory_access_types[]
static void cmd_set_record_btrace_bts(char *args, int from_tty)
static void record_btrace_enable_warn(struct thread_info *tp)
static void record_btrace_insn_history_range(struct target_ops *self, ULONGEST from, ULONGEST to, int flags)
static void record_btrace_call_history_from(struct target_ops *self, ULONGEST from, int size, int flags)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
int(* to_supports_stopped_by_sw_breakpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
void(* to_resume)(struct target_ops *, ptid_t, int TARGET_DEBUG_PRINTER(target_debug_print_step), enum gdb_signal) TARGET_DEFAULT_NORETURN(noprocess())
void observer_detach_new_thread(struct observer *observer)
static void btrace_call_history_src_line(struct ui_out *uiout, const struct btrace_function *bfun)
static void record_btrace_prepare_to_generate_core(struct target_ops *self)
unsigned int btrace_call_prev(struct btrace_call_iterator *it, unsigned int stride)
static const char * replay_memory_access
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
static void record_btrace_resume(struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal signal)
async_event_handler * create_async_event_handler(async_event_handler_func *proc, gdb_client_data client_data)
static void record_btrace_print_bts_conf(const struct btrace_config_bts *conf)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
union target_waitstatus::@161 value
static void cmd_show_record_btrace(char *args, int from_tty)
struct btrace_target_info * target
struct thread_control_state control
void btrace_call_end(struct btrace_call_iterator *it, const struct btrace_thread_info *btinfo)
static void btrace_compute_src_line_range(const struct btrace_function *bfun, int *pbegin, int *pend)
static void cmd_record_btrace_start(char *args, int from_tty)
#define VEC_index(T, V, I)
struct btrace_func_link segment
struct btrace_function * up
void observer_notify_record_changed(struct inferior *inferior, int started)
struct frame_id frame_id_build_unavailable_stack_special(CORE_ADDR code_addr, CORE_ADDR special_addr)
static struct btrace_insn_iterator * record_btrace_start_replaying(struct thread_info *tp)
void record_detach(struct target_ops *t, const char *args, int from_tty)
struct cmd_list_element * add_alias_cmd(const char *name, const char *oldname, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
const struct btrace_config * btrace_conf(const struct btrace_thread_info *btinfo)
const struct btrace_insn * btrace_insn_get(const struct btrace_insn_iterator *it)
struct btrace_function * prev
#define target_has_execution
static int record_btrace_can_execute_reverse(struct target_ops *self)
struct frame_info * frame
static const char replay_memory_access_read_only[]
enum target_xfer_status(* to_xfer_partial)(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) TARGET_DEFAULT_RETURN(TARGET_XFER_E_IO)
struct minimal_symbol * msym
void printf_unfiltered(const char *format,...)
void(* to_detach)(struct target_ops *ops, const char *, int) TARGET_DEFAULT_IGNORE()
void(* to_async)(struct target_ops *, int) TARGET_DEFAULT_NORETURN(tcomplain())
struct bfd_section * the_bfd_section
static int record_btrace_tailcall_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_cache)
static void record_btrace_print_conf(const struct btrace_config *conf)
static void record_btrace_stop_recording(struct target_ops *self)
static void show_record_pt_buffer_size_value(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void cmd_show_list(struct cmd_list_element *list, int from_tty, const char *prefix)
static void record_btrace_clear_histories(struct btrace_thread_info *btinfo)
void record_mourn_inferior(struct target_ops *t)
void gdb_disassembly(struct gdbarch *gdbarch, struct ui_out *uiout, char *file_string, int flags, int how_many, CORE_ADDR low, CORE_ADDR high)
void(* to_disconnect)(struct target_ops *, const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
static int record_btrace_generating_corefile
static struct thread_info * record_btrace_find_resume_thread(ptid_t ptid)
int btrace_is_empty(struct thread_info *tp)
unsigned int btrace_insn_next(struct btrace_insn_iterator *it, unsigned int stride)
static void record_btrace_store_registers(struct target_ops *ops, struct regcache *regcache, int regno)
static void record_btrace_auto_enable(void)
static void record_btrace_async(struct target_ops *ops, int enable)
struct btrace_insn_iterator begin
static enum target_xfer_status record_btrace_xfer_partial(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
struct btrace_config_pt pt
static const char replay_memory_access_read_write[]
void print_stack_frame(struct frame_info *, int print_level, enum print_what print_what, int set_current_sal)
static void record_btrace_call_history_range(struct target_ops *self, ULONGEST from, ULONGEST to, int flags)
static struct cmd_list_element * set_record_btrace_bts_cmdlist
void record_kill(struct target_ops *t)
static int record_btrace_insert_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static int record_btrace_supports_stopped_by_sw_breakpoint(struct target_ops *ops)
struct cmd_list_element * record_cmdlist
const struct btrace_function * function
void throw_exception(struct gdb_exception exception)
void btrace_fetch(struct thread_info *tp)
struct frame_info * get_next_frame(struct frame_info *this_frame)
enum exec_direction_kind(* to_execution_direction)(struct target_ops *) TARGET_DEFAULT_FUNC(default_execution_direction)
unsigned int btrace_call_next(struct btrace_call_iterator *it, unsigned int stride)
static struct target_ops record_btrace_ops
void help_list(struct cmd_list_element *list, const char *cmdtype, enum command_class theclass, struct ui_file *stream)
static void record_btrace_done_generating_core(struct target_ops *self)
void discard_cleanups(struct cleanup *old_chain)
static void cmd_set_record_btrace(char *args, int from_tty)
void btrace_enable(struct thread_info *tp, const struct btrace_config *conf)
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
void(* to_mourn_inferior)(struct target_ops *) TARGET_DEFAULT_FUNC(default_mourn_inferior)
const struct frame_unwind *(* to_get_unwinder)(struct target_ops *self) TARGET_DEFAULT_RETURN(NULL)
void _initialize_record_btrace(void)
#define DEBUG(msg, args...)
static struct btrace_frame_cache * bfcache_new(struct frame_info *frame)
static ptid_t record_btrace_wait(struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, int options)
static void record_btrace_info(struct target_ops *self)
#define ALL_NON_EXITED_THREADS(T)
int btrace_insn_cmp(const struct btrace_insn_iterator *lhs, const struct btrace_insn_iterator *rhs)
void registers_changed_ptid(ptid_t ptid)
static int record_btrace_stopped_by_hw_breakpoint(struct target_ops *ops)
enum target_waitkind kind
void(* to_kill)(struct target_ops *) TARGET_DEFAULT_NORETURN(noprocess())
CORE_ADDR regcache_read_pc(struct regcache *regcache)
static const struct frame_unwind * record_btrace_to_get_unwinder(struct target_ops *self)
struct btrace_thread_info btrace
int(* to_stopped_by_sw_breakpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
void(* to_goto_record_end)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
static struct target_waitstatus record_btrace_step_thread(struct thread_info *tp)
void(* to_open)(const char *, int)
void(* to_call_history_from)(struct target_ops *, ULONGEST begin, int size, int flags) TARGET_DEFAULT_NORETURN(tcomplain())
struct target_section * target_section_by_addr(struct target_ops *target, CORE_ADDR addr)
static int record_btrace_thread_alive(struct target_ops *ops, ptid_t ptid)
const struct btrace_function * btrace_call_get(const struct btrace_call_iterator *it)
static struct cmd_list_element * record_btrace_cmdlist
int(* to_stopped_by_hw_breakpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
int btrace_is_replaying(struct thread_info *tp)
static void record_btrace_disable_callback(void *arg)
struct inferior * current_inferior(void)
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
static enum unwind_stop_reason record_btrace_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
const char * to_shortname
static void cmd_set_record_btrace_pt(char *args, int from_tty)
unsigned long long ULONGEST
enum target_stop_reason stop_reason
static const struct btrace_function * btrace_get_frame_function(struct frame_info *frame)
struct value * frame_unwind_got_address(struct frame_info *frame, int regnum, CORE_ADDR addr)
static void ui_out_field_uint(struct ui_out *uiout, const char *fld, unsigned int val)
void clear_async_event_handler(async_event_handler *async_handler_ptr)
void(* to_insn_history)(struct target_ops *, int size, int flags) TARGET_DEFAULT_NORETURN(tcomplain())
int(* to_record_is_replaying)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static struct async_event_handler * record_btrace_async_inferior_event_handler
static struct value * record_btrace_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
struct observer * observer_attach_new_thread(observer_new_thread_ftype *f)
void btrace_set_insn_history(struct btrace_thread_info *btinfo, const struct btrace_insn_iterator *begin, const struct btrace_insn_iterator *end)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
void(* to_done_generating_core)(struct target_ops *) TARGET_DEFAULT_IGNORE()
void ui_out_field_string(struct ui_out *uiout, const char *fldname, const char *string)
int btrace_find_insn_by_number(struct btrace_insn_iterator *it, const struct btrace_thread_info *btinfo, unsigned int number)
enum btrace_format format
int(* to_thread_alive)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(0)
struct ui_out * current_uiout
static void record_btrace_call_history(struct target_ops *self, int size, int flags)
int record_check_stopped_by_breakpoint(struct address_space *aspace, CORE_ADDR pc, enum target_stop_reason *reason)
void(* to_update_thread_list)(struct target_ops *) TARGET_DEFAULT_IGNORE()
#define target_async(ENABLE)
void(* to_prepare_to_store)(struct target_ops *, struct regcache *) TARGET_DEFAULT_NORETURN(noprocess())
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
struct btrace_call_iterator end
static struct cmd_list_element * set_record_btrace_pt_cmdlist
PTR xcalloc(size_t number, size_t size)
struct symtab * symbol_symtab(const struct symbol *symbol)
int btrace_find_call_by_number(struct btrace_call_iterator *it, const struct btrace_thread_info *btinfo, unsigned int number)
const char * core_addr_to_string_nz(const CORE_ADDR addr)
static void btrace_ui_out_decode_error(struct ui_out *uiout, int errcode, enum btrace_format format)
CORE_ADDR get_frame_func(struct frame_info *this_frame)
static void cmd_show_replay_memory_access(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void set_executing(ptid_t ptid, int executing)
void error(const char *fmt,...)
static struct btrace_config record_btrace_conf
static void record_btrace_frame_dealloc_cache(struct frame_info *self, void *this_cache)
static void record_btrace_set_replay(struct thread_info *tp, const struct btrace_insn_iterator *it)
static struct thread_info * require_btrace_thread(void)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
void throw_error(enum errors error, const char *fmt,...)
struct target_ops * beneath
int(* to_can_execute_reverse)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
void do_cleanups(struct cleanup *old_chain)
int is_executing(ptid_t ptid)
static void record_btrace_stop_replaying(struct thread_info *tp)
static const struct frame_unwind * record_btrace_to_get_tailcall_unwinder(struct target_ops *self)
void(* to_goto_record)(struct target_ops *, ULONGEST insn) TARGET_DEFAULT_NORETURN(tcomplain())
const ULONGEST const LONGEST len