Module: wine Branch: master Commit: d0cc0dd69f029fcd54275784d3edc0f1426fc568 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d0cc0dd69f029fcd54275784d3... Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Feb 19 03:08:42 2016 +0100 ntdll: Fix up instruction pointer in context for EXCEPTION_BREAKPOINT on x86_64. Similar to eab168cf9eaa6ed9f8800b25155d329376f2343f for x86. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/signal_x86_64.c | 3 +++ dlls/ntdll/tests/exception.c | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index be5a342..84802b2 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -2482,6 +2482,9 @@ static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL f if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED) return STATUS_SUCCESS; + /* fix up instruction pointer in context for EXCEPTION_BREAKPOINT */ + if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) context->Rip--; + if (call_vectored_handlers( rec, context ) == EXCEPTION_CONTINUE_EXECUTION) return STATUS_SUCCESS; diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 0f07404..670c37b 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1911,7 +1911,6 @@ static LONG CALLBACK debug_service_handler(EXCEPTION_POINTERS *ExceptionInfo) "got ExceptionInformation[2] = %lx\n", rec->ExceptionInformation[2]); } #else - todo_wine ok(ExceptionInfo->ContextRecord->Rip == (DWORD_PTR)code_mem + 0x2f, "expected Rip = %lx, got %lx\n", (DWORD_PTR)code_mem + 0x2f, ExceptionInfo->ContextRecord->Rip); ok(rec->NumberParameters == 1, @@ -1978,7 +1977,6 @@ static const BYTE call_debug_service_code[] = { static void test_debug_service(DWORD numexc) { - const BOOL is_win64 = (sizeof(void *) > sizeof(int)); DWORD (CDECL *func)(DWORD_PTR) = code_mem; DWORD expected_exc, expected_ret; void *vectored_handler; @@ -1999,7 +1997,6 @@ static void test_debug_service(DWORD numexc) ok(debug_service_exceptions == expected_exc, "BREAKPOINT_BREAK generated %u exceptions, expected %u\n", debug_service_exceptions, expected_exc); - todo_wine_if(is_win64) ok(ret == expected_ret, "BREAKPOINT_BREAK returned %u, expected %u\n", ret, expected_ret); @@ -2009,7 +2006,6 @@ static void test_debug_service(DWORD numexc) ok(debug_service_exceptions == expected_exc, "BREAKPOINT_PROMPT generated %u exceptions, expected %u\n", debug_service_exceptions, expected_exc); - todo_wine_if(is_win64) ok(ret == expected_ret, "BREAKPOINT_PROMPT returned %u, expected %u\n", ret, expected_ret); @@ -2019,7 +2015,6 @@ static void test_debug_service(DWORD numexc) ok(debug_service_exceptions == expected_exc, "invalid debug service generated %u exceptions, expected %u\n", debug_service_exceptions, expected_exc); - todo_wine_if(is_win64) ok(ret == expected_ret, "invalid debug service returned %u, expected %u\n", ret, expected_ret); @@ -2086,7 +2081,6 @@ static LONG CALLBACK breakpoint_handler(EXCEPTION_POINTERS *ExceptionInfo) "got ExceptionInformation[0] = %lx\n", rec->ExceptionInformation[0]); ExceptionInfo->ContextRecord->Eip = (DWORD)code_mem + 2; #else - todo_wine ok(ExceptionInfo->ContextRecord->Rip == (DWORD_PTR)code_mem + 1, "expected Rip = %lx, got %lx\n", (DWORD_PTR)code_mem + 1, ExceptionInfo->ContextRecord->Rip); todo_wine