- Fix KiDispatchException to unmask KI_EXCEPTION_INTERNAL when setting the exception...
[reactos.git] / reactos / ntoskrnl / ke / bug.c
index 2c3bcea..dd19977 100644 (file)
@@ -99,7 +99,7 @@ KeRosDumpStackFrames(IN PULONG Frame OPTIONAL,
         }
 
         /* Print it out */
-        if (!KiRosPrintAddress((PVOID)Addr)) DbgPrint("<%X>", Addr);
+        if (!KeRosPrintAddress((PVOID)Addr)) DbgPrint("<%X>", Addr);
 
         /* Go to the next frame */
         DbgPrint("\n");
@@ -819,7 +819,6 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
     }
 
     /* Check if we need to save the context for KD */
-    if (!KdPitchDebugger) KdDebuggerDataBlock.SavedContext = (ULONG)&Context;
 
     /* Check if a debugger is connected */
     if ((BugCheckCode != MANUALLY_INITIATED_CRASH) && (KdDebuggerEnabled))
@@ -854,6 +853,15 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
             /* Break in the debugger */
             KiBugCheckDebugBreak(DBG_STATUS_BUGCHECK_FIRST);
         }
+        else
+        {
+            /*
+             * ROS HACK.
+             * Ok, so debugging is enabled, but KDBG isn't there.
+             * We'll manually dump the stack for the user.
+             */
+            KeRosDumpStackFrames(NULL, 0);
+        }
     }
 
     /* Raise IRQL to HIGH_LEVEL */
@@ -893,12 +901,12 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
                             AnsiName);
 
         /* Check if the debugger is disabled but we can enable it */
-        if (!(KdDebuggerEnabled) && !(KdPitchDebugger))
+        //if (!(KdDebuggerEnabled) && !(KdPitchDebugger))
         {
             /* Enable it */
-            KdEnableDebuggerWithLock(FALSE);
+            //KdEnableDebuggerWithLock(FALSE);
         }
-        else
+        //else
         {
             /* Otherwise, print the last line */
             InbvDisplayString("\r\n");