From 86025ee4438e6e46eed767aad7c17ea94bb5c19b Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 12 Sep 2014 14:06:48 +0100 Subject: cpu-exec: Make debug_excp_handler a QOM CPU method Make the debug_excp_handler target specific hook into a QOM CPU method. Signed-off-by: Peter Maydell --- cpu-exec.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'cpu-exec.c') diff --git a/cpu-exec.c b/cpu-exec.c index e9adf56..bd93165 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -295,16 +295,10 @@ static inline TranslationBlock *tb_find_fast(CPUArchState *env) return tb; } -static CPUDebugExcpHandler *debug_excp_handler; - -void cpu_set_debug_excp_handler(CPUDebugExcpHandler *handler) -{ - debug_excp_handler = handler; -} - static void cpu_handle_debug_exception(CPUArchState *env) { CPUState *cpu = ENV_GET_CPU(env); + CPUClass *cc = CPU_GET_CLASS(cpu); CPUWatchpoint *wp; if (!cpu->watchpoint_hit) { @@ -312,9 +306,8 @@ static void cpu_handle_debug_exception(CPUArchState *env) wp->flags &= ~BP_WATCHPOINT_HIT; } } - if (debug_excp_handler) { - debug_excp_handler(env); - } + + cc->debug_excp_handler(cpu); } /* main execution loop */ -- cgit v1.1