target_pid_to_str (tp->ptid),
core_addr_to_string_nz (insn->pc));
- if (breakpoint_here_p (aspace, insn->pc))
+ if (record_check_stopped_by_breakpoint (aspace, insn->pc,
+ &btinfo->stop_reason))
return btrace_step_stopped ();
}
target_pid_to_str (tp->ptid),
core_addr_to_string_nz (insn->pc));
- if (breakpoint_here_p (aspace, insn->pc))
+ if (record_check_stopped_by_breakpoint (aspace, insn->pc,
+ &btinfo->stop_reason))
return btrace_step_stopped ();
}
}
return 1;
}
-/* The to_decr_pc_after_break method of target record-btrace. */
+/* The to_stopped_by_sw_breakpoint method of target record-btrace. */
-static CORE_ADDR
-record_btrace_decr_pc_after_break (struct target_ops *ops,
- struct gdbarch *gdbarch)
+static int
+record_btrace_stopped_by_sw_breakpoint (struct target_ops *ops)
{
- /* 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 (ops))
- return 0;
+ {
+ struct thread_info *tp = inferior_thread ();
+
+ return tp->btrace.stop_reason == TARGET_STOPPED_BY_SW_BREAKPOINT;
+ }
+
+ return ops->beneath->to_stopped_by_sw_breakpoint (ops->beneath);
+}
+
+/* The to_supports_stopped_by_sw_breakpoint method of target
+ record-btrace. */
+
+static int
+record_btrace_supports_stopped_by_sw_breakpoint (struct target_ops *ops)
+{
+ if (record_btrace_is_replaying (ops))
+ return 1;
+
+ return ops->beneath->to_supports_stopped_by_sw_breakpoint (ops->beneath);
+}
+
+/* The to_stopped_by_sw_breakpoint method of target record-btrace. */
+
+static int
+record_btrace_stopped_by_hw_breakpoint (struct target_ops *ops)
+{
+ if (record_btrace_is_replaying (ops))
+ {
+ struct thread_info *tp = inferior_thread ();
+
+ return tp->btrace.stop_reason == TARGET_STOPPED_BY_HW_BREAKPOINT;
+ }
+
+ return ops->beneath->to_stopped_by_hw_breakpoint (ops->beneath);
+}
+
+/* The to_supports_stopped_by_hw_breakpoint method of target
+ record-btrace. */
+
+static int
+record_btrace_supports_stopped_by_hw_breakpoint (struct target_ops *ops)
+{
+ if (record_btrace_is_replaying (ops))
+ return 1;
- return ops->beneath->to_decr_pc_after_break (ops->beneath, gdbarch);
+ return ops->beneath->to_supports_stopped_by_hw_breakpoint (ops->beneath);
}
/* The to_update_thread_list method of target record-btrace. */
ops->to_goto_record_end = record_btrace_goto_end;
ops->to_goto_record = record_btrace_goto;
ops->to_can_execute_reverse = record_btrace_can_execute_reverse;
- ops->to_decr_pc_after_break = record_btrace_decr_pc_after_break;
+ ops->to_stopped_by_sw_breakpoint = record_btrace_stopped_by_sw_breakpoint;
+ ops->to_supports_stopped_by_sw_breakpoint
+ = record_btrace_supports_stopped_by_sw_breakpoint;
+ ops->to_stopped_by_hw_breakpoint = record_btrace_stopped_by_hw_breakpoint;
+ ops->to_supports_stopped_by_hw_breakpoint
+ = record_btrace_supports_stopped_by_hw_breakpoint;
ops->to_execution_direction = record_btrace_execution_direction;
ops->to_prepare_to_generate_core = record_btrace_prepare_to_generate_core;
ops->to_done_generating_core = record_btrace_done_generating_core;