mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
target-*: Introduce and use cpu_breakpoint_test
Reduce the boilerplate required for each target. At the same time, move the test for breakpoint after calling tcg_gen_insn_start. Note that arm and aarch64 do not use cpu_breakpoint_test, but still move the inline test down after tcg_gen_insn_start. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
959082fc4a
commit
b933066ae0
18 changed files with 160 additions and 239 deletions
|
@ -822,7 +822,6 @@ gen_intermediate_code_internal(MoxieCPU *cpu, TranslationBlock *tb,
|
|||
CPUState *cs = CPU(cpu);
|
||||
DisasContext ctx;
|
||||
target_ulong pc_start;
|
||||
CPUBreakpoint *bp;
|
||||
int j, lj = -1;
|
||||
CPUMoxieState *env = &cpu->env;
|
||||
int num_insns;
|
||||
|
@ -838,17 +837,6 @@ gen_intermediate_code_internal(MoxieCPU *cpu, TranslationBlock *tb,
|
|||
|
||||
gen_tb_start(tb);
|
||||
do {
|
||||
if (unlikely(!QTAILQ_EMPTY(&cs->breakpoints))) {
|
||||
QTAILQ_FOREACH(bp, &cs->breakpoints, entry) {
|
||||
if (ctx.pc == bp->pc) {
|
||||
tcg_gen_movi_i32(cpu_pc, ctx.pc);
|
||||
gen_helper_debug(cpu_env);
|
||||
ctx.bstate = BS_EXCP;
|
||||
goto done_generating;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (search_pc) {
|
||||
j = tcg_op_buf_count();
|
||||
if (lj < j) {
|
||||
|
@ -864,6 +852,13 @@ gen_intermediate_code_internal(MoxieCPU *cpu, TranslationBlock *tb,
|
|||
tcg_gen_insn_start(ctx.pc);
|
||||
num_insns++;
|
||||
|
||||
if (unlikely(cpu_breakpoint_test(cs, ctx.pc, BP_ANY))) {
|
||||
tcg_gen_movi_i32(cpu_pc, ctx.pc);
|
||||
gen_helper_debug(cpu_env);
|
||||
ctx.bstate = BS_EXCP;
|
||||
goto done_generating;
|
||||
}
|
||||
|
||||
ctx.opcode = cpu_lduw_code(env, ctx.pc);
|
||||
ctx.pc += decode_opc(cpu, &ctx);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue