/* The to_info_record method of target record-btrace. */
static void
-record_btrace_info (void)
+record_btrace_info (struct target_ops *self)
{
struct btrace_thread_info *btinfo;
struct thread_info *tp;
/* The to_insn_history method of target record-btrace. */
static void
-record_btrace_insn_history (int size, int flags)
+record_btrace_insn_history (struct target_ops *self, int size, int flags)
{
struct btrace_thread_info *btinfo;
struct btrace_insn_history *history;
/* The to_insn_history_range method of target record-btrace. */
static void
-record_btrace_insn_history_range (ULONGEST from, ULONGEST to, int flags)
+record_btrace_insn_history_range (struct target_ops *self,
+ ULONGEST from, ULONGEST to, int flags)
{
struct btrace_thread_info *btinfo;
struct btrace_insn_history *history;
/* The to_insn_history_from method of target record-btrace. */
static void
-record_btrace_insn_history_from (ULONGEST from, int size, int flags)
+record_btrace_insn_history_from (struct target_ops *self,
+ ULONGEST from, int size, int flags)
{
ULONGEST begin, end, context;
end = ULONGEST_MAX;
}
- record_btrace_insn_history_range (begin, end, flags);
+ record_btrace_insn_history_range (self, begin, end, flags);
}
/* Print the instruction number range for a function call history line. */
if (sym != NULL)
return SYMBOL_PRINT_NAME (sym);
else if (msym != NULL)
- return SYMBOL_PRINT_NAME (msym);
+ return MSYMBOL_PRINT_NAME (msym);
else
return "??";
}
if (sym != NULL)
ui_out_field_string (uiout, "function", SYMBOL_PRINT_NAME (sym));
else if (msym != NULL)
- ui_out_field_string (uiout, "function", SYMBOL_PRINT_NAME (msym));
+ ui_out_field_string (uiout, "function", MSYMBOL_PRINT_NAME (msym));
else if (!ui_out_is_mi_like_p (uiout))
ui_out_field_string (uiout, "function", "??");
/* The to_call_history method of target record-btrace. */
static void
-record_btrace_call_history (int size, int flags)
+record_btrace_call_history (struct target_ops *self, int size, int flags)
{
struct btrace_thread_info *btinfo;
struct btrace_call_history *history;
/* The to_call_history_range method of target record-btrace. */
static void
-record_btrace_call_history_range (ULONGEST from, ULONGEST to, int flags)
+record_btrace_call_history_range (struct target_ops *self,
+ ULONGEST from, ULONGEST to, int flags)
{
struct btrace_thread_info *btinfo;
struct btrace_call_history *history;
/* The to_call_history_from method of target record-btrace. */
static void
-record_btrace_call_history_from (ULONGEST from, int size, int flags)
+record_btrace_call_history_from (struct target_ops *self,
+ ULONGEST from, int size, int flags)
{
ULONGEST begin, end, context;
end = ULONGEST_MAX;
}
- record_btrace_call_history_range (begin, end, flags);
+ record_btrace_call_history_range (self, begin, end, flags);
}
/* The to_record_is_replaying method of target record-btrace. */
static int
-record_btrace_is_replaying (void)
+record_btrace_is_replaying (struct target_ops *self)
{
struct thread_info *tp;
struct target_ops *t;
/* Filter out requests that don't make sense during replay. */
- if (!record_btrace_allow_memory_access && record_btrace_is_replaying ())
+ if (!record_btrace_allow_memory_access && record_btrace_is_replaying (ops))
{
switch (object)
{
if (writebuf != NULL)
{
*xfered_len = len;
- return TARGET_XFER_E_UNAVAILABLE;
+ return TARGET_XFER_UNAVAILABLE;
}
/* We allow reading readonly memory. */
}
*xfered_len = len;
- return TARGET_XFER_E_UNAVAILABLE;
+ return TARGET_XFER_UNAVAILABLE;
}
}
}
offset, len, xfered_len);
*xfered_len = len;
- return TARGET_XFER_E_UNAVAILABLE;
+ return TARGET_XFER_UNAVAILABLE;
}
/* The to_insert_breakpoint method of target record-btrace. */
{
struct target_ops *t;
- if (record_btrace_is_replaying ())
+ if (record_btrace_is_replaying (ops))
error (_("This record target does not allow writing registers."));
gdb_assert (may_write_registers != 0);
{
struct target_ops *t;
- if (record_btrace_is_replaying ())
+ if (record_btrace_is_replaying (ops))
return;
for (t = ops->beneath; t != NULL; t = t->beneath)
record_btrace_frame_dealloc_cache
};
+/* Implement the to_get_unwinder method. */
+
+static const struct frame_unwind *
+record_btrace_to_get_unwinder (struct target_ops *self)
+{
+ return &record_btrace_frame_unwind;
+}
+
+/* Implement the to_get_tailcall_unwinder method. */
+
+static const struct frame_unwind *
+record_btrace_to_get_tailcall_unwinder (struct target_ops *self)
+{
+ return &record_btrace_tailcall_frame_unwind;
+}
+
/* Indicate that TP should be resumed according to FLAG. */
static void
record_btrace_stop_replaying (other);
/* As long as we're not replaying, just forward the request. */
- if (!record_btrace_is_replaying () && execution_direction != EXEC_REVERSE)
+ if (!record_btrace_is_replaying (ops) && execution_direction != EXEC_REVERSE)
{
for (ops = ops->beneath; ops != NULL; ops = ops->beneath)
if (ops->to_resume != NULL)
DEBUG ("wait %s (0x%x)", target_pid_to_str (ptid), options);
/* As long as we're not replaying, just forward the request. */
- if (!record_btrace_is_replaying () && execution_direction != EXEC_REVERSE)
+ if (!record_btrace_is_replaying (ops) && execution_direction != EXEC_REVERSE)
{
for (ops = ops->beneath; ops != NULL; ops = ops->beneath)
if (ops->to_wait != NULL)
{
/* When replaying, we do not actually execute the breakpoint instruction
so there is no need to adjust the PC after hitting a breakpoint. */
- if (record_btrace_is_replaying ())
+ if (record_btrace_is_replaying (ops))
return 0;
- return forward_target_decr_pc_after_break (ops->beneath, gdbarch);
+ return ops->beneath->to_decr_pc_after_break (ops->beneath, gdbarch);
}
/* The to_find_new_threads method of target record-btrace. */
record_btrace_find_new_threads (struct target_ops *ops)
{
/* Don't expect new threads if we're replaying. */
- if (record_btrace_is_replaying ())
+ if (record_btrace_is_replaying (ops))
return;
/* Forward the request. */
record_btrace_thread_alive (struct target_ops *ops, ptid_t ptid)
{
/* We don't add or remove threads during replay. */
- if (record_btrace_is_replaying ())
+ if (record_btrace_is_replaying (ops))
return find_thread_ptid (ptid) != NULL;
/* Forward the request. */
/* The to_goto_record_begin method of target record-btrace. */
static void
-record_btrace_goto_begin (void)
+record_btrace_goto_begin (struct target_ops *self)
{
struct thread_info *tp;
struct btrace_insn_iterator begin;
/* The to_goto_record_end method of target record-btrace. */
static void
-record_btrace_goto_end (void)
+record_btrace_goto_end (struct target_ops *ops)
{
struct thread_info *tp;
/* The to_goto_record method of target record-btrace. */
static void
-record_btrace_goto (ULONGEST insn)
+record_btrace_goto (struct target_ops *self, ULONGEST insn)
{
struct thread_info *tp;
struct btrace_insn_iterator it;
ops->to_fetch_registers = record_btrace_fetch_registers;
ops->to_store_registers = record_btrace_store_registers;
ops->to_prepare_to_store = record_btrace_prepare_to_store;
- ops->to_get_unwinder = &record_btrace_frame_unwind;
- ops->to_get_tailcall_unwinder = &record_btrace_tailcall_frame_unwind;
+ ops->to_get_unwinder = &record_btrace_to_get_unwinder;
+ ops->to_get_tailcall_unwinder = &record_btrace_to_get_tailcall_unwinder;
ops->to_resume = record_btrace_resume;
ops->to_wait = record_btrace_wait;
ops->to_find_new_threads = record_btrace_find_new_threads;