[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-6.1 v4 10/15] target/arm: Implement debug_check_breakpoint
From: |
Richard Henderson |
Subject: |
[PATCH for-6.1 v4 10/15] target/arm: Implement debug_check_breakpoint |
Date: |
Mon, 19 Jul 2021 11:22:34 -1000 |
Reuse the code at the bottom of helper_check_breakpoints,
which is what we currently call from *_tr_breakpoint_check.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/internals.h | 3 +++
target/arm/cpu.c | 1 +
target/arm/cpu_tcg.c | 1 +
target/arm/debug_helper.c | 7 +++----
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index 3ba86e8af8..11a72013f5 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -282,6 +282,9 @@ void hw_breakpoint_update(ARMCPU *cpu, int n);
*/
void hw_breakpoint_update_all(ARMCPU *cpu);
+/* Callback function for checking if a breakpoint should trigger. */
+bool arm_debug_check_breakpoint(CPUState *cs);
+
/* Callback function for checking if a watchpoint should trigger. */
bool arm_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp);
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 9cddfd6a44..752b15bb79 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -1984,6 +1984,7 @@ static const struct TCGCPUOps arm_tcg_ops = {
.do_unaligned_access = arm_cpu_do_unaligned_access,
.adjust_watchpoint_address = arm_adjust_watchpoint_address,
.debug_check_watchpoint = arm_debug_check_watchpoint,
+ .debug_check_breakpoint = arm_debug_check_breakpoint,
#endif /* !CONFIG_USER_ONLY */
};
#endif /* CONFIG_TCG */
diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c
index d2d97115ea..ed444bf436 100644
--- a/target/arm/cpu_tcg.c
+++ b/target/arm/cpu_tcg.c
@@ -911,6 +911,7 @@ static const struct TCGCPUOps arm_v7m_tcg_ops = {
.do_unaligned_access = arm_cpu_do_unaligned_access,
.adjust_watchpoint_address = arm_adjust_watchpoint_address,
.debug_check_watchpoint = arm_debug_check_watchpoint,
+ .debug_check_breakpoint = arm_debug_check_breakpoint,
#endif /* !CONFIG_USER_ONLY */
};
#endif /* CONFIG_TCG */
diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c
index 2ff72d47d1..4a0c479527 100644
--- a/target/arm/debug_helper.c
+++ b/target/arm/debug_helper.c
@@ -216,8 +216,9 @@ static bool check_watchpoints(ARMCPU *cpu)
return false;
}
-static bool check_breakpoints(ARMCPU *cpu)
+bool arm_debug_check_breakpoint(CPUState *cs)
{
+ ARMCPU *cpu = ARM_CPU(cs);
CPUARMState *env = &cpu->env;
int n;
@@ -240,9 +241,7 @@ static bool check_breakpoints(ARMCPU *cpu)
void HELPER(check_breakpoints)(CPUARMState *env)
{
- ARMCPU *cpu = env_archcpu(env);
-
- if (check_breakpoints(cpu)) {
+ if (arm_debug_check_breakpoint(env_cpu(env))) {
HELPER(exception_internal(env, EXCP_DEBUG));
}
}
--
2.25.1
- [PATCH for-6.1 v4 00/15] tcg: breakpoint reorg, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 01/15] accel/tcg: Reduce CF_COUNT_MASK to match TCG_MAX_INSNS, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 02/15] accel/tcg: Move curr_cflags into cpu-exec.c, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 03/15] target/alpha: Drop goto_tb path in gen_call_pal, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 06/15] accel/tcg: Handle -singlestep in curr_cflags, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 04/15] accel/tcg: Add CF_NO_GOTO_TB and CF_NO_GOTO_PTR, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 05/15] accel/tcg: Drop CF_NO_GOTO_PTR from -d nochain, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 07/15] accel/tcg: Use CF_NO_GOTO_{TB, PTR} in cpu_exec_step_atomic, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 08/15] accel/tcg: Move cflags lookup into tb_find, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 09/15] hw/core: Introduce TCGCPUOps.debug_check_breakpoint, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 10/15] target/arm: Implement debug_check_breakpoint,
Richard Henderson <=
- [PATCH for-6.1 v4 11/15] target/i386: Implement debug_check_breakpoint, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 12/15] accel/tcg: Move breakpoint recognition outside translation, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 14/15] accel/tcg: Hoist tb_cflags to a local in translator_loop, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 15/15] accel/tcg: Record singlestep_enabled in tb->cflags, Richard Henderson, 2021/07/19
- [PATCH for-6.1 v4 13/15] accel/tcg: Remove TranslatorOps.breakpoint_check, Richard Henderson, 2021/07/19