Revision 1009d2ed cpu-exec.c

b/cpu-exec.c
196 196
    return tb;
197 197
}
198 198

  
199
static CPUDebugExcpHandler *debug_excp_handler;
200

  
201
CPUDebugExcpHandler *cpu_set_debug_excp_handler(CPUDebugExcpHandler *handler)
202
{
203
    CPUDebugExcpHandler *old_handler = debug_excp_handler;
204

  
205
    debug_excp_handler = handler;
206
    return old_handler;
207
}
208

  
209
static void cpu_handle_debug_exception(CPUState *env)
210
{
211
    CPUWatchpoint *wp;
212

  
213
    if (!env->watchpoint_hit) {
214
        QTAILQ_FOREACH(wp, &env->watchpoints, entry) {
215
            wp->flags &= ~BP_WATCHPOINT_HIT;
216
        }
217
    }
218
    if (debug_excp_handler) {
219
        debug_excp_handler(env);
220
    }
221
}
222

  
199 223
/* main execution loop */
200 224

  
201 225
volatile sig_atomic_t exit_request;
......
269 293
                if (env->exception_index >= EXCP_INTERRUPT) {
270 294
                    /* exit request from the cpu execution loop */
271 295
                    ret = env->exception_index;
296
                    if (ret == EXCP_DEBUG) {
297
                        cpu_handle_debug_exception(env);
298
                    }
272 299
                    break;
273 300
                } else {
274 301
#if defined(CONFIG_USER_ONLY)

Also available in: Unified diff