From 522a0d4e3c0d397ffb45ec400d8cbd426dad9d17 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 13 Oct 2015 22:07:49 +0000 Subject: target-*: Advance pc after recognizing a breakpoint Some targets already had this within their logic, but make sure it's present for all targets. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target-arm/translate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'target-arm/translate.c') diff --git a/target-arm/translate.c b/target-arm/translate.c index 6be2c72..b10a455 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -11378,8 +11378,11 @@ void gen_intermediate_code(CPUARMState *env, TranslationBlock *tb) dc->is_jmp = DISAS_UPDATE; } else { gen_exception_internal_insn(dc, 0, EXCP_DEBUG); - /* Advance PC so that clearing the breakpoint will - invalidate this TB. */ + /* The address covered by the breakpoint must be + included in [tb->pc, tb->pc + tb->size) in order + to for it to be properly cleared -- thus we + increment the PC here so that the logic setting + tb->size below does the right thing. */ /* TODO: Advance PC by correct instruction length to * avoid disassembler error messages */ dc->pc += 2; -- cgit v1.1