]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Fix tb->size mishandling, by Daniel Jacobowitz.
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 11 Sep 2007 10:04:58 +0000 (10:04 +0000)
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 11 Sep 2007 10:04:58 +0000 (10:04 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3160 c046a42c-6fe2-441c-8c8c-71466251a162

target-alpha/translate.c
target-arm/translate.c
target-m68k/translate.c
target-mips/translate.c
target-ppc/translate.c
target-sh4/translate.c
target-sparc/translate.c

index 77e3b4ec8d1c6d1e03920864bd88ba12cb255490..9ed53be28ba3b67ca4641d4dc963fe24eac67533 100644 (file)
@@ -2047,7 +2047,6 @@ int gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb,
         lj++;
         while (lj <= j)
             gen_opc_instr_start[lj++] = 0;
-        tb->size = 0;
     } else {
         tb->size = ctx.pc - pc_start;
     }
index 799aef2f15b1d118b9b5e25a02caeac8ff66a690..590959c2f65277d00d398c0085bec9dc3292cb30 100644 (file)
@@ -3656,7 +3656,6 @@ static inline int gen_intermediate_code_internal(CPUState *env,
         lj++;
         while (lj <= j)
             gen_opc_instr_start[lj++] = 0;
-        tb->size = 0;
     } else {
         tb->size = dc->pc - pc_start;
     }
index 9fa46029a7f5ca299071038bea742aab698d0e4f..8adc9c3669ea43435f4b419337e08314e020d134 100644 (file)
@@ -3260,7 +3260,6 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
         lj++;
         while (lj <= j)
             gen_opc_instr_start[lj++] = 0;
-        tb->size = 0;
     } else {
         tb->size = dc->pc - pc_start;
     }
index c87f2c9874d45768bd6de6d4140984bffdfbbba1..d7bb20af3efebefface28572cd6d776236d6c264 100644 (file)
@@ -5882,10 +5882,6 @@ static void decode_opc (CPUState *env, DisasContext *ctx)
             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 *env, TranslationBlock *tb,
                     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;
     }
index e5064c082297f7327e1f6d0ce8afb311ae236cbe..40a1176c83f7d371658ca2db3b0612b4fcdbae56 100644 (file)
@@ -5878,7 +5878,6 @@ static inline int gen_intermediate_code_internal (CPUState *env,
         lj++;
         while (lj <= j)
             gen_opc_instr_start[lj++] = 0;
-        tb->size = 0;
     } else {
         tb->size = ctx.nip - pc_start;
     }
index 67ef8395e05bcb6ff180e8991d394b4ec7581787..5842c29d3a88f3bba439ce1aa7f9910a698a42bf 100644 (file)
@@ -1242,7 +1242,6 @@ gen_intermediate_code_internal(CPUState * env, TranslationBlock * tb,
         ii++;
         while (ii <= i)
             gen_opc_instr_start[ii++] = 0;
-        tb->size = 0;
     } else {
         tb->size = ctx.pc - pc_start;
     }
index 2b42ffd34a0dd5f6ae5b0171666f92e26a2e3fad..54b861a840f7d17323753fa4a5ac63d7eab3de07 100644 (file)
@@ -3365,7 +3365,6 @@ static inline int gen_intermediate_code_internal(TranslationBlock * tb,
         lj++;
         while (lj <= j)
             gen_opc_instr_start[lj++] = 0;
-        tb->size = 0;
 #if 0
         if (loglevel > 0) {
             page_dump(logfile);