Commit d61419d3 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Store exception reporting flags for debug events.

parent b6928d3a
......@@ -247,7 +247,7 @@ static void check_context_exception_request_( DWORD flags, BOOL hardware_excepti
if (!(flags & CONTEXT_EXCEPTION_REPORTING)) return;
expected_flags |= hardware_exception ? CONTEXT_EXCEPTION_ACTIVE : CONTEXT_SERVICE_ACTIVE;
todo_wine ok_(__FILE__, line)( (flags & exception_reporting_flags) == expected_flags, "got %#lx, expected %#lx.\n",
ok_(__FILE__, line)( (flags & exception_reporting_flags) == expected_flags, "got %#lx, expected %#lx.\n",
flags, expected_flags );
}
#endif
......@@ -11247,7 +11247,7 @@ static void test_context_exception_request(void)
c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST;
ret = GetThreadContext( thread, &c );
ok( ret, "got error %lu.\n", GetLastError() );
todo_wine ok( c.ContextFlags == expected_flags, "got %#lx, expected %#lx.\n", c.ContextFlags, expected_flags );
ok( c.ContextFlags == expected_flags, "got %#lx, expected %#lx.\n", c.ContextFlags, expected_flags );
WriteRelease( &p.sync, 4 );
}
......@@ -11281,7 +11281,7 @@ static void test_context_exception_request(void)
c.ContextFlags = CONTEXT_CONTROL | CONTEXT_EXCEPTION_REQUEST;
ret = GetThreadContext( thread, &c );
ok( ret, "got error %lu.\n", GetLastError() );
todo_wine ok( c.ContextFlags == expected_flags, "got %#lx, expected %#lx.\n", c.ContextFlags, expected_flags );
ok( c.ContextFlags == expected_flags, "got %#lx, expected %#lx.\n", c.ContextFlags, expected_flags );
WriteRelease( &p.sync, 8 );
}
......
......@@ -545,7 +545,7 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec
void *stack_ptr = (void *)(SP_sig(sigcontext) & ~7);
NTSTATUS status;
status = send_debug_event( rec, context, TRUE );
status = send_debug_event( rec, context, TRUE, TRUE );
if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED)
{
restore_context( context, sigcontext );
......
......@@ -699,7 +699,7 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec
void *stack_ptr = (void *)(SP_sig(sigcontext) & ~15);
NTSTATUS status;
status = send_debug_event( rec, context, TRUE );
status = send_debug_event( rec, context, TRUE, TRUE );
if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED)
{
restore_context( context, sigcontext );
......
......@@ -1450,7 +1450,7 @@ static void setup_raise_exception( ucontext_t *sigcontext, void *stack_ptr,
struct exc_stack_layout *stack;
size_t stack_size;
unsigned int xstate_size;
NTSTATUS status = send_debug_event( rec, context, TRUE );
NTSTATUS status = send_debug_event( rec, context, TRUE, TRUE );
if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED)
{
......
......@@ -1426,7 +1426,7 @@ static void setup_raise_exception( ucontext_t *sigcontext, EXCEPTION_RECORD *rec
context->EFlags &= ~0x100; /* clear single-step flag */
}
status = send_debug_event( rec, context, TRUE );
status = send_debug_event( rec, context, TRUE, TRUE );
if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED)
{
restore_context( xcontext, sigcontext );
......
......@@ -1506,7 +1506,7 @@ void wait_suspend( CONTEXT *context )
*
* Send an EXCEPTION_DEBUG_EVENT event to the debugger.
*/
NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance )
NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance, BOOL exception )
{
unsigned int ret;
DWORD i;
......@@ -1543,6 +1543,8 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_c
select_op.wait.handles[0] = handle;
contexts_to_server( server_contexts, context );
server_contexts[0].flags |= SERVER_CTX_EXEC_SPACE;
server_contexts[0].exec_space.space.space = exception ? EXEC_SPACE_EXCEPTION : EXEC_SPACE_SYSCALL;
server_select( &select_op, offsetof( select_op_t, wait.handles[1] ), SELECT_INTERRUPTIBLE,
TIMEOUT_INFINITE, server_contexts, NULL );
......@@ -1565,7 +1567,7 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_c
*/
NTSTATUS WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance )
{
NTSTATUS status = send_debug_event( rec, context, first_chance );
NTSTATUS status = send_debug_event( rec, context, first_chance, !(is_win64 || is_wow64() || is_old_wow64()) );
if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED)
return NtContinue( context, FALSE );
......
......@@ -244,7 +244,7 @@ extern void DECLSPEC_NORETURN abort_thread( int status );
extern void DECLSPEC_NORETURN abort_process( int status );
extern void DECLSPEC_NORETURN exit_process( int status );
extern void wait_suspend( CONTEXT *context );
extern NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance );
extern NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance, BOOL exception );
extern NTSTATUS set_thread_context( HANDLE handle, const void *context, BOOL *self, USHORT machine );
extern NTSTATUS get_thread_context( HANDLE handle, void *context, BOOL *self, USHORT machine );
extern unsigned int alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct object_attributes **ret,
......
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