[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/17] target/i386: Use cpu_breakpoint_test in breakpoint_handler
From: |
Richard Henderson |
Subject: |
[PATCH 01/17] target/i386: Use cpu_breakpoint_test in breakpoint_handler |
Date: |
Thu, 1 Jul 2021 08:25:21 -0700 |
The loop is performing a simple boolean test for the existence
of a BP_CPU breakpoint at EIP. Plus it gets the iteration wrong,
if we happen to have a BP_GDB breakpoint at the same address.
We have a function for this: cpu_breakpoint_test.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/tcg/sysemu/bpt_helper.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/target/i386/tcg/sysemu/bpt_helper.c
b/target/i386/tcg/sysemu/bpt_helper.c
index 9bdf7e170b..f1fb479ad9 100644
--- a/target/i386/tcg/sysemu/bpt_helper.c
+++ b/target/i386/tcg/sysemu/bpt_helper.c
@@ -210,7 +210,6 @@ void breakpoint_handler(CPUState *cs)
{
X86CPU *cpu = X86_CPU(cs);
CPUX86State *env = &cpu->env;
- CPUBreakpoint *bp;
if (cs->watchpoint_hit) {
if (cs->watchpoint_hit->flags & BP_CPU) {
@@ -222,14 +221,9 @@ void breakpoint_handler(CPUState *cs)
}
}
} else {
- QTAILQ_FOREACH(bp, &cs->breakpoints, entry) {
- if (bp->pc == env->eip) {
- if (bp->flags & BP_CPU) {
- check_hw_breakpoints(env, true);
- raise_exception(env, EXCP01_DB);
- }
- break;
- }
+ if (cpu_breakpoint_test(cs, env->eip, BP_CPU)) {
+ check_hw_breakpoints(env, true);
+ raise_exception(env, EXCP01_DB);
}
}
}
--
2.25.1
- [PATCH 00/17] tcg: breakpoint reorg, Richard Henderson, 2021/07/01
- [PATCH 02/17] accel/tcg: Move helper_lookup_tb_ptr to cpu-exec.c, Richard Henderson, 2021/07/01
- [PATCH 06/17] tcg: Remove TCG_TARGET_HAS_goto_ptr, Richard Henderson, 2021/07/01
- [PATCH 01/17] target/i386: Use cpu_breakpoint_test in breakpoint_handler,
Richard Henderson <=
- [PATCH 07/17] accel/tcg: Reduce CF_COUNT_MASK to match TCG_MAX_INSNS, Richard Henderson, 2021/07/01
- [PATCH 05/17] accel/tcg: Log tb->cflags with -d exec, Richard Henderson, 2021/07/01
- [PATCH 04/17] accel/tcg: Split out log_cpu_exec, Richard Henderson, 2021/07/01
- [PATCH 03/17] accel/tcg: Move tb_lookup to cpu-exec.c, Richard Henderson, 2021/07/01
- [PATCH 13/17] accel/tcg: Move cflags lookup into tb_find, Richard Henderson, 2021/07/01
- [PATCH 11/17] accel/tcg: Handle -singlestep in curr_cflags, Richard Henderson, 2021/07/01
- [PATCH 12/17] accel/tcg: Use CF_NO_GOTO_{TB, PTR} in cpu_exec_step_atomic, Richard Henderson, 2021/07/01
- [PATCH 17/17] cpu: Add breakpoint tracepoints, Richard Henderson, 2021/07/01