- Fix KiDispatchException to unmask KI_EXCEPTION_INTERNAL when setting the exception...
[reactos.git] / reactos / ntoskrnl / ke / i386 / exp.c
index 27bfb89..500a1db 100644 (file)
@@ -800,7 +800,7 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
     /* Set the context flags */
     Context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS;
 
-    /* Check if User Mode or if the debugger is enabled */
+    /* Check if User Mode or if the debugger isenabled */
     if ((PreviousMode == UserMode) || (KdDebuggerEnabled))
     {
         /* Add the FPU Flag */
@@ -846,6 +846,9 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
                 goto Handled;
             }
 
+            /* HACK: GDB Entry */
+            if (KdpCallGdb(TrapFrame, ExceptionRecord, &Context)) goto Handled;
+
             /* If the Debugger couldn't handle it, dispatch the exception */
             if (RtlDispatchException(ExceptionRecord, &Context)) goto Handled;
         }
@@ -891,6 +894,9 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
                 goto Handled;
             }
 
+            /* HACK: GDB Entry */
+            if (KdpCallGdb(TrapFrame, ExceptionRecord, &Context)) goto Handled;
+
             /* Forward exception to user mode debugger */
             if (DbgkForwardException(ExceptionRecord, TRUE, FALSE)) goto Exit;
 
@@ -1040,5 +1046,3 @@ KeRaiseUserException(IN NTSTATUS ExceptionCode)
     return (NTSTATUS)OldEip;
 }
 
-
-