diff options
Diffstat (limited to 'target-i386')
-rw-r--r-- | target-i386/cpu.c | 6 | ||||
-rw-r--r-- | target-i386/cpu.h | 2 | ||||
-rw-r--r-- | target-i386/helper.c | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 88b64d8b66..90d0a05eb1 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2843,9 +2843,6 @@ static void x86_cpu_initfn(Object *obj) if (tcg_enabled() && !inited) { inited = 1; optimize_flags_init(); -#ifndef CONFIG_USER_ONLY - cpu_set_debug_excp_handler(breakpoint_handler); -#endif } } @@ -2942,6 +2939,9 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) cc->vmsd = &vmstate_x86_cpu; #endif cc->gdb_num_core_regs = CPU_NB_REGS * 2 + 25; +#ifndef CONFIG_USER_ONLY + cc->debug_excp_handler = breakpoint_handler; +#endif } static const TypeInfo x86_cpu_type_info = { diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 3460b12139..71b505f56c 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -1121,7 +1121,7 @@ static inline int hw_breakpoint_len(unsigned long dr7, int index) void hw_breakpoint_insert(CPUX86State *env, int index); void hw_breakpoint_remove(CPUX86State *env, int index); bool check_hw_breakpoints(CPUX86State *env, bool force_dr6_update); -void breakpoint_handler(CPUX86State *env); +void breakpoint_handler(CPUState *cs); /* will be suppressed */ void cpu_x86_update_cr0(CPUX86State *env, uint32_t new_cr0); diff --git a/target-i386/helper.c b/target-i386/helper.c index 30cb0d0143..28fefe0a1f 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -1011,9 +1011,10 @@ bool check_hw_breakpoints(CPUX86State *env, bool force_dr6_update) return hit_enabled; } -void breakpoint_handler(CPUX86State *env) +void breakpoint_handler(CPUState *cs) { - CPUState *cs = CPU(x86_env_get_cpu(env)); + X86CPU *cpu = X86_CPU(cs); + CPUX86State *env = &cpu->env; CPUBreakpoint *bp; if (cs->watchpoint_hit) { |