aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-11 10:04:58 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-11 10:04:58 +0000
commitce62e5ba096920a82b47c9ba62f35573bd61f546 (patch)
tree142977a80857d75cc7bf2577b6b26b02a6574d3b
parent408e7837aa64e57dc3377753448b5047946f0c50 (diff)
Fix tb->size mishandling, by Daniel Jacobowitz.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3160 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--target-alpha/translate.c1
-rw-r--r--target-arm/translate.c1
-rw-r--r--target-m68k/translate.c1
-rw-r--r--target-mips/translate.c8
-rw-r--r--target-ppc/translate.c1
-rw-r--r--target-sh4/translate.c1
-rw-r--r--target-sparc/translate.c1
7 files changed, 3 insertions, 11 deletions
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 77e3b4ec8d..9ed53be28b 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -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;
}
diff --git a/target-arm/translate.c b/target-arm/translate.c
index 799aef2f15..590959c2f6 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -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;
}
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 9fa46029a7..8adc9c3669 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -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;
}
diff --git a/target-mips/translate.c b/target-mips/translate.c
index c87f2c9874..d7bb20af3e 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -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;
}
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index e5064c0822..40a1176c83 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -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;
}
diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index 67ef8395e0..5842c29d3a 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -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;
}
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 2b42ffd34a..54b861a840 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -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);