aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/exec.c b/exec.c
index fc0a0cf7af..5ea2163258 100644
--- a/exec.c
+++ b/exec.c
@@ -617,7 +617,8 @@ static void tb_reset_jump_recursive(TranslationBlock *tb)
tb_reset_jump_recursive2(tb, 1);
}
-/* add a breakpoint */
+/* add a breakpoint. EXCP_DEBUG is returned by the CPU loop if a
+ breakpoint is reached */
int cpu_breakpoint_insert(CPUState *env, uint32_t pc)
{
#if defined(TARGET_I386)
@@ -659,6 +660,20 @@ int cpu_breakpoint_remove(CPUState *env, uint32_t pc)
#endif
}
+/* enable or disable single step mode. EXCP_DEBUG is returned by the
+ CPU loop after each instruction */
+void cpu_single_step(CPUState *env, int enabled)
+{
+#if defined(TARGET_I386)
+ if (env->singlestep_enabled != enabled) {
+ env->singlestep_enabled = enabled;
+ /* must flush all the translated code to avoid inconsistancies */
+ tb_flush();
+ }
+#endif
+}
+
+
/* mask must never be zero */
void cpu_interrupt(CPUState *env, int mask)
{