Module: wine Branch: stable Commit: 9c334d3bfe78a2f189a1d42c99fb46f8ce3854f7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9c334d3bfe78a2f189a1d42c99...
Author: Sebastian Lackner sebastian@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@fds-team.de Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit d0cc0dd69f029fcd54275784d3edc0f1426fc568) Signed-off-by: Michael Stefaniuc mstefani@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 86a22d9..c62dcb3 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1870,7 +1870,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, @@ -1937,7 +1936,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; @@ -1958,7 +1956,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);
@@ -1968,7 +1965,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);
@@ -1978,7 +1974,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);
@@ -2045,7 +2040,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