Commit ce62e5ba096920a82b47c9ba62f35573bd61f546
1 parent
408e7837
Fix tb->size mishandling, by Daniel Jacobowitz.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3160 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
7 changed files
with
3 additions
and
11 deletions
target-alpha/translate.c
| @@ -2047,7 +2047,6 @@ int gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb, | @@ -2047,7 +2047,6 @@ int gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb, | ||
| 2047 | lj++; | 2047 | lj++; |
| 2048 | while (lj <= j) | 2048 | while (lj <= j) |
| 2049 | gen_opc_instr_start[lj++] = 0; | 2049 | gen_opc_instr_start[lj++] = 0; |
| 2050 | - tb->size = 0; | ||
| 2051 | } else { | 2050 | } else { |
| 2052 | tb->size = ctx.pc - pc_start; | 2051 | tb->size = ctx.pc - pc_start; |
| 2053 | } | 2052 | } |
target-arm/translate.c
| @@ -3656,7 +3656,6 @@ static inline int gen_intermediate_code_internal(CPUState *env, | @@ -3656,7 +3656,6 @@ static inline int gen_intermediate_code_internal(CPUState *env, | ||
| 3656 | lj++; | 3656 | lj++; |
| 3657 | while (lj <= j) | 3657 | while (lj <= j) |
| 3658 | gen_opc_instr_start[lj++] = 0; | 3658 | gen_opc_instr_start[lj++] = 0; |
| 3659 | - tb->size = 0; | ||
| 3660 | } else { | 3659 | } else { |
| 3661 | tb->size = dc->pc - pc_start; | 3660 | tb->size = dc->pc - pc_start; |
| 3662 | } | 3661 | } |
target-m68k/translate.c
| @@ -3260,7 +3260,6 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb, | @@ -3260,7 +3260,6 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb, | ||
| 3260 | lj++; | 3260 | lj++; |
| 3261 | while (lj <= j) | 3261 | while (lj <= j) |
| 3262 | gen_opc_instr_start[lj++] = 0; | 3262 | gen_opc_instr_start[lj++] = 0; |
| 3263 | - tb->size = 0; | ||
| 3264 | } else { | 3263 | } else { |
| 3265 | tb->size = dc->pc - pc_start; | 3264 | tb->size = dc->pc - pc_start; |
| 3266 | } | 3265 | } |
target-mips/translate.c
| @@ -5882,10 +5882,6 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | @@ -5882,10 +5882,6 @@ static void decode_opc (CPUState *env, DisasContext *ctx) | ||
| 5882 | generate_exception(ctx, EXCP_SYSCALL); | 5882 | generate_exception(ctx, EXCP_SYSCALL); |
| 5883 | break; | 5883 | break; |
| 5884 | case OPC_BREAK: | 5884 | case OPC_BREAK: |
| 5885 | - /* XXX: Hack to work around wrong handling of self-modifying code. */ | ||
| 5886 | - ctx->pc += 4; | ||
| 5887 | - save_cpu_state(ctx, 1); | ||
| 5888 | - ctx->pc -= 4; | ||
| 5889 | generate_exception(ctx, EXCP_BREAK); | 5885 | generate_exception(ctx, EXCP_BREAK); |
| 5890 | break; | 5886 | break; |
| 5891 | case OPC_SPIM: | 5887 | case OPC_SPIM: |
| @@ -6433,6 +6429,9 @@ gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb, | @@ -6433,6 +6429,9 @@ gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb, | ||
| 6433 | save_cpu_state(&ctx, 1); | 6429 | save_cpu_state(&ctx, 1); |
| 6434 | ctx.bstate = BS_BRANCH; | 6430 | ctx.bstate = BS_BRANCH; |
| 6435 | gen_op_debug(); | 6431 | gen_op_debug(); |
| 6432 | + /* Include the breakpoint location or the tb won't | ||
| 6433 | + * be flushed when it must be. */ | ||
| 6434 | + ctx.pc += 4; | ||
| 6436 | goto done_generating; | 6435 | goto done_generating; |
| 6437 | } | 6436 | } |
| 6438 | } | 6437 | } |
| @@ -6493,7 +6492,6 @@ done_generating: | @@ -6493,7 +6492,6 @@ done_generating: | ||
| 6493 | lj++; | 6492 | lj++; |
| 6494 | while (lj <= j) | 6493 | while (lj <= j) |
| 6495 | gen_opc_instr_start[lj++] = 0; | 6494 | gen_opc_instr_start[lj++] = 0; |
| 6496 | - tb->size = 0; | ||
| 6497 | } else { | 6495 | } else { |
| 6498 | tb->size = ctx.pc - pc_start; | 6496 | tb->size = ctx.pc - pc_start; |
| 6499 | } | 6497 | } |
target-ppc/translate.c
| @@ -5878,7 +5878,6 @@ static inline int gen_intermediate_code_internal (CPUState *env, | @@ -5878,7 +5878,6 @@ static inline int gen_intermediate_code_internal (CPUState *env, | ||
| 5878 | lj++; | 5878 | lj++; |
| 5879 | while (lj <= j) | 5879 | while (lj <= j) |
| 5880 | gen_opc_instr_start[lj++] = 0; | 5880 | gen_opc_instr_start[lj++] = 0; |
| 5881 | - tb->size = 0; | ||
| 5882 | } else { | 5881 | } else { |
| 5883 | tb->size = ctx.nip - pc_start; | 5882 | tb->size = ctx.nip - pc_start; |
| 5884 | } | 5883 | } |
target-sh4/translate.c
| @@ -1242,7 +1242,6 @@ gen_intermediate_code_internal(CPUState * env, TranslationBlock * tb, | @@ -1242,7 +1242,6 @@ gen_intermediate_code_internal(CPUState * env, TranslationBlock * tb, | ||
| 1242 | ii++; | 1242 | ii++; |
| 1243 | while (ii <= i) | 1243 | while (ii <= i) |
| 1244 | gen_opc_instr_start[ii++] = 0; | 1244 | gen_opc_instr_start[ii++] = 0; |
| 1245 | - tb->size = 0; | ||
| 1246 | } else { | 1245 | } else { |
| 1247 | tb->size = ctx.pc - pc_start; | 1246 | tb->size = ctx.pc - pc_start; |
| 1248 | } | 1247 | } |
target-sparc/translate.c
| @@ -3365,7 +3365,6 @@ static inline int gen_intermediate_code_internal(TranslationBlock * tb, | @@ -3365,7 +3365,6 @@ static inline int gen_intermediate_code_internal(TranslationBlock * tb, | ||
| 3365 | lj++; | 3365 | lj++; |
| 3366 | while (lj <= j) | 3366 | while (lj <= j) |
| 3367 | gen_opc_instr_start[lj++] = 0; | 3367 | gen_opc_instr_start[lj++] = 0; |
| 3368 | - tb->size = 0; | ||
| 3369 | #if 0 | 3368 | #if 0 |
| 3370 | if (loglevel > 0) { | 3369 | if (loglevel > 0) { |
| 3371 | page_dump(logfile); | 3370 | page_dump(logfile); |