[ros-diffs] [fireball] 33929: - Unregress KDBG: It has to increment EIP in case of STATUS_BREAKPOINT to skip over the current instruction, but now do it inside KDBG's exception handler. - In Kd and GDB exception handler wrappers, return FALSE if kdDoNotHandleException, and return TRUE otherwise (kdHandled / kdContinue). After my previous commit these functions were always returning FALSE / exception not handled.

fireball at svn.reactos.org fireball at svn.reactos.org
Wed Jun 11 13:34:04 CEST 2008


Author: fireball
Date: Wed Jun 11 06:34:04 2008
New Revision: 33929

URL: http://svn.reactos.org/svn/reactos?rev=33929&view=rev
Log:
- Unregress KDBG: It has to increment EIP in case of STATUS_BREAKPOINT to skip over the current instruction, but now do it inside KDBG's exception handler.
- In Kd and GDB exception handler wrappers, return FALSE if kdDoNotHandleException, and return TRUE otherwise (kdHandled / kdContinue). After my previous commit these functions were always returning FALSE / exception not handled.

Modified:
    trunk/reactos/ntoskrnl/kd/kdmain.c
    trunk/reactos/ntoskrnl/kdbg/kdb.c

Modified: trunk/reactos/ntoskrnl/kd/kdmain.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/kdmain.c?rev=33929&r1=33928&r2=33929&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/kd/kdmain.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kd/kdmain.c [iso-8859-1] Wed Jun 11 06:34:04 2008
@@ -167,7 +167,7 @@
 
     /* Convert return to BOOLEAN */
     if (Return == kdDoNotHandleException) return FALSE;
-    return FALSE;
+    return TRUE;
 }
 
 BOOLEAN
@@ -196,7 +196,7 @@
 
     /* Convert return to BOOLEAN */
     if (Return == kdDoNotHandleException) return FALSE;
-    return FALSE;
+    return TRUE;
 }
 
 /* PUBLIC FUNCTIONS *********************************************************/

Modified: trunk/reactos/ntoskrnl/kdbg/kdb.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb.c?rev=33929&r1=33928&r2=33929&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] Wed Jun 11 06:34:04 2008
@@ -1269,7 +1269,7 @@
  *
  * \param ExceptionRecord  Unused.
  * \param PreviousMode     UserMode if the exception was raised from umode, otherwise KernelMode.
- * \param Context          Unused.
+ * \param Context          Context, IN/OUT parameter.
  * \param TrapFrame        Exception TrapFrame.
  * \param FirstChance      TRUE when called before exception frames were serached,
  *                         FALSE for the second call.
@@ -1280,7 +1280,7 @@
 KdbEnterDebuggerException(
    IN PEXCEPTION_RECORD ExceptionRecord  OPTIONAL,
    IN KPROCESSOR_MODE PreviousMode,
-   IN PCONTEXT Context  OPTIONAL,
+   IN PCONTEXT Context,
    IN OUT PKTRAP_FRAME TrapFrame,
    IN BOOLEAN FirstChance)
 {
@@ -1324,12 +1324,6 @@
 
       if (ExceptionCode == STATUS_BREAKPOINT)
       {
-         /*
-          * The breakpoint will point to the next instruction by default so
-          * point it back to the start of original instruction.
-          */
-         //TrapFrame->Eip--;
-
          /*
           * ... and restore the original instruction.
           */
@@ -1618,6 +1612,8 @@
       /* Clear dr6 status flags. */
       TrapFrame->Dr6 &= ~0x0000e00f;
 
+      /* Skip the current instruction */
+      Context->Eip++;
    }
 
    return ContinueType;



More information about the Ros-diffs mailing list