Peter Oberndorfer : ntdll: Fix up instruction pointer in context inside raise_exception.

Alexandre Julliard julliard at wine.codeweavers.com
Wed May 23 08:10:56 CDT 2007


Module: wine
Branch: master
Commit: eab168cf9eaa6ed9f8800b25155d329376f2343f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=eab168cf9eaa6ed9f8800b25155d329376f2343f

Author: Peter Oberndorfer <kumbayo84 at arcor.de>
Date:   Tue May 22 18:28:53 2007 +0200

ntdll: Fix up instruction pointer in context inside raise_exception.

---

 dlls/ntdll/exception.c       |    5 +++++
 dlls/ntdll/tests/exception.c |   10 +---------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c
index 7f0da0c..8974ced 100644
--- a/dlls/ntdll/exception.c
+++ b/dlls/ntdll/exception.c
@@ -336,6 +336,11 @@ static NTSTATUS raise_exception( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL f
         if (status == DBG_CONTINUE || status == DBG_EXCEPTION_HANDLED)
             return STATUS_SUCCESS;
 
+#ifdef __i386__
+        /* fix up instruction pointer in context for EXCEPTION_BREAKPOINT */
+        if (rec->ExceptionCode == EXCEPTION_BREAKPOINT) context->Eip--;
+#endif
+
         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 9ebbda7..83613f7 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -215,10 +215,8 @@ LONG CALLBACK rtlraiseexception_vectored_handler(EXCEPTION_POINTERS *ExceptionIn
      */
     if(rec->ExceptionCode == EXCEPTION_BREAKPOINT)
     {
-        todo_wine {
         ok(context->Eip == (DWORD)code_mem + 0xa, "Eip at %x instead of %x\n",
            context->Eip, (DWORD)code_mem + 0xa);
-        }
     }
     else
     {
@@ -247,10 +245,8 @@ static DWORD rtlraiseexception_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR
      */
     if(rec->ExceptionCode == EXCEPTION_BREAKPOINT)
     {
-        todo_wine {
         ok(context->Eip == (DWORD)code_mem + 0xa, "Eip at %x instead of %x\n",
            context->Eip, (DWORD)code_mem + 0xa);
-        }
     }
     else
     {
@@ -525,9 +521,7 @@ static DWORD int3_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD
 {
     ok( rec->ExceptionAddress == code_mem, "exception address not at: %p, but at %p\n",
                                            code_mem,  rec->ExceptionAddress);
-    todo_wine {
-        ok( context->Eip == (DWORD)code_mem, "eip not at: %p, but at %#x\n", code_mem, context->Eip);
-    }
+    ok( context->Eip == (DWORD)code_mem, "eip not at: %p, but at %#x\n", code_mem, context->Eip);
     if(context->Eip == (DWORD)code_mem) context->Eip++; /* skip breakpoint */
 
     return ExceptionContinueExecution;
@@ -692,10 +686,8 @@ static void test_debugger(void)
                         /* ctx.Eip is the same value the exception handler got */
                         if (de.u.Exception.ExceptionRecord.ExceptionCode == EXCEPTION_BREAKPOINT)
                         {
-                            todo_wine{
                             ok((char *)ctx.Eip == (char *)code_mem_address + 0xa, "Eip at 0x%x instead of %p\n",
                                 ctx.Eip, (char *)code_mem_address + 0xa);
-                            }
                             /* need to fixup Eip for debuggee */
                             if ((char *)ctx.Eip == (char *)code_mem_address + 0xa)
                                 ctx.Eip += 1;




More information about the wine-cvs mailing list