ChangeSet ID: 21028 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@winehq.org 2005/11/01 15:47:07
Modified files: server : thread.c protocol.def debugger.c include/wine : server_protocol.h dlls/ntdll : exception.c dlls/kernel : except.c
Log message: 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.
Patch: http://cvs.winehq.org/patch.py?id=21028
Old revision New revision Changes Path 1.127 1.128 +1 -0 wine/server/thread.c 1.158 1.159 +0 -1 wine/server/protocol.def 1.58 1.59 +2 -2 wine/server/debugger.c 1.159 1.160 +1 -1 wine/include/wine/server_protocol.h 1.87 1.88 +3 -7 wine/dlls/ntdll/exception.c 1.14 1.15 +3 -7 wine/dlls/kernel/except.c
Index: wine/server/thread.c diff -u -p wine/server/thread.c:1.127 wine/server/thread.c:1.128 --- wine/server/thread.c:1.127 1 Nov 2005 21:47: 7 -0000 +++ wine/server/thread.c 1 Nov 2005 21:47: 7 -0000 @@ -315,6 +315,7 @@ static void set_thread_info( struct thre /* 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 ); } Index: wine/server/protocol.def diff -u -p wine/server/protocol.def:1.158 wine/server/protocol.def:1.159 --- wine/server/protocol.def:1.158 1 Nov 2005 21:47: 7 -0000 +++ wine/server/protocol.def 1 Nov 2005 21:47: 7 -0000 @@ -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
Index: wine/server/debugger.c diff -u -p wine/server/debugger.c:1.58 wine/server/debugger.c:1.59 --- wine/server/debugger.c:1.58 1 Nov 2005 21:47: 8 -0000 +++ wine/server/debugger.c 1 Nov 2005 21:47: 8 -0000 @@ -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 ); Index: wine/include/wine/server_protocol.h diff -u -p wine/include/wine/server_protocol.h:1.159 wine/include/wine/server_protocol.h:1.160 --- wine/include/wine/server_protocol.h:1.159 1 Nov 2005 21:47: 8 -0000 +++ wine/include/wine/server_protocol.h 1 Nov 2005 21:47: 8 -0000 @@ -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 */ Index: wine/dlls/ntdll/exception.c diff -u -p wine/dlls/ntdll/exception.c:1.87 wine/dlls/ntdll/exception.c:1.88 --- wine/dlls/ntdll/exception.c:1.87 1 Nov 2005 21:47: 8 -0000 +++ wine/dlls/ntdll/exception.c 1 Nov 2005 21:47: 8 -0000 @@ -164,19 +164,15 @@ static int send_debug_event( EXCEPTION_R 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; }
Index: wine/dlls/kernel/except.c diff -u -p wine/dlls/kernel/except.c:1.14 wine/dlls/kernel/except.c:1.15 --- wine/dlls/kernel/except.c:1.14 1 Nov 2005 21:47: 8 -0000 +++ wine/dlls/kernel/except.c 1 Nov 2005 21:47: 8 -0000 @@ -196,19 +196,15 @@ static NTSTATUS send_debug_event( EXCEPT 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; }