--- target-alpha/translate.c (revision 181278) +++ target-alpha/translate.c (local) @@ -2047,7 +2047,6 @@ int gen_intermediate_code_internal (CPUS lj++; while (lj <= j) gen_opc_instr_start[lj++] = 0; - tb->size = 0; } else { tb->size = ctx.pc - pc_start; } --- target-arm/translate.c (revision 181278) +++ target-arm/translate.c (local) @@ -3656,7 +3656,6 @@ static inline int gen_intermediate_code_ lj++; while (lj <= j) gen_opc_instr_start[lj++] = 0; - tb->size = 0; } else { tb->size = dc->pc - pc_start; } --- target-m68k/translate.c (revision 181278) +++ target-m68k/translate.c (local) @@ -3260,7 +3260,6 @@ gen_intermediate_code_internal(CPUState lj++; while (lj <= j) gen_opc_instr_start[lj++] = 0; - tb->size = 0; } else { tb->size = dc->pc - pc_start; } --- target-mips/translate.c (revision 181278) +++ target-mips/translate.c (local) @@ -5882,10 +5882,6 @@ static void decode_opc (CPUState *env, D generate_exception(ctx, EXCP_SYSCALL); break; case OPC_BREAK: - /* XXX: Hack to work around wrong handling of self-modifying code. */ - ctx->pc += 4; - save_cpu_state(ctx, 1); - ctx->pc -= 4; generate_exception(ctx, EXCP_BREAK); break; case OPC_SPIM: @@ -6433,6 +6429,9 @@ gen_intermediate_code_internal (CPUState save_cpu_state(&ctx, 1); ctx.bstate = BS_BRANCH; gen_op_debug(); + /* Include the breakpoint location or the tb won't + * be flushed when it must be. */ + ctx.pc += 4; goto done_generating; } } @@ -6493,7 +6492,6 @@ done_generating: lj++; while (lj <= j) gen_opc_instr_start[lj++] = 0; - tb->size = 0; } else { tb->size = ctx.pc - pc_start; } --- target-ppc/translate.c (revision 181278) +++ target-ppc/translate.c (local) @@ -5878,7 +5878,6 @@ static inline int gen_intermediate_code_ lj++; while (lj <= j) gen_opc_instr_start[lj++] = 0; - tb->size = 0; } else { tb->size = ctx.nip - pc_start; } --- target-sh4/translate.c (revision 181278) +++ target-sh4/translate.c (local) @@ -1242,7 +1242,6 @@ gen_intermediate_code_internal(CPUState ii++; while (ii <= i) gen_opc_instr_start[ii++] = 0; - tb->size = 0; } else { tb->size = ctx.pc - pc_start; } --- target-sparc/translate.c (revision 181278) +++ target-sparc/translate.c (local) @@ -3365,7 +3365,6 @@ static inline int gen_intermediate_code_ lj++; while (lj <= j) gen_opc_instr_start[lj++] = 0; - tb->size = 0; #if 0 if (loglevel > 0) { page_dump(logfile);