34 #include "filenames.h" 93 #define DEBUG(msg, args...) \ 96 if (record_debug != 0) \ 97 fprintf_unfiltered (gdb_stdlog, \ 98 "[record-btrace] " msg "\n", ##args); \ 177 DEBUG (
"attach thread observer");
192 DEBUG (
"detach thread observer");
239 error (
_(
"The program is not being run."));
264 DEBUG (
"stop recording");
269 if (tp->
btrace.target != NULL)
330 if ((sz & ((1u << 30) - 1)) == 0)
335 else if ((sz & ((1u << 20) - 1)) == 0)
340 else if ((sz & ((1u << 10) - 1)) == 0)
414 unsigned int insns, calls, gaps;
457 "for thread %s (%s).\n"), insns, calls, gaps,
473 uiout->
text (
_(
"["));
477 uiout->
text (
_(
"decode error ("));
479 uiout->
text (
_(
"): "));
481 uiout->
text (errstr);
482 uiout->
text (
_(
"]\n"));
530 range.end = line + 1;
532 else if (line <
range.begin)
534 else if (
range.end < line)
579 lines = ltable->
item;
584 for (i = 0; i <
nlines - 1; i++)
586 if ((lines[i].pc == pc) && (lines[i].line != 0))
606 print_source_lines_flags psl_flags;
613 for (line = lines.
begin; line < lines.
end; ++line)
615 if (*ui_item_chain != NULL)
634 gdb_disassembly_flags
flags)
636 struct cleanup *cleanups, *ui_item_chain;
641 DEBUG (
"itrace (0x%x): [%u; %u)", (
unsigned)
flags,
653 ui_item_chain = NULL;
695 else if (ui_item_chain == NULL)
707 memset (&dinsn, 0,
sizeof (dinsn));
725 gdb_disassembly_flags
flags)
731 unsigned int context, covered;
735 context = abs (
size);
737 error (
_(
"Bad record instruction-history-size."));
774 begin = history->
begin;
777 DEBUG (
"insn-history (0x%x): %d, prev: [%u; %u)", (
unsigned)
flags,
size,
810 gdb_disassembly_flags
flags)
815 unsigned int low, high;
823 DEBUG (
"insn-history (0x%x): [%u; %u)", (
unsigned)
flags, low, high);
826 if (low != from || high != to)
836 error (
_(
"Range out of bounds."));
859 gdb_disassembly_flags
flags)
863 context = abs (
size);
865 error (
_(
"Bad record instruction-history-size."));
874 begin = from - context + 1;
879 end = from + context - 1;
915 int *pbegin,
int *pend)
935 if (sal.symtab !=
symtab || sal.line == 0)
938 begin = std::min (begin, sal.line);
939 end = std::max (
end, sal.line);
993 else if (msym != NULL)
1047 for (i = 0; i < level; ++i)
1053 else if (msym != NULL)
1060 uiout->
text (
_(
"\tinst "));
1066 uiout->
text (
_(
"\tat "));
1083 unsigned int context, covered;
1088 context = abs (
size);
1090 error (
_(
"Bad record function-call-history-size."));
1094 if (history == NULL)
1098 DEBUG (
"call-history (0x%x): %d", int_flags,
size);
1130 begin = history->
begin;
1133 DEBUG (
"call-history (0x%x): %d, prev: [%u; %u)", int_flags,
size,
1171 unsigned int low, high;
1180 DEBUG (
"call-history (0x%x): [%u; %u)", int_flags, low, high);
1183 if (low != from || high != to)
1193 error (
_(
"Range out of bounds."));
1221 context = abs (
size);
1223 error (
_(
"Bad record function-call-history-size."));
1232 begin = from - context + 1;
1237 end = from + context - 1;
1257 if (tp->
btrace.target == NULL)
1289 const char *annex,
gdb_byte *readbuf,
1305 if (writebuf != NULL)
1313 if (section != NULL)
1318 & SEC_READONLY) != 0)
1335 offset, len, xfered_len);
1414 replay = tp->
btrace.replay;
1427 if (regno >= 0 && regno != pcreg)
1453 error (
_(
"Cannot write registers while replaying."));
1503 return htab_hash_pointer (cache->
frame);
1530 slot = htab_find_slot (
bfcache, cache, INSERT);
1548 slot = htab_find_slot (
bfcache, &pattern, NO_INSERT);
1570 return UNWIND_UNAVAILABLE;
1572 return UNWIND_NO_REASON;
1599 DEBUG (
"[frame] %s id: (!stack, pc=%s, special=%s)",
1607 static struct value *
1621 if (pcreg < 0 ||
regnum != pcreg)
1623 _(
"Registers are not available in btrace record history"));
1631 _(
"No caller in btrace record history"));
1636 pc = caller->
insn.front ().pc;
1639 pc = caller->
insn.back ().pc;
1643 DEBUG (
"[frame] unwound PC in %s on level %d: %s",
1672 replay = tp->
btrace.replay;
1694 DEBUG (
"[frame] sniffed frame for %s on level %d",
1702 *this_cache = cache;
1736 DEBUG (
"[frame] sniffed tailcall frame for %s on level %d",
1744 *this_cache = cache;
1756 slot = htab_find_slot (
bfcache, cache, NO_INSERT);
1759 htab_remove_elt (
bfcache, cache);
1817 return "reverse-step";
1823 return "reverse-cont";
1850 btinfo->
flags |= flag;
1859 ptid_t old_inferior_ptid;
1926 int upd_step_frame_id, upd_step_stack_frame_id;
1965 if (upd_step_frame_id)
1967 if (upd_step_stack_frame_id)
2024 enum gdb_signal signal)
2031 step ?
"step" :
"cont");
2117 DEBUG (
"cancel resume thread %s (%s): %x (%s)",
2146 status.value.sig = GDB_SIGNAL_TRAP;
2160 status.value.sig = GDB_SIGNAL_0;
2249 btinfo = &tp->btrace;
2298 btinfo = &tp->btrace;
2346 btinfo = &tp->btrace;
2417 int more_moving, more_no_history;
2422 if (!more_moving && !more_no_history)
2426 DEBUG (
"movers pending");
2428 if (more_no_history)
2429 DEBUG (
"no-history pending");
2440 VEC (
tp_t) *moving, *no_history;
2522 if (eventing == NULL)
2560 DEBUG (
"wait ended by thread %s (%s): %s",
2566 return eventing->
ptid;
2701 if (btinfo->
replay == NULL)
2761 unsigned int number;
2768 error (
_(
"Instruction number out of range."));
2776 error (
_(
"No such instruction."));
2826 ops->
to_doc =
"Collect control-flow trace and provide the execution history.";
2882 if (args != NULL && *args != 0)
2883 error (
_(
"Invalid argument."));
2904 if (args != NULL && *args != 0)
2905 error (
_(
"Invalid argument."));
2926 if (args != NULL && *args != 0)
2927 error (
_(
"Invalid argument."));
2985 "by an appropriate subcommand.\n"));
3004 "by an appropriate subcommand.\n"));
3051 Start branch trace recording in Branch Trace Store (BTS) format.\n\n\ 3052 The processor stores a from/to record for each branch into a cyclic buffer.\n\ 3053 This format may not be available on all processors."),
3059 Start branch trace recording in Intel Processor Trace format.\n\n\ 3060 This format may not be available on all processors."),
3074 Set what memory accesses are allowed during replay."),
_(
"\ 3075 Show what memory accesses are allowed during replay."),
3076 _(
"Default is READ-ONLY.\n\n\ 3077 The btrace record target does not trace data.\n\ 3078 The memory therefore corresponds to the live target and not \ 3079 to the current replay position.\n\n\ 3080 When READ-ONLY, allow accesses to read-only memory during replay.\n\ 3081 When READ-WRITE, allow accesses to read-only and read-write memory during \ 3088 _(
"Set record btrace bts options"),
3093 _(
"Show record btrace bts options"),
3099 _(
"Set the record/replay bts buffer size."),
3100 _(
"Show the record/replay bts buffer size."),
_(
"\ 3101 When starting recording request a trace buffer of this size. \ 3102 The actual buffer size may differ from the requested size. \ 3103 Use \"info record\" to see the actual buffer size.\n\n\ 3104 Bigger buffers allow longer recording but also take more time to process \ 3105 the recorded execution trace.\n\n\ 3106 The trace buffer size may not be changed while recording."), NULL,
3112 _(
"Set record btrace pt options"),
3117 _(
"Show record btrace pt options"),
3123 _(
"Set the record/replay pt buffer size."),
3124 _(
"Show the record/replay pt buffer size."),
_(
"\ 3125 Bigger buffers allow longer recording but also take more time to process \ 3126 the recorded execution.\n\ 3127 The actual buffer size may differ from the requested size. Use \"info record\" \ struct frame_id step_stack_frame_id
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)
static int btrace_line_range_is_empty(struct btrace_line_range range)
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
unsigned int btrace_insn_prev(struct btrace_insn_iterator *it, unsigned int stride)
const char * symtab_to_filename_for_display(struct symtab *symtab)
static const char * range
static void record_btrace_insn_history_range(struct target_ops *self, ULONGEST from, ULONGEST to, gdb_disassembly_flags flags)
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)
static void cmd_show_record_btrace(const char *args, int from_tty)
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)
#define SYMBOL_PRINT_NAME(symbol)
static void record_btrace_disconnect(struct target_ops *self, const char *args, int from_tty)
static void record_btrace_stop(struct target_ops *ops, ptid_t ptid)
struct frame_info * get_current_frame(void)
void field_string(const char *fldname, const char *string)
struct linetable_entry item[1]
static void record_btrace_prepare_to_store(struct target_ops *ops, struct regcache *regcache)
static void cmd_show_record_btrace_pt(const char *args, int from_tty)
static struct cmd_list_element * set_record_btrace_cmdlist
static struct cmd_list_element * show_record_btrace_pt_cmdlist
static int btrace_line_range_contains_range(struct btrace_line_range lhs, struct btrace_line_range rhs)
static enum exec_direction_kind record_btrace_resume_exec_dir
static void record_btrace_call_history_range(struct target_ops *self, ULONGEST from, ULONGEST to, int int_flags)
static void record_btrace_call_history(struct target_ops *self, int size, int int_flags)
int number_is_in_list(const char *list, int number)
void warning(const char *fmt,...)
static int record_btrace_replay_at_breakpoint(struct thread_info *tp)
void(* to_stop_recording)(struct target_ops *) TARGET_DEFAULT_IGNORE()
struct cmd_list_element * set_record_cmdlist
static struct target_waitstatus record_btrace_single_step_forward(struct thread_info *tp)
static int record_btrace_stopped_by_sw_breakpoint(struct target_ops *ops)
struct btrace_insn_iterator * replay
void push_target(struct target_ops *t)
void(* to_record_stop_replaying)(struct target_ops *) TARGET_DEFAULT_IGNORE()
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)
static enum exec_direction_kind record_btrace_execution_direction(struct target_ops *self)
ptid_t regcache_get_ptid(const struct regcache *regcache)
int unpush_target(struct target_ops *t)
void * memset(T *s, int c, size_t n)=delete
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())
unsigned int btrace_call_number(const struct btrace_call_iterator *it)
#define VEC_unordered_remove(T, V, I)
void(* to_close)(struct target_ops *)
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 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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void mark_async_event_handler(async_event_handler *async_handler_ptr)
static const char * btrace_get_bfun_name(const struct btrace_function *bfun)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
const struct btrace_thread_info * btinfo
int btrace_insn_get_error(const struct btrace_insn_iterator *it)
void target_async(int enable)
static void record_btrace_resume_thread(struct thread_info *tp, enum btrace_thread_flag flag)
const struct frame_unwind *(* to_get_tailcall_unwinder)(struct target_ops *self) TARGET_DEFAULT_RETURN(NULL)
void(* to_insn_history)(struct target_ops *, int size, gdb_disassembly_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
#define VEC_safe_push(T, V, O)
struct inferior * find_inferior_ptid(ptid_t ptid)
void(* to_insn_history_range)(struct target_ops *, ULONGEST begin, ULONGEST end, gdb_disassembly_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
static int record_btrace_is_replaying(struct target_ops *self, ptid_t ptid)
static int record_btrace_will_replay(struct target_ops *self, ptid_t ptid, int dir)
void(* to_info_record)(struct target_ops *) TARGET_DEFAULT_IGNORE()
struct btrace_call_iterator begin
struct btrace_insn_history * insn_history
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, int int_flags)
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)
static void cmd_record_btrace_start(const char *args, int from_tty)
void btrace_insn_begin(struct btrace_insn_iterator *it, const struct btrace_thread_info *btinfo)
static struct target_waitstatus btrace_step_stopped_on_request(void)
static void show_record_bts_buffer_size_value(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void btrace_set_call_history(struct btrace_thread_info *btinfo, const struct btrace_call_iterator *begin, const struct btrace_call_iterator *end)
void btrace_disable(struct thread_info *tp)
void text(const char *string)
struct regcache * get_current_regcache(void)
static struct cmd_list_element * show_record_btrace_cmdlist
#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)
struct btrace_insn_iterator end
void execute_command(const char *, int)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
std::string target_waitstatus_to_string(const struct target_waitstatus *ws)
const struct btrace_thread_info * btinfo
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)
static void cmd_set_record_btrace(const char *args, int from_tty)
#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)
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static void record_btrace_insn_history_from(struct target_ops *self, ULONGEST from, int size, gdb_disassembly_flags flags)
int(* to_record_is_replaying)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(0)
struct thread_info * next
#define VEC_iterate(T, V, I, P)
struct frame_id get_frame_id(struct frame_info *fi)
void(* to_insn_history_from)(struct target_ops *, ULONGEST from, int size, gdb_disassembly_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
enum exec_direction_kind execution_direction
#define CATCH(EXCEPTION, MASK)
void(* to_prepare_to_generate_core)(struct target_ops *) TARGET_DEFAULT_IGNORE()
void end(ui_out_type type)
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())
static void cmd_record_btrace_pt_start(const char *args, int from_tty)
void btrace_teardown(struct thread_info *tp)
btrace_function_flags flags
std::vector< btrace_insn > insn
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)
void observer_notify_record_changed(struct inferior *inferior, int started, const char *method, const char *format)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
struct cleanup * make_cleanup_ui_out_list_begin_end(struct ui_out *uiout, const char *id)
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)
static void record_btrace_stop_replaying_at_end(struct thread_info *tp)
int target_is_non_stop_p(void)
void btrace_insn_end(struct btrace_insn_iterator *it, const struct btrace_thread_info *btinfo)
static void cmd_show_record_btrace_bts(const char *args, int from_tty)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
int(* to_record_will_replay)(struct target_ops *, ptid_t ptid, int dir) TARGET_DEFAULT_RETURN(0)
static void record_btrace_cancel_resume(struct thread_info *tp)
static void record_btrace_close(struct target_ops *self)
static const char *const replay_memory_access_types[]
static void record_btrace_stop_replaying_all(struct target_ops *self)
int pretty_print_insn(struct ui_out *uiout, const struct disasm_insn *insn, gdb_disassembly_flags flags)
static void record_btrace_enable_warn(struct thread_info *tp)
static struct btrace_line_range btrace_mk_line_range(struct symtab *symtab, int begin, int end)
int(* to_supports_stopped_by_sw_breakpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static struct target_waitstatus btrace_step_no_resumed(void)
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
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)
static void record_btrace_insn_history(struct target_ops *self, int size, gdb_disassembly_flags flags)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
static const char * btrace_thread_flag_to_str(enum btrace_thread_flag flag)
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)
const char * btrace_decode_error(enum btrace_format format, int errcode)
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)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
#define target_is_async_p()
const char * print_thread_id(struct thread_info *thr)
static void cmd_set_record_btrace_bts(const char *args, int from_tty)
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)
#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,...)
static void record_btrace_commit_resume(struct target_ops *ops)
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)
int record_check_stopped_by_breakpoint(const address_space *aspace, CORE_ADDR pc, enum target_stop_reason *reason)
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)
struct cmd_list_element * add_alias_cmd(const char *name, cmd_list_element *old, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
btrace_thread_flags flags
static void record_btrace_clear_histories(struct btrace_thread_info *btinfo)
void record_mourn_inferior(struct target_ops *t)
void(* to_commit_resume)(struct target_ops *) TARGET_DEFAULT_IGNORE()
void(* to_disconnect)(struct target_ops *, const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
static int record_btrace_generating_corefile
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 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
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)
static void cmd_record_btrace_bts_start(const char *args, int from_tty)
void discard_cleanups(struct cleanup *old_chain)
static struct btrace_line_range btrace_find_line_range(CORE_ADDR pc)
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)
static struct target_waitstatus btrace_step_again(void)
void _initialize_record_btrace(void)
#define DEBUG(msg, args...)
static struct btrace_frame_cache * bfcache_new(struct frame_info *frame)
static struct target_waitstatus btrace_step_spurious(void)
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)
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, gdb_disassembly_flags flags)
void(* to_stop)(struct target_ops *, ptid_t) TARGET_DEFAULT_IGNORE()
static struct frame_info * get_thread_current_frame(struct thread_info *tp)
enum record_method(* to_record_method)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(RECORD_METHOD_NONE)
void registers_changed_ptid(ptid_t ptid)
static void cmd_set_record_btrace_pt(const char *args, int from_tty)
void record_btrace_push_target(void)
thread_control_state control
static int record_btrace_stopped_by_hw_breakpoint(struct target_ops *ops)
void field_int(const char *fldname, int value)
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)
void print_source_lines(struct symtab *s, int line, int stopline, print_source_lines_flags flags)
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)
const char * target_pid_to_str(ptid_t ptid)
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)
int(* to_remove_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *, enum remove_bp_reason) TARGET_DEFAULT_FUNC(memory_remove_breakpoint)
static struct cmd_list_element * record_btrace_cmdlist
static struct btrace_line_range btrace_line_range_add(struct btrace_line_range range, int line)
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
std::vector< btrace_function > functions
int ptid_match(const ptid_t &ptid, const ptid_t &filter)
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 validate_registers_access(void)
static struct target_waitstatus record_btrace_single_step_backward(struct thread_info *tp)
static struct async_event_handler * record_btrace_async_inferior_event_handler
unsigned int is_speculative
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()
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)
static int record_btrace_remove_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt, enum remove_bp_reason reason)
struct thread_info * tp_t
struct symtab * find_pc_line_symtab(CORE_ADDR pc)
void(* to_update_thread_list)(struct target_ops *) TARGET_DEFAULT_IGNORE()
void(* to_prepare_to_store)(struct target_ops *, struct regcache *) TARGET_DEFAULT_NORETURN(noprocess())
static enum record_method record_btrace_record_method(struct target_ops *self, ptid_t ptid)
static void btrace_print_lines(struct btrace_line_range lines, struct ui_out *uiout, struct cleanup **ui_item_chain, int flags)
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)
ptid_t(* to_wait)(struct target_ops *, ptid_t, struct target_waitstatus *, int TARGET_DEBUG_PRINTER(target_debug_print_options)) TARGET_DEFAULT_FUNC(default_target_wait)
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 record_btrace_maybe_mark_async_event(const VEC(tp_t) *moving, const VEC(tp_t) *no_history)
static void btrace_ui_out_decode_error(struct ui_out *uiout, int errcode, enum btrace_format format)
#define SYMTAB_LINETABLE(symtab)
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)
const char * btrace_format_short_string(enum btrace_format format)
void error(const char *fmt,...)
void begin(ui_out_type type, const char *id)
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)
void field_fmt(const char *fldname, const char *format,...) ATTRIBUTE_PRINTF(3
static const struct frame_unwind * record_btrace_to_get_tailcall_unwinder(struct target_ops *self)
static void record_btrace_call_history_from(struct target_ops *self, ULONGEST from, int size, int int_flags)
void(* to_goto_record)(struct target_ops *, ULONGEST insn) TARGET_DEFAULT_NORETURN(tcomplain())
#define VEC_ordered_remove(T, V, I)