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-mips/translate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'target-mips') diff --git a/target-mips/translate.c b/target-mips/translate.c index 897839c..a10bfa3 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -19594,8 +19594,10 @@ void gen_intermediate_code(CPUMIPSState *env, struct TranslationBlock *tb) save_cpu_state(&ctx, 1); ctx.bstate = BS_BRANCH; gen_helper_raise_exception_debug(cpu_env); - /* Include the breakpoint location or the tb won't - * be flushed when it must be. */ + /* 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. */ ctx.pc += 4; goto done_generating; } -- cgit v1.1