- Removed some unnecessary DbgPrints from the fatal exception path; ignore
authorDavid Welch <welch@cwcom.net>
Sat, 6 Mar 2004 22:24:14 +0000 (22:24 +0000)
committerDavid Welch <welch@cwcom.net>
Sat, 6 Mar 2004 22:24:14 +0000 (22:24 +0000)
the breakpoint in the tail of KeBugCheckEx/KeBugCheckWithTf if no debugger
is connected.

svn path=/trunk/; revision=8551

reactos/ntoskrnl/ke/bug.c
reactos/ntoskrnl/ke/catch.c
reactos/ntoskrnl/ke/i386/brkpoint.c
reactos/ntoskrnl/ke/i386/exp.c

index c0cf574..c7dc5c2 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: bug.c,v 1.41 2003/12/30 18:52:04 fireball Exp $
+/* $Id: bug.c,v 1.42 2004/03/06 22:24:13 dwelch Exp $
  *
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/ke/bug.c
@@ -163,11 +163,11 @@ KeBugCheckWithTf(ULONG BugCheckCode,
     {
 #if defined(__GNUC__)
       __asm__("sti\n\t");
-      DbgBreakPoint();
+      DbgBreakPointNoBugCheck();
       __asm__("cli\n\t");
 #elif defined(_MSC_VER)
       __asm sti
-      DbgBreakPoint();
+      DbgBreakPointNoBugCheck();
       __asm cli
 #else
 #error Unknown compiler for inline assembler
@@ -293,11 +293,11 @@ KeBugCheckEx(ULONG BugCheckCode,
     {
 #if defined(__GNUC__)
       __asm__("sti\n\t");
-      DbgBreakPoint();
+      DbgBreakPointNoBugCheck();
       __asm__("cli\n\t");
 #elif defined(_MSC_VER)
       __asm sti
-      DbgBreakPoint();
+      DbgBreakPointNoBugCheck();
       __asm cli
 #else
 #error Unknown compiler for inline assembler
index f6c35a2..e715b1b 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: catch.c,v 1.39 2003/12/30 18:52:04 fireball Exp $
+/* $Id: catch.c,v 1.40 2004/03/06 22:24:13 dwelch Exp $
  *
  * PROJECT:              ReactOS kernel
  * FILE:                 ntoskrnl/ke/catch.c
@@ -163,9 +163,9 @@ KiDispatchException(PEXCEPTION_RECORD ExceptionRecord,
          if (Value != ExceptionContinueExecution ||
              0 != (ExceptionRecord->ExceptionFlags & EXCEPTION_NONCONTINUABLE))
            {
-                 DbgPrint("ExceptionRecord->ExceptionAddress = 0x%x\n",
-                         ExceptionRecord->ExceptionAddress );
-              KEBUGCHECKWITHTF(KMODE_EXCEPTION_NOT_HANDLED, 0, 0, 0, 0, Tf);         
+             DPRINT("ExceptionRecord->ExceptionAddress = 0x%x\n",
+                    ExceptionRecord->ExceptionAddress );
+              KeBugCheckWithTf(KMODE_EXCEPTION_NOT_HANDLED, 0, 0, 0, 0, Tf);         
            }
        }
     }
index eea7b63..150648c 100644 (file)
@@ -46,6 +46,16 @@ DbgBreakPoint(VOID)
 #endif
 }
 
+/*
+ * @implemented
+ */
+#if defined(__GNUC__)
+__asm__(".globl _DbgBreakPointNoBugCheck@0\n\t"
+       "_DbgBreakPointNoBugCheck@0:\n\t"
+       "int $3\n\t"
+       "ret\n\t");
+#endif
+
 /*
  * @implemented
  */
index 0645581..5ce3880 100644 (file)
@@ -288,8 +288,8 @@ KiDoubleFaultHandler(VOID)
            OldTss->Fs, OldTss->Gs);
    DbgPrint("EAX: %.8x   EBX: %.8x   ECX: %.8x\n", OldTss->Eax, OldTss->Ebx, 
            OldTss->Ecx);
-   DbgPrint("EDX: %.8x   EBP: %.8x   ESI: %.8x\n", OldTss->Edx, OldTss->Ebp
-           OldTss->Esi);
+   DbgPrint("EDX: %.8x   EBP: %.8x   ESI: %.8x\n   ESP: %.8x", OldTss->Edx
+           OldTss->Ebp, OldTss->Esi, Esp0);
    DbgPrint("EDI: %.8x   EFLAGS: %.8x ", OldTss->Edi, OldTss->Eflags);
    if (OldTss->Cs == KERNEL_CS)
      {
@@ -307,7 +307,6 @@ KiDoubleFaultHandler(VOID)
      }
   if ((OldTss->Cs & 0xffff) == KERNEL_CS)
     {
-      DbgPrint("ESP %x\n", Esp0);
       if (PsGetCurrentThread() != NULL)
        {
          StackLimit = (ULONG)PsGetCurrentThread()->Tcb.StackBase;
@@ -468,7 +467,8 @@ KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG Parameter1, ULONG Parameter2)
    DbgPrint("DS %x ES %x FS %x GS %x\n", Tf->Ds&0xffff, Tf->Es&0xffff,
            Tf->Fs&0xffff, Tf->Gs&0xfff);
    DbgPrint("EAX: %.8x   EBX: %.8x   ECX: %.8x\n", Tf->Eax, Tf->Ebx, Tf->Ecx);
-   DbgPrint("EDX: %.8x   EBP: %.8x   ESI: %.8x\n", Tf->Edx, Tf->Ebp, Tf->Esi);
+   DbgPrint("EDX: %.8x   EBP: %.8x   ESI: %.8x   ESP: %.8x\n", Tf->Edx, 
+           Tf->Ebp, Tf->Esi, Esp0);
    DbgPrint("EDI: %.8x   EFLAGS: %.8x ", Tf->Edi, Tf->Eflags);
    if ((Tf->Cs&0xffff) == KERNEL_CS)
      {
@@ -481,8 +481,6 @@ KiDumpTrapFrame(PKTRAP_FRAME Tf, ULONG Parameter1, ULONG Parameter2)
          }
      }
 
-   DbgPrint("ESP %x\n", Esp0);
-
    if (PsGetCurrentThread() != NULL)
      {
        StackLimit = (ULONG)PsGetCurrentThread()->Tcb.StackBase;
@@ -594,6 +592,18 @@ KiTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr)
          }
      }
 
+   /*
+    * Check for a breakpoint that was only for the attention of the debugger.
+    */
+   if (ExceptionNr == 3 && Tf->Eip == ((ULONG)DbgBreakPointNoBugCheck) + 1)
+     {
+       /* 
+         EIP is already adjusted by the processor to point to the instruction
+         after the breakpoint.
+       */
+       return(0);
+     }
+
    /*
     * Handle user exceptions differently
     */