Don't send an extra signal when waiting for a debug event, just do a

normal wait.  Return the debug event status directly as return value
of the server call.
This commit is contained in:
Alexandre Julliard 2005-11-01 21:47:07 +00:00
parent d6f7adb367
commit ff7795ef4c
6 changed files with 10 additions and 18 deletions

View File

@ -196,19 +196,15 @@ static NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTE
SERVER_END_REQ;
if (ret) return ret;
/* No need to wait on the handle since the process gets suspended
* once the event is passed to the debugger, so when we get back
* here the event has been continued already.
*/
WaitForSingleObject( handle, INFINITE );
SERVER_START_REQ( get_exception_status )
{
req->handle = handle;
wine_server_set_reply( req, context, sizeof(*context) );
wine_server_call( req );
ret = reply->status;
ret = wine_server_call( req );
}
SERVER_END_REQ;
NtClose( handle );
return ret;
}

View File

@ -164,19 +164,15 @@ static int send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *c
SERVER_END_REQ;
if (!handle) return 0;
/* No need to wait on the handle since the process gets suspended
* once the event is passed to the debugger, so when we get back
* here the event has been continued already.
*/
NTDLL_wait_for_multiple_objects( 1, &handle, 0, NULL, 0 );
SERVER_START_REQ( get_exception_status )
{
req->handle = handle;
wine_server_set_reply( req, context, sizeof(*context) );
wine_server_call( req );
ret = reply->status;
ret = wine_server_call( req );
}
SERVER_END_REQ;
NtClose( handle );
return ret;
}

View File

@ -4207,6 +4207,6 @@ union generic_reply
struct set_mailslot_info_reply set_mailslot_info_reply;
};
#define SERVER_PROTOCOL_VERSION 195
#define SERVER_PROTOCOL_VERSION 196
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -661,19 +661,19 @@ DECL_HANDLER(get_exception_status)
{
struct debug_event *event;
reply->status = 0;
if ((event = (struct debug_event *)get_handle_obj( current->process, req->handle,
0, &debug_event_ops )))
{
close_handle( current->process, req->handle, NULL );
if (event->state == EVENT_CONTINUED)
{
reply->status = event->status;
if (current->context == &event->context)
{
size_t size = min( sizeof(CONTEXT), get_reply_max_size() );
set_reply_data( &event->context, size );
current->context = NULL;
}
set_error( event->status );
}
else set_error( STATUS_PENDING );
release_object( event );

View File

@ -1162,7 +1162,6 @@ enum char_info_mode
@REQ(get_exception_status)
obj_handle_t handle; /* handle to the queued event */
@REPLY
int status; /* event continuation status */
VARARG(context,context); /* modified thread context */
@END

View File

@ -315,6 +315,7 @@ static void set_thread_info( struct thread *thread,
/* stop a thread (at the Unix level) */
void stop_thread( struct thread *thread )
{
if (thread->context) return; /* already inside a debug event, no need for a signal */
/* can't stop a thread while initialisation is in progress */
if (is_process_init_done(thread->process)) send_thread_signal( thread, SIGUSR1 );
}