39#include "gdbsupport/event-loop.h"
46#include <forward_list>
52 N_(
"Branch tracing target"),
53 N_(
"Collect control-flow trace and provide the execution history.")
66 void close ()
override;
67 void async (
bool)
override;
87 gdb_disassembly_flags
flags)
override;
89 gdb_disassembly_flags
flags)
override;
103 const gdb_byte *writebuf,
104 ULONGEST offset, ULONGEST len,
105 ULONGEST *xfered_len)
override;
121 void resume (ptid_t,
int,
enum gdb_signal)
override;
124 void stop (ptid_t)
override;
212#define DEBUG(msg, args...) \
215 if (record_debug != 0) \
216 gdb_printf (gdb_stdlog, \
217 "[record-btrace] " msg "\n", ##args); \
224const struct btrace_cpu *
239 error (_(
"Internal error: bad record btrace cpu state."));
254 error (_(
"No thread."));
263 error (_(
"No trace."));
298 catch (
const gdb_exception_error &error)
300 warning (
"%s", error.what ());
309 DEBUG (
"attach thread observer");
321 DEBUG (
"detach thread observer");
347 NULL,
"record-btrace");
396 error (_(
"The program is not being run."));
416 DEBUG (
"stop recording");
421 if (tp->btrace.target != NULL)
480 if ((sz & ((1u << 30) - 1)) == 0)
485 else if ((sz & ((1u << 20) - 1)) == 0)
490 else if ((sz & ((1u << 10) - 1)) == 0)
537 btrace_format_string (conf->format));
539 switch (conf->format)
541 case BTRACE_FORMAT_NONE:
544 case BTRACE_FORMAT_BTS:
548 case BTRACE_FORMAT_PT:
553 internal_error (_(
"Unknown branch trace format."));
562 const struct btrace_config *conf;
564 unsigned int insns, calls, gaps;
569 error (_(
"No thread."));
604 gaps = btinfo->
ngaps;
607 gdb_printf (_(
"Recorded %u instructions in %u functions (%u gaps) "
608 "for thread %s (%s).\n"), insns, calls, gaps,
613 gdb_printf (_(
"Replay in progress. At instruction %u.\n"),
621 enum btrace_format format)
625 uiout->
text (_(
"["));
627 if (!(format == BTRACE_FORMAT_PT && errcode > 0))
629 uiout->
text (_(
"decode error ("));
631 uiout->
text (_(
"): "));
633 uiout->
text (errstr);
634 uiout->
text (_(
"]\n"));
674 range.end = line + 1;
676 else if (line <
range.begin)
678 else if (
range.end < line)
723 lines = ltable->
item;
728 unrelocated_addr unrel_pc
732 for (i = 0; i < nlines - 1; i++)
742 if (lines[i].unrelocated_pc () == unrel_pc && lines[i].line != 0
761 gdb::optional<ui_out_emit_tuple> *src_and_asm_tuple,
762 gdb::optional<ui_out_emit_list> *asm_list,
763 gdb_disassembly_flags
flags)
765 print_source_lines_flags psl_flags;
770 for (
int line = lines.
begin; line < lines.
end; ++line)
774 src_and_asm_tuple->emplace (uiout,
"src_and_asm_line");
778 asm_list->emplace (uiout,
"line_asm_insn");
789 gdb_disassembly_flags
flags)
791 DEBUG (
"itrace (0x%x): [%u; %u)", (
unsigned)
flags,
801 gdb::optional<ui_out_emit_tuple> src_and_asm_tuple;
802 gdb::optional<ui_out_emit_list> asm_list;
816 const struct btrace_config *conf;
821 gdb_assert (conf != NULL);
846 else if (!src_and_asm_tuple.has_value ())
848 gdb_assert (!asm_list.has_value ());
850 src_and_asm_tuple.emplace (uiout,
"src_and_asm_line");
853 asm_list.emplace (uiout,
"line_asm_insn");
856 gdb_assert (src_and_asm_tuple.has_value ());
857 gdb_assert (asm_list.has_value ());
860 memset (&dinsn, 0,
sizeof (dinsn));
881 unsigned int context, covered;
885 context = abs (
size);
887 error (_(
"Bad record instruction-history-size."));
924 begin = history->
begin;
927 DEBUG (
"insn-history (0x%x): %d, prev: [%u; %u)", (
unsigned)
flags,
size,
947 gdb_printf (_(
"At the start of the branch trace record.\n"));
949 gdb_printf (_(
"At the end of the branch trace record.\n"));
959 gdb_disassembly_flags
flags)
964 unsigned int low, high;
972 DEBUG (
"insn-history (0x%x): [%u; %u)", (
unsigned)
flags, low, high);
975 if (low != from || high != to)
976 error (_(
"Bad range."));
979 error (_(
"Bad range."));
985 error (_(
"Range out of bounds."));
1007 gdb_disassembly_flags
flags)
1009 ULONGEST begin, end, context;
1011 context = abs (
size);
1013 error (_(
"Bad record instruction-history-size."));
1022 begin = from - context + 1;
1027 end = from + context - 1;
1046 gdb_assert (
size > 0);
1063 int *pbegin,
int *pend)
1086 begin = std::min (begin, sal.
line);
1142 else if (msym != NULL)
1180 const struct btrace_config *conf;
1185 gdb_assert (conf != NULL);
1196 for (i = 0; i < level; ++i)
1203 else if (msym != NULL)
1212 uiout->
text (_(
"\tinst "));
1218 uiout->
text (_(
"\tat "));
1235 unsigned int context, covered;
1239 context = abs (
size);
1241 error (_(
"Bad record function-call-history-size."));
1245 if (history == NULL)
1281 begin = history->
begin;
1284 DEBUG (
"call-history (0x%x): %d, prev: [%u; %u)", (
int)
flags,
size,
1304 gdb_printf (_(
"At the start of the branch trace record.\n"));
1306 gdb_printf (_(
"At the end of the branch trace record.\n"));
1316 record_print_flags
flags)
1321 unsigned int low, high;
1329 DEBUG (
"call-history (0x%x): [%u; %u)", (
int)
flags, low, high);
1332 if (low != from || high != to)
1333 error (_(
"Bad range."));
1336 error (_(
"Bad range."));
1342 error (_(
"Range out of bounds."));
1364 record_print_flags
flags)
1366 ULONGEST begin, end, context;
1368 context = abs (
size);
1370 error (_(
"Bad record function-call-history-size."));
1379 begin = from - context + 1;
1384 end = from + context - 1;
1403 error (_(
"No thread."));
1405 if (tp->
btrace.target == NULL)
1436 const char *annex, gdb_byte *readbuf,
1437 const gdb_byte *writebuf, ULONGEST offset,
1438 ULONGEST len, ULONGEST *xfered_len)
1452 if (writebuf != NULL)
1460 if (section != NULL)
1464 & SEC_READONLY) != 0)
1467 len = std::min (len, section->
endaddr - offset);
1480 offset, len, xfered_len);
1502 catch (
const gdb_exception &except)
1532 catch (
const gdb_exception &except)
1555 replay = tp->
btrace.replay;
1569 if (regno >= 0 && regno != pcreg)
1573 gdb_assert (insn != NULL);
1588 error (_(
"Cannot write registers while replaying."));
1633 return htab_hash_pointer (cache->
frame);
1660 slot = htab_find_slot (
bfcache, cache, INSERT);
1661 gdb_assert (*slot == NULL);
1678 slot = htab_find_slot (
bfcache, &pattern, NO_INSERT);
1697 gdb_assert (
bfun != NULL);
1700 return UNWIND_UNAVAILABLE;
1702 return UNWIND_NO_REASON;
1714 CORE_ADDR
code, special;
1719 gdb_assert (
bfun != NULL);
1729 DEBUG (
"[frame] %s id: (!stack, pc=%s, special=%s)",
1731 core_addr_to_string_nz (this_id->
code_addr),
1737static struct value *
1751 if (pcreg < 0 ||
regnum != pcreg)
1752 throw_error (NOT_AVAILABLE_ERROR,
1753 _(
"Registers are not available in btrace record history"));
1757 gdb_assert (
bfun != NULL);
1760 throw_error (NOT_AVAILABLE_ERROR,
1761 _(
"No caller in btrace record history"));
1766 pc = caller->
insn.front ().pc;
1769 pc = caller->
insn.back ().pc;
1773 DEBUG (
"[frame] unwound PC in %s on level %d: %s",
1775 core_addr_to_string_nz (pc));
1801 replay = tp->
btrace.replay;
1823 DEBUG (
"[frame] sniffed frame for %s on level %d",
1831 *this_cache = cache;
1865 DEBUG (
"[frame] sniffed tailcall frame for %s on level %d",
1873 *this_cache = cache;
1885 slot = htab_find_slot (
bfcache, cache, NO_INSERT);
1886 gdb_assert (slot != NULL);
1888 htab_remove_elt (
bfcache, cache);
1911 "record-btrace tailcall",
1948 return "reverse-step";
1954 return "reverse-cont";
1972 tp->
ptid.to_string ().c_str (), flag,
1982 btinfo->
flags |= flag;
2005 bool executing = tp->executing ();
2027 error (_(
"No trace."));
2037 int upd_step_frame_id, upd_step_stack_frame_id;
2058 error (_(
"No trace."));
2062 gdb_assert (btinfo->
replay == NULL);
2072 if (upd_step_frame_id)
2074 if (upd_step_stack_frame_id)
2077 catch (
const gdb_exception &except)
2133 DEBUG (
"resume %s: %s%s", ptid.to_string ().c_str (),
2135 step ?
"step" :
"cont");
2205 btrace_thread_flags
flags;
2211 DEBUG (
"cancel resume thread %s (%s): %x (%s)",
2213 tp->
ptid.to_string ().c_str (),
flags.raw (),
2336 btinfo = &tp->btrace;
2385 btinfo = &tp->btrace;
2431 btrace_thread_flags
flags;
2433 btinfo = &tp->btrace;
2439 tp->ptid.to_string ().c_str (),
flags.raw (),
2449 internal_error (_(
"invalid stepping type."));
2497 (
const std::vector<thread_info *> &moving,
2498 const std::vector<thread_info *> &no_history)
2500 bool more_moving = !moving.empty ();
2501 bool more_no_history = !no_history.empty ();;
2503 if (!more_moving && !more_no_history)
2507 DEBUG (
"movers pending");
2509 if (more_no_history)
2510 DEBUG (
"no-history pending");
2519 target_wait_flags options)
2521 std::vector<thread_info *> moving;
2522 std::vector<thread_info *> no_history;
2527 DEBUG (
"wait %s (0x%x)", ptid.to_string ().c_str (),
2528 (
unsigned) options);
2541 moving.push_back (tp);
2543 if (moving.empty ())
2547 DEBUG (
"wait ended by %s: %s", null_ptid.to_string ().c_str (),
2548 status->to_string ().c_str ());
2571 while ((eventing == NULL) && !moving.empty ())
2573 for (
unsigned int ix = 0; eventing == NULL && ix < moving.size ();)
2586 no_history.push_back (ordered_remove (moving, ix));
2590 eventing = unordered_remove (moving, ix);
2596 if (eventing == NULL)
2603 gdb_assert (!no_history.empty ());
2607 eventing = unordered_remove (no_history, 0);
2608 eventing->
btrace.flags &= ~BTHR_MOVE;
2613 gdb_assert (eventing != NULL);
2636 DEBUG (
"wait ended by thread %s (%s): %s",
2638 eventing->
ptid.to_string ().c_str (),
2639 status->to_string ().c_str ());
2641 return eventing->
ptid;
2649 DEBUG (
"stop %s", ptid.to_string ().c_str ());
2664 tp->btrace.flags &= ~BTHR_MOVE;
2773 if (btinfo->
replay == NULL)
2808 error (_(
"No trace."));
2833 unsigned int number;
2840 error (_(
"Instruction number out of range."));
2848 error (_(
"No such instruction."));
2891 if (args != NULL && *args != 0)
2892 error (_(
"Invalid argument."));
2900 catch (
const gdb_exception &exception)
2912 if (args != NULL && *args != 0)
2913 error (_(
"Invalid argument."));
2921 catch (
const gdb_exception &exception)
2933 if (args != NULL && *args != 0)
2934 error (_(
"Invalid argument."));
2942 catch (
const gdb_exception_error &exception)
2950 catch (
const gdb_exception &ex)
2964 gdb_printf (file, _(
"Replay memory access is %s.\n"),
2973 if (args !=
nullptr && *args != 0)
2974 error (_(
"Trailing junk: '%s'."), args);
2984 if (args !=
nullptr && *args != 0)
2985 error (_(
"Trailing junk: '%s'."), args);
2995 if (args ==
nullptr)
2999 unsigned int family, model, stepping;
3000 int l1, l2, matches = sscanf (args,
"intel: %u/%u%n/%u%n", &family,
3001 &model, &l1, &stepping, &l2);
3004 if (strlen (args) != l2)
3005 error (_(
"Trailing junk: '%s'."), args + l2);
3007 else if (matches == 2)
3009 if (strlen (args) != l1)
3010 error (_(
"Trailing junk: '%s'."), args + l1);
3015 error (_(
"Bad format. See \"help set record btrace cpu\"."));
3017 if (USHRT_MAX < family)
3018 error (_(
"Cpu family too big."));
3020 if (UCHAR_MAX < model)
3021 error (_(
"Cpu model too big."));
3023 if (UCHAR_MAX < stepping)
3024 error (_(
"Cpu stepping too big."));
3039 if (args !=
nullptr && *args != 0)
3040 error (_(
"Trailing junk: '%s'."), args);
3057 gdb_printf (_(
"btrace cpu is 'intel: %u/%u'.\n"),
3061 gdb_printf (_(
"btrace cpu is 'intel: %u/%u/%u'.\n"),
3069 error (_(
"Internal error: bad cpu state."));
3079 gdb_printf (file, _(
"The record/replay bts buffer size is %s.\n"),
3090 gdb_printf (file, _(
"The record/replay pt buffer size is %s.\n"),
3102 _(
"Start branch trace recording."),
3109Start branch trace recording in Branch Trace Store (BTS) format.\n\n\
3110The processor stores a from/to record for each branch into a cyclic buffer.\n\
3111This format may not be available on all processors."),
3119Start branch trace recording in Intel Processor Trace format.\n\n\
3120This format may not be available on all processors."),
3125 _(
"Set record options."),
3126 _(
"Show record options."),
3133Set what memory accesses are allowed during replay."), _(
"\
3134Show what memory accesses are allowed during replay."),
3135 _(
"Default is READ-ONLY.\n\n\
3136The btrace record target does not trace data.\n\
3137The memory therefore corresponds to the live target and not \
3138to the current replay position.\n\n\
3139When READ-ONLY, allow accesses to read-only memory during replay.\n\
3140When READ-WRITE, allow accesses to read-only and read-write memory during \
3148Set the cpu to be used for trace decode.\n\n\
3149The format is \"VENDOR:IDENTIFIER\" or \"none\" or \"auto\" (default).\n\
3150For vendor \"intel\" the format is \"FAMILY/MODEL[/STEPPING]\".\n\n\
3151When decoding branch trace, enable errata workarounds for the specified cpu.\n\
3152The default is \"auto\", which uses the cpu on which the trace was recorded.\n\
3153When GDB does not support that cpu, this option can be used to enable\n\
3154workarounds for a similar cpu that GDB supports.\n\n\
3155When set to \"none\", errata workarounds are disabled."),
3161Automatically determine the cpu to be used for trace decode."),
3165Do not enable errata workarounds for trace decode."),
3169Show the cpu to be used for trace decode."),
3173 _(
"Set record btrace bts options."),
3174 _(
"Show record btrace bts options."),
3182 _(
"Set the record/replay bts buffer size."),
3183 _(
"Show the record/replay bts buffer size."), _(
"\
3184When starting recording request a trace buffer of this size. \
3185The actual buffer size may differ from the requested size. \
3186Use \"info record\" to see the actual buffer size.\n\n\
3187Bigger buffers allow longer recording but also take more time to process \
3188the recorded execution trace.\n\n\
3189The trace buffer size may not be changed while recording."), NULL,
3195 _(
"Set record btrace pt options."),
3196 _(
"Show record btrace pt options."),
3204 _(
"Set the record/replay pt buffer size."),
3205 _(
"Show the record/replay pt buffer size."), _(
"\
3206Bigger buffers allow longer recording but also take more time to process \
3207the recorded execution.\n\
3208The actual buffer size may differ from the requested size. Use \"info record\" \
void * xcalloc(size_t number, size_t size)
struct gdbarch * target_gdbarch(void)
void mark_async_event_handler(async_event_handler *async_handler_ptr)
async_event_handler * create_async_event_handler(async_event_handler_func *proc, gdb_client_data client_data, const char *name)
void clear_async_event_handler(async_event_handler *async_handler_ptr)
void delete_async_event_handler(async_event_handler **async_handler_ptr)
void btrace_enable(struct thread_info *tp, const struct btrace_config *conf)
const struct btrace_function * btrace_call_get(const struct btrace_call_iterator *it)
unsigned int btrace_call_prev(struct btrace_call_iterator *it, unsigned int stride)
unsigned int btrace_call_next(struct btrace_call_iterator *it, unsigned int stride)
unsigned int btrace_call_number(const struct btrace_call_iterator *it)
void btrace_insn_end(struct btrace_insn_iterator *it, const struct btrace_thread_info *btinfo)
int btrace_insn_cmp(const struct btrace_insn_iterator *lhs, const struct btrace_insn_iterator *rhs)
int btrace_find_insn_by_number(struct btrace_insn_iterator *it, const struct btrace_thread_info *btinfo, unsigned int number)
unsigned int btrace_insn_prev(struct btrace_insn_iterator *it, unsigned int stride)
const char * btrace_decode_error(enum btrace_format format, int errcode)
int btrace_find_call_by_number(struct btrace_call_iterator *it, const struct btrace_thread_info *btinfo, unsigned int number)
void btrace_set_insn_history(struct btrace_thread_info *btinfo, const struct btrace_insn_iterator *begin, const struct btrace_insn_iterator *end)
void btrace_disable(struct thread_info *tp)
void btrace_fetch(struct thread_info *tp, const struct btrace_cpu *cpu)
void btrace_set_call_history(struct btrace_thread_info *btinfo, const struct btrace_call_iterator *begin, const struct btrace_call_iterator *end)
const struct btrace_config * btrace_conf(const struct btrace_thread_info *btinfo)
unsigned int btrace_insn_next(struct btrace_insn_iterator *it, unsigned int stride)
const struct btrace_insn * btrace_insn_get(const struct btrace_insn_iterator *it)
void btrace_teardown(struct thread_info *tp)
unsigned int btrace_insn_number(const struct btrace_insn_iterator *it)
int btrace_insn_get_error(const struct btrace_insn_iterator *it)
int btrace_is_empty(struct thread_info *tp)
void btrace_insn_begin(struct btrace_insn_iterator *it, const struct btrace_thread_info *btinfo)
void btrace_call_end(struct btrace_call_iterator *it, const struct btrace_thread_info *btinfo)
int btrace_is_replaying(struct thread_info *tp)
int btrace_call_cmp(const struct btrace_call_iterator *lhs, const struct btrace_call_iterator *rhs)
@ BFUN_UP_LINKS_TO_TAILCALL
@ BTRACE_INSN_FLAG_SPECULATIVE
ui_file_style style() const
int pretty_print_insn(const struct disasm_insn *insn, gdb_disassembly_flags flags)
int unpush_target(struct target_ops *t)
void push_target(struct target_ops *t)
struct process_stratum_target * process_target()
struct address_space * aspace
inf_non_exited_threads_range non_exited_threads()
target_ops * target_at(enum strata stratum)
thread_info * find_thread(ptid_t ptid)
void stop_recording() override
void call_history_range(ULONGEST begin, ULONGEST end, record_print_flags flags) override
void async(bool) override
void fetch_registers(struct regcache *, int) override
enum record_method record_method(ptid_t ptid) override
void record_stop_replaying() override
void info_record() override
ptid_t wait(ptid_t, struct target_waitstatus *, target_wait_flags) override
enum exec_direction_kind execution_direction() override
bool stopped_by_hw_breakpoint() override
void insn_history(int size, gdb_disassembly_flags flags) override
bool stopped_by_sw_breakpoint() override
void goto_record_end() override
void prepare_to_store(struct regcache *) override
void mourn_inferior() override
void call_history_from(ULONGEST begin, int size, record_print_flags flags) override
void detach(inferior *inf, int from_tty) override
void update_thread_list() override
bool supports_stopped_by_hw_breakpoint() override
void goto_record_begin() override
void store_registers(struct regcache *, int) override
bool supports_stopped_by_sw_breakpoint() override
void insn_history_from(ULONGEST from, int size, gdb_disassembly_flags flags) override
bool can_execute_reverse() override
int insert_breakpoint(struct gdbarch *, struct bp_target_info *) override
bool record_is_replaying(ptid_t ptid) override
const struct frame_unwind * get_tailcall_unwinder() override
enum target_xfer_status xfer_partial(enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) override
bool record_will_replay(ptid_t ptid, int dir) override
strata stratum() const override
const struct frame_unwind * get_unwinder() override
bool thread_alive(ptid_t ptid) override
int remove_breakpoint(struct gdbarch *, struct bp_target_info *, enum remove_bp_reason) override
void prepare_to_generate_core() override
void goto_record(ULONGEST insn) override
void call_history(int size, record_print_flags flags) override
void resume(ptid_t, int, enum gdb_signal) override
void insn_history_range(ULONGEST begin, ULONGEST end, gdb_disassembly_flags flags) override
void done_generating_core() override
const target_info & info() const override
void disconnect(const char *, int) override
void raw_supply(int regnum, const void *buf) override
void set_stop_pc(CORE_ADDR stop_pc)
thread_control_state control
void begin(ui_out_type type, const char *id)
void field_string(const char *fldname, const char *string, const ui_file_style &style=ui_file_style())
void field_fmt(const char *fldname, const char *format,...) ATTRIBUTE_PRINTF(3
void field_signed(const char *fldname, LONGEST value)
void text(const char *string)
bool is_mi_like_p() const
void field_unsigned(const char *fldname, ULONGEST value)
void end(ui_out_type type)
struct cmd_list_element * add_alias_cmd(const char *name, cmd_list_element *target, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
set_show_commands add_setshow_uinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const literal_def *extra_literals, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands 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_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands add_setshow_prefix_cmd(const char *name, command_class theclass, const char *set_doc, const char *show_doc, cmd_list_element **set_subcommands_list, cmd_list_element **show_subcommands_list, cmd_list_element **set_list, cmd_list_element **show_list)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list)
cli_style_option function_name_style
cli_style_option file_name_style
int number_is_in_list(const char *list, int number)
@ DISASSEMBLY_SPECULATIVE
int gdb_insn_length(struct gdbarch *gdbarch, CORE_ADDR addr)
struct value * frame_unwind_got_address(frame_info_ptr frame, int regnum, CORE_ADDR addr)
frame_info_ptr get_next_frame(frame_info_ptr this_frame)
struct frame_id frame_id_build_unavailable_stack_special(CORE_ADDR code_addr, CORE_ADDR special_addr)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
CORE_ADDR get_frame_func(frame_info_ptr this_frame)
frame_info_ptr get_selected_frame(const char *message)
frame_info_ptr get_current_frame(void)
struct frame_id get_frame_id(frame_info_ptr fi)
void print_stack_frame(frame_info_ptr, int print_level, enum print_what print_what, int set_current_sal)
#define FRAME_OBSTACK_ZALLOC(TYPE)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
void execute_command(const char *, int)
all_non_exited_threads_range all_non_exited_threads(process_stratum_target *proc_target=nullptr, ptid_t filter_ptid=minus_one_ptid)
void validate_registers_access(void)
void set_executing(process_stratum_target *targ, ptid_t ptid, bool executing)
struct thread_info * inferior_thread(void)
void switch_to_thread(struct thread_info *thr)
const char * print_thread_id(struct thread_info *thr)
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly 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
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
void inferior_event_handler(enum inferior_event_type event_type)
struct inferior * current_inferior(void)
void interps_notify_record_changed(inferior *inf, int started, const char *method, const char *format)
static const char * range
observable< struct thread_info * > new_thread
void _initialize_record_btrace()
static void record_btrace_print_conf(const struct btrace_config *conf)
static struct btrace_line_range btrace_line_range_add(struct btrace_line_range range, int line)
static struct cmd_list_element * set_record_btrace_pt_cmdlist
static struct cmd_list_element * show_record_btrace_pt_cmdlist
static struct btrace_line_range btrace_find_line_range(CORE_ADDR pc)
static const char replay_memory_access_read_only[]
static const char * btrace_thread_flag_to_str(btrace_thread_flags flag)
static struct target_waitstatus btrace_step_again(void)
static void btrace_compute_src_line_range(const struct btrace_function *bfun, int *pbegin, int *pend)
static int bfcache_eq(const void *arg1, const void *arg2)
static void record_btrace_maybe_mark_async_event(const std::vector< thread_info * > &moving, const std::vector< thread_info * > &no_history)
static void record_btrace_stop_replaying_at_end(struct thread_info *tp)
static void record_btrace_set_replay(struct thread_info *tp, const struct btrace_insn_iterator *it)
static struct thread_info * require_btrace_thread(void)
static void cmd_record_btrace_pt_start(const char *args, int from_tty)
static void cmd_show_record_btrace_cpu(const char *args, int from_tty)
static struct async_event_handler * record_btrace_async_inferior_event_handler
static void cmd_set_record_btrace_cpu_auto(const char *args, int from_tty)
static void record_btrace_cancel_resume(struct thread_info *tp)
static void record_btrace_auto_disable(void)
static void record_btrace_stop_replaying(struct thread_info *tp)
static const gdb::observers::token record_btrace_thread_observer_token
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 btrace_print_lines(struct btrace_line_range lines, struct ui_out *uiout, gdb::optional< ui_out_emit_tuple > *src_and_asm_tuple, gdb::optional< ui_out_emit_list > *asm_list, gdb_disassembly_flags flags)
static hashval_t bfcache_hash(const void *arg)
static record_btrace_target record_btrace_ops
static struct btrace_cpu record_btrace_cpu
static enum record_btrace_cpu_state_kind record_btrace_cpu_state
record_btrace_cpu_state_kind
const struct frame_unwind record_btrace_frame_unwind
static void cmd_show_replay_memory_access(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void record_btrace_clear_histories(struct btrace_thread_info *btinfo)
static struct cmd_list_element * show_record_btrace_cmdlist
static void cmd_set_record_btrace_cpu(const char *args, int from_tty)
static struct btrace_insn_iterator * record_btrace_start_replaying(struct thread_info *tp)
static const char * replay_memory_access
static struct btrace_line_range btrace_mk_line_range(struct symtab *symtab, int begin, int end)
#define DEBUG(msg, args...)
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)
static void btrace_call_history_insn_range(struct ui_out *uiout, const struct btrace_function *bfun)
static void record_btrace_print_bts_conf(const struct btrace_config_bts *conf)
static struct target_waitstatus btrace_step_spurious(void)
static struct value * record_btrace_frame_prev_register(frame_info_ptr this_frame, void **this_cache, int regnum)
static void cmd_set_record_btrace_cpu_none(const char *args, int from_tty)
static const char replay_memory_access_read_write[]
static void cmd_record_btrace_bts_start(const char *args, int from_tty)
static struct target_waitstatus btrace_step_stopped(void)
static struct target_waitstatus record_btrace_single_step_backward(struct thread_info *tp)
const struct btrace_cpu * record_btrace_get_cpu(void)
static void cmd_record_btrace_start(const char *args, int from_tty)
static struct target_waitstatus record_btrace_single_step_forward(struct thread_info *tp)
static struct target_waitstatus btrace_step_stopped_on_request(void)
static void record_btrace_print_pt_conf(const struct btrace_config_pt *conf)
static void btrace_call_history_src_line(struct ui_out *uiout, const struct btrace_function *bfun)
static void btrace_ui_out_decode_error(struct ui_out *uiout, int errcode, enum btrace_format format)
static enum exec_direction_kind record_btrace_resume_exec_dir
static struct cmd_list_element * show_record_btrace_bts_cmdlist
static struct frame_id get_thread_current_frame_id(struct thread_info *tp)
static int record_btrace_generating_corefile
static void record_btrace_handle_async_inferior_event(gdb_client_data data)
const struct frame_unwind record_btrace_tailcall_frame_unwind
void record_btrace_push_target(void)
static struct target_waitstatus record_btrace_step_thread(struct thread_info *tp)
static int record_btrace_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_cache)
static struct cmd_list_element * set_record_btrace_cmdlist
static void record_btrace_resume_thread(struct thread_info *tp, enum btrace_thread_flag flag)
static void record_btrace_target_open(const char *args, int from_tty)
static int btrace_line_range_contains_range(struct btrace_line_range lhs, struct btrace_line_range rhs)
static int record_btrace_tailcall_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_cache)
static struct btrace_thread_info * require_btrace(void)
static struct btrace_config record_btrace_conf
static void record_btrace_frame_this_id(frame_info_ptr this_frame, void **this_cache, struct frame_id *this_id)
static struct target_waitstatus btrace_step_no_resumed(void)
static int btrace_line_range_is_empty(struct btrace_line_range range)
static void record_btrace_on_new_thread(struct thread_info *tp)
static void show_record_pt_buffer_size_value(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static const char * btrace_get_bfun_name(const struct btrace_function *bfun)
static struct target_waitstatus btrace_step_no_history(void)
static void record_btrace_frame_dealloc_cache(frame_info *self, void *this_cache)
static void show_record_bts_buffer_size_value(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static const char *const replay_memory_access_types[]
static struct cmd_list_element * record_btrace_cmdlist
static const char * record_btrace_adjust_size(unsigned int *size)
static struct cmd_list_element * set_record_btrace_cpu_cmdlist
static void record_btrace_auto_enable(void)
static enum unwind_stop_reason record_btrace_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
static const target_info record_btrace_target_info
static struct btrace_frame_cache * bfcache_new(frame_info_ptr frame)
static const struct btrace_function * btrace_get_frame_function(frame_info_ptr frame)
static struct cmd_list_element * set_record_btrace_bts_cmdlist
static int record_btrace_replay_at_breakpoint(struct thread_info *tp)
void record_detach(struct target_ops *t, inferior *inf, int from_tty)
struct cmd_list_element * set_record_cmdlist
struct cmd_list_element * show_record_cmdlist
struct cmd_list_element * record_cmdlist
void record_preopen(void)
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)
@ RECORD_PRINT_INSN_RANGE
@ RECORD_PRINT_INDENT_CALLS
CORE_ADDR regcache_read_pc(struct regcache *regcache)
void registers_changed_thread(thread_info *thread)
struct regcache * get_current_regcache(void)
const char * symtab_to_filename_for_display(struct symtab *symtab)
void print_source_lines(struct symtab *s, int line, int stopline, print_source_lines_flags flags)
@ PRINT_SOURCE_LINES_FILENAME
struct btrace_call_iterator begin
struct btrace_call_iterator end
const struct btrace_thread_info * btinfo
const struct btrace_function * bfun
btrace_function_flags flags
struct minimal_symbol * msym
std::vector< btrace_insn > insn
struct btrace_insn_iterator begin
struct btrace_insn_iterator end
const struct btrace_thread_info * btinfo
std::vector< btrace_function > functions
btrace_thread_flags flags
struct btrace_insn_iterator * replay
struct btrace_call_history * call_history
enum target_stop_reason stop_reason
struct btrace_insn_history * insn_history
struct objfile * objfile() const
unsigned int is_speculative
const char * print_name() const
struct linetable_entry item[1]
CORE_ADDR text_section_offset() const
void add_thread(thread_info *thread)
DISABLE_COPY_AND_ASSIGN(scoped_btrace_disable)
scoped_btrace_disable()=default
std::forward_list< thread_info * > m_threads
struct compunit_symtab * compunit() const
const struct linetable * linetable() const
virtual ptid_t wait(ptid_t, struct target_waitstatus *, target_wait_flags options) TARGET_DEFAULT_FUNC(default_target_wait)
virtual int remove_breakpoint(struct gdbarch *, struct bp_target_info *, enum remove_bp_reason) TARGET_DEFAULT_NORETURN(noprocess())
virtual void fetch_registers(struct regcache *, int) TARGET_DEFAULT_IGNORE()
virtual bool stopped_by_sw_breakpoint() TARGET_DEFAULT_RETURN(false)
target_ops * beneath() const
virtual void store_registers(struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
virtual enum target_xfer_status xfer_partial(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)
virtual gdb::array_view< const_gdb_byte > virtual thread_info_to_thread_handle(struct thread_info *) TARGET_DEFAULT_RETURN(gdb voi stop)(ptid_t) TARGET_DEFAULT_IGNORE()
virtual bool supports_stopped_by_sw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual bool stopped_by_hw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual void async(bool) TARGET_DEFAULT_NORETURN(tcomplain())
virtual bool supports_stopped_by_hw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual void resume(ptid_t, int TARGET_DEBUG_PRINTER(target_debug_print_step), enum gdb_signal) TARGET_DEFAULT_NORETURN(noprocess())
virtual void update_thread_list() TARGET_DEFAULT_IGNORE()
virtual void prepare_to_store(struct regcache *) TARGET_DEFAULT_NORETURN(noprocess())
virtual bool thread_alive(ptid_t ptid) TARGET_DEFAULT_RETURN(false)
virtual void disconnect(const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
virtual int insert_breakpoint(struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_NORETURN(noprocess())
virtual const struct btrace_config * btrace_conf(const struct btrace_target_info *) TARGET_DEFAULT_RETURN(NULL)
struct bfd_section * the_bfd_section
target_waitstatus & set_spurious()
target_waitstatus & set_no_resumed()
target_waitstatus & set_stopped(gdb_signal sig)
target_waitstatus & set_ignore()
target_waitstatus & set_no_history()
struct symtab * find_pc_line_symtab(CORE_ADDR pc)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
void target_async(bool enable)
const struct target_section * target_section_by_addr(struct target_ops *target, CORE_ADDR addr)
bool target_can_async_p()
bool target_has_execution(inferior *inf)
void add_target(const target_info &t, target_open_ftype *func, completer_ftype *completer)
bool target_is_non_stop_p()
std::string target_pid_to_str(ptid_t ptid)
@ TARGET_XFER_UNAVAILABLE
void gdb_printf(struct ui_file *stream, const char *format,...)
@ TARGET_WAITKIND_SPURIOUS
@ TARGET_WAITKIND_NO_HISTORY
@ TARGET_STOPPED_BY_SW_BREAKPOINT
@ TARGET_STOPPED_BY_HW_BREAKPOINT