Revision 1009d2ed cpus.c

b/cpus.c
166 166
    return true;
167 167
}
168 168

  
169
static CPUDebugExcpHandler *debug_excp_handler;
170

  
171
CPUDebugExcpHandler *cpu_set_debug_excp_handler(CPUDebugExcpHandler *handler)
172
{
173
    CPUDebugExcpHandler *old_handler = debug_excp_handler;
174

  
175
    debug_excp_handler = handler;
176
    return old_handler;
177
}
178

  
179
static void cpu_handle_debug_exception(CPUState *env)
169
static void cpu_handle_guest_debug(CPUState *env)
180 170
{
181
    CPUWatchpoint *wp;
182

  
183
    if (!env->watchpoint_hit) {
184
        QTAILQ_FOREACH(wp, &env->watchpoints, entry) {
185
            wp->flags &= ~BP_WATCHPOINT_HIT;
186
        }
187
    }
188
    if (debug_excp_handler) {
189
        debug_excp_handler(env);
190
    }
191

  
192 171
    gdb_set_stop_cpu(env);
193 172
    qemu_system_debug_request();
194 173
#ifdef CONFIG_IOTHREAD
......
818 797
        if (cpu_can_run(env)) {
819 798
            r = kvm_cpu_exec(env);
820 799
            if (r == EXCP_DEBUG) {
821
                cpu_handle_debug_exception(env);
800
                cpu_handle_guest_debug(env);
822 801
            }
823 802
        }
824 803
        qemu_kvm_wait_io_event(env);
......
1110 1089
                r = tcg_cpu_exec(env);
1111 1090
            }
1112 1091
            if (r == EXCP_DEBUG) {
1113
                cpu_handle_debug_exception(env);
1092
                cpu_handle_guest_debug(env);
1114 1093
                break;
1115 1094
            }
1116 1095
        } else if (env->stop || env->stopped) {

Also available in: Unified diff