Commit ce62e5ba096920a82b47c9ba62f35573bd61f546

Authored by ths
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
target-alpha/translate.c
... ... @@ -2047,7 +2047,6 @@ int gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb,
2047 2047 lj++;
2048 2048 while (lj <= j)
2049 2049 gen_opc_instr_start[lj++] = 0;
2050   - tb->size = 0;
2051 2050 } else {
2052 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 3656 lj++;
3657 3657 while (lj <= j)
3658 3658 gen_opc_instr_start[lj++] = 0;
3659   - tb->size = 0;
3660 3659 } else {
3661 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 3260 lj++;
3261 3261 while (lj <= j)
3262 3262 gen_opc_instr_start[lj++] = 0;
3263   - tb->size = 0;
3264 3263 } else {
3265 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 5882 generate_exception(ctx, EXCP_SYSCALL);
5883 5883 break;
5884 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 5885 generate_exception(ctx, EXCP_BREAK);
5890 5886 break;
5891 5887 case OPC_SPIM:
... ... @@ -6433,6 +6429,9 @@ gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb,
6433 6429 save_cpu_state(&ctx, 1);
6434 6430 ctx.bstate = BS_BRANCH;
6435 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 6435 goto done_generating;
6437 6436 }
6438 6437 }
... ... @@ -6493,7 +6492,6 @@ done_generating:
6493 6492 lj++;
6494 6493 while (lj <= j)
6495 6494 gen_opc_instr_start[lj++] = 0;
6496   - tb->size = 0;
6497 6495 } else {
6498 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 5878 lj++;
5879 5879 while (lj <= j)
5880 5880 gen_opc_instr_start[lj++] = 0;
5881   - tb->size = 0;
5882 5881 } else {
5883 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 1242 ii++;
1243 1243 while (ii <= i)
1244 1244 gen_opc_instr_start[ii++] = 0;
1245   - tb->size = 0;
1246 1245 } else {
1247 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 3365 lj++;
3366 3366 while (lj <= j)
3367 3367 gen_opc_instr_start[lj++] = 0;
3368   - tb->size = 0;
3369 3368 #if 0
3370 3369 if (loglevel > 0) {
3371 3370 page_dump(logfile);
... ...