[ros-kernel] Crashing kernel, stack trace one function per line

Mike Nordell tamlin at algonet.se
Fri Nov 14 15:43:04 CET 2003


Has anyone else wanted this, at least in a debug build? If so, I've found
the following very helpful:

RCS file: /CVS/ReactOS/reactos/ntoskrnl/ke/i386/exp.c,v
retrieving revision 1.75
diff -u -w -r1.75 exp.c
--- exp.c       12 Oct 2003 17:05:45 -0000      1.75
+++ exp.c       14 Nov 2003 15:45:03 -0000
@@ -305,12 +305,19 @@

 #if 1
       DbgPrint("Frames: ");
+#ifdef DBG
+      DbgPrint("\n");  /* TMN: Considered a good idea */
+#endif
       Frame = (PULONG)OldTss->Ebp;
       while (Frame != NULL && (ULONG)Frame >= StackBase)
        {
          print_address((PVOID)Frame[1]);
          Frame = (PULONG)Frame[0];
+#ifdef DBG
+          DbgPrint("\n");      /* TMN: Considered a good idea */
+#else
           DbgPrint(" ");
+#endif
        }
 #else
       DbgPrint("Frames: ");
@@ -472,6 +479,9 @@
     * Dump the stack frames
     */
    DbgPrint("Frames: ");
+#ifdef DBG
+  DbgPrint("\n");      /* TMN: Considered a good idea */
+#endif
    i = 1;
    Frame = (PULONG)Tf->Ebp;
    while (Frame != NULL)
@@ -479,7 +489,11 @@
        print_address((PVOID)Frame[1]);
        Frame = (PULONG)Frame[0];
        i++;
+#ifdef DBG
+       DbgPrint("\n"); /* TMN: Considered a good idea */
+#else
        DbgPrint(" ");
+#endif
      }
 }

@@ -564,13 +578,21 @@
   ULONG i;

   DbgPrint("Frames: ");
+#ifdef DBG
+  DbgPrint("\n");      /* TMN: Considered a good idea */
+#endif
+
   i = 1;
   while (Frame != NULL)
     {
       print_address((PVOID)Frame[1]);
       Frame = (PULONG)Frame[0];
       i++;
+#ifdef DBG
+      DbgPrint("\n");  /* TMN: Considered a good idea */
+#else
       DbgPrint(" ");
+#endif
     }
 }




More information about the Ros-kernel mailing list