Commit 9c18d92f authored by Alexandre Julliard's avatar Alexandre Julliard

server: Detaching from a process needs to continue all the pending events.

parent fc635fa8
...@@ -451,7 +451,7 @@ static int debugger_attach( struct process *process, struct thread *debugger ) ...@@ -451,7 +451,7 @@ static int debugger_attach( struct process *process, struct thread *debugger )
/* detach a process from a debugger thread (and resume it ?) */ /* detach a process from a debugger thread (and resume it ?) */
int debugger_detach( struct process *process, struct thread *debugger ) int debugger_detach( struct process *process, struct thread *debugger )
{ {
struct debug_event *event; struct debug_event *event, *next;
struct debug_ctx *debug_ctx; struct debug_ctx *debug_ctx;
if (!process->debugger || process->debugger != debugger) if (!process->debugger || process->debugger != debugger)
...@@ -464,23 +464,18 @@ int debugger_detach( struct process *process, struct thread *debugger ) ...@@ -464,23 +464,18 @@ int debugger_detach( struct process *process, struct thread *debugger )
/* send continue indication for all events */ /* send continue indication for all events */
debug_ctx = debugger->debug_ctx; debug_ctx = debugger->debug_ctx;
/* find the event in the queue /* free all events from this process */
* FIXME: could loop on process' threads and look the debug_event field */ LIST_FOR_EACH_ENTRY_SAFE( event, next, &debug_ctx->event_queue, struct debug_event, entry )
LIST_FOR_EACH_ENTRY( event, &debug_ctx->event_queue, struct debug_event, entry )
{ {
if (event->state != EVENT_QUEUED) continue; if (event->sender->process != process) continue;
if (event->sender->process == process) assert( event->state != EVENT_CONTINUED );
{ event->status = DBG_CONTINUE;
assert( event->sender->debug_event == event ); event->state = EVENT_CONTINUED;
event->status = DBG_CONTINUE; wake_up( &event->obj, 0 );
event->state = EVENT_CONTINUED; unlink_event( debug_ctx, event );
wake_up( &event->obj, 0 ); /* from queued debug event */
unlink_event( debug_ctx, event ); resume_process( process );
/* from queued debug event */
resume_process( process );
break;
}
} }
/* remove relationships between process and its debugger */ /* remove relationships between process and its debugger */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment