[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/26] target-alpha: Single-step properly across bra
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 03/26] target-alpha: Single-step properly across branches. |
Date: |
Mon, 23 May 2011 13:28:23 -0700 |
We were failing to generate EXC_DEBUG in the EXIT_PC_UPDATED path.
This caused us not to stop at the instruction after a branch, but
on the instruction afterward.
Signed-off-by: Richard Henderson <address@hidden>
---
target-alpha/translate.c | 35 ++++++++++++++++++++---------------
1 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 456ba51..194a286 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -147,17 +147,21 @@ static void alpha_translate_init(void)
done_init = 1;
}
-static ExitStatus gen_excp(DisasContext *ctx, int exception, int error_code)
+static void gen_excp_1(int exception, int error_code)
{
TCGv_i32 tmp1, tmp2;
- tcg_gen_movi_i64(cpu_pc, ctx->pc);
tmp1 = tcg_const_i32(exception);
tmp2 = tcg_const_i32(error_code);
gen_helper_excp(tmp1, tmp2);
tcg_temp_free_i32(tmp2);
tcg_temp_free_i32(tmp1);
+}
+static ExitStatus gen_excp(DisasContext *ctx, int exception, int error_code)
+{
+ tcg_gen_movi_i64(cpu_pc, ctx->pc);
+ gen_excp_1(exception, error_code);
return EXIT_NORETURN;
}
@@ -3211,18 +3215,15 @@ static inline void
gen_intermediate_code_internal(CPUState *env,
ctx.pc += 4;
ret = translate_one(ctxp, insn);
- if (ret == NO_EXIT) {
- /* If we reach a page boundary, are single stepping,
- or exhaust instruction count, stop generation. */
- if (env->singlestep_enabled) {
- gen_excp(&ctx, EXCP_DEBUG, 0);
- ret = EXIT_PC_UPDATED;
- } else if ((ctx.pc & (TARGET_PAGE_SIZE - 1)) == 0
- || gen_opc_ptr >= gen_opc_end
- || num_insns >= max_insns
- || singlestep) {
- ret = EXIT_PC_STALE;
- }
+ /* If we reach a page boundary, are single stepping,
+ or exhaust instruction count, stop generation. */
+ if (ret == NO_EXIT
+ && ((ctx.pc & (TARGET_PAGE_SIZE - 1)) == 0
+ || gen_opc_ptr >= gen_opc_end
+ || num_insns >= max_insns
+ || singlestep
+ || env->singlestep_enabled)) {
+ ret = EXIT_PC_STALE;
}
} while (ret == NO_EXIT);
@@ -3238,7 +3239,11 @@ static inline void
gen_intermediate_code_internal(CPUState *env,
tcg_gen_movi_i64(cpu_pc, ctx.pc);
/* FALLTHRU */
case EXIT_PC_UPDATED:
- tcg_gen_exit_tb(0);
+ if (env->singlestep_enabled) {
+ gen_excp_1(EXCP_DEBUG, 0);
+ } else {
+ tcg_gen_exit_tb(0);
+ }
break;
default:
abort();
--
1.7.4.4
- [Qemu-devel] [PULL 00/26] Alpha system emulation, v5, Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 01/26] target-alpha: Claim ownership., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 02/26] target-alpha: Disassemble EV6 PALcode instructions., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 03/26] target-alpha: Single-step properly across branches.,
Richard Henderson <=
- [Qemu-devel] [PATCH 04/26] target-alpha: Remove partial support for palcode emulation., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 06/26] target-alpha: Fix system store_conditional, Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 08/26] target-alpha: Merge HW_REI and HW_RET implementations., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 07/26] target-alpha: Cleanup MMU modes., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 05/26] target-alpha: Fix translation of PALmode memory insns., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 09/26] target-alpha: Rationalize internal processor registers., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 12/26] target-alpha: Tidy up arithmetic exceptions., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 13/26] target-alpha: Use do_restore_state for arithmetic exceptions., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 15/26] target-alpha: Use kernel mmu_idx for pal_mode., Richard Henderson, 2011/05/23
- [Qemu-devel] [PATCH 14/26] target-alpha: Add various symbolic constants., Richard Henderson, 2011/05/23