Commit in reactos on MAIN
ntoskrnl/ke/i386/exp.c+45-221.84 -> 1.85
ntoskrnl/ntoskrnl.def+3-11.182 -> 1.183
        /ntoskrnl.edf+3-11.168 -> 1.169
w32api/include/ddk/winddk.h+111.7 -> 1.8
+62-24
4 modified files
reactos-specific debugging functions KeRosDumpStackFrames and KeRosPrintAddress

reactos/ntoskrnl/ke/i386
exp.c 1.84 -> 1.85
diff -u -r1.84 -r1.85
--- exp.c	13 Mar 2004 18:28:33 -0000	1.84
+++ exp.c	28 May 2004 21:16:27 -0000	1.85
@@ -126,15 +126,15 @@
 /* FUNCTIONS ****************************************************************/
 
 #ifdef KDBG
-STATIC BOOLEAN
-print_address(PVOID address)
+BOOLEAN STDCALL
+KeRosPrintAddress(PVOID address)
 {
   KdbPrintAddress(address);
   return TRUE;
 }
 #else /* KDBG */
-STATIC BOOLEAN 
-print_address(PVOID address)
+BOOLEAN STDCALL
+KeRosPrintAddress(PVOID address)
 {
    PLIST_ENTRY current_entry;
    MODULE_TEXT_SECTION* current;
@@ -268,7 +268,7 @@
        DbgPrint("Exception: %d(%x)\n", ExceptionNr, 0);
      }
    DbgPrint("CS:EIP %x:%x ", OldTss->Cs, OldTss->Eip);
-   print_address((PVOID)OldTss->Eip);
+   KeRosPrintAddress((PVOID)OldTss->Eip);
    DbgPrint("\n");
    DbgPrint("cr2 %x cr3 %x ", cr2_, OldCr3);
    DbgPrint("Proc: %x ",PsGetCurrentProcess());
@@ -327,7 +327,7 @@
       Frame = (PULONG)OldTss->Ebp;
       while (Frame != NULL && (ULONG)Frame >= StackBase)
 	{
-	  print_address((PVOID)Frame[1]);
+	  KeRosPrintAddress((PVOID)Frame[1]);
 	  Frame = (PULONG)Frame[0];
           DbgPrint(" ");
 	}
@@ -391,7 +391,7 @@
 	{
 	  if (StackRepeatCount[i] == 0)
 	    {
-	      print_address(StackTrace[i]);
+	      KeRosPrintAddress(StackTrace[i]);
 	      i++;
 	    }
 	  else
@@ -403,7 +403,7 @@
 		}
 	      for (j = 0; j < StackRepeatLength[i]; j++)
 		{
-		  print_address(StackTrace[i + j]);
+		  KeRosPrintAddress(StackTrace[i + j]);
 		}
 	      DbgPrint("}*%d", StackRepeatCount[i]);
 	      i = i + StackRepeatLength[i] * StackRepeatCount[i];
@@ -444,7 +444,7 @@
      }
    DbgPrint("Processor: %d CS:EIP %x:%x ", KeGetCurrentProcessorNumber(),
 	    Tf->Cs&0xffff, Tf->Eip);
-   print_address((PVOID)Tf->Eip);
+   KeRosPrintAddress((PVOID)Tf->Eip);
    DbgPrint("\n");
    Ke386GetPageTableDirectory(cr3_);
    DbgPrint("cr2 %x cr3 %x ", cr2, cr3_);
@@ -505,7 +505,7 @@
 	   DbgPrint("<INVALID>");
 	   break;
 	 }
-       if (!print_address(Eip))
+       if (!KeRosPrintAddress(Eip))
 	 {
 	   DbgPrint("<%X>", Eip);
 	   break;
@@ -524,7 +524,7 @@
    while (Frame < (PULONG)PsGetCurrentThread()->Tcb.StackBase && i < 50)
      {
 	 ULONG Address = *Frame;
-	 if (print_address((PVOID)Address))
+	 if (KeRosPrintAddress((PVOID)Address))
 	   {
 	     i++;
 	   }
@@ -630,20 +630,43 @@
 VOID 
 KeDumpStackFrames(PULONG Frame)
 {
-  ULONG i;
+	ULONG i;
 
-  DbgPrint("Frames: ");
-  i = 1;
-  while (Frame != NULL)
-    {
-      if (!print_address((PVOID)Frame[1]))
+	DbgPrint("Frames: ");
+	i = 1;
+	while ( MmIsAddressValid(Frame) )
 	{
-	  DbgPrint("<%X>", (PVOID)Frame[1]);
+		if (!KeRosPrintAddress((PVOID)Frame[1]))
+		{
+			DbgPrint("<%X>", (PVOID)Frame[1]);
+		}
+		Frame = (PULONG)Frame[0];
+		i++;
+		DbgPrint(" ");
+	}
+}
+
+VOID STDCALL
+KeRosDumpStackFrames ( PULONG Frame, ULONG FrameCount )
+{
+	ULONG i;
+
+	DbgPrint("Frames: ");
+	if ( !Frame )
+	{
+		__asm__("mov %%ebp, %%ebx" : "=b" (Frame) : );
+		Frame = (PULONG)Frame[0]; // step out of KeRosDumpStackFrames
+	}
+	i = 1;
+	while ( MmIsAddressValid(Frame) && i++ < FrameCount )
+	{
+		if (!KeRosPrintAddress((PVOID)Frame[1]))
+		{
+			DbgPrint("<%X>", (PVOID)Frame[1]);
+		}
+		Frame = (PULONG)Frame[0];
+		DbgPrint(" ");
 	}
-      Frame = (PULONG)Frame[0];
-      i++;
-      DbgPrint(" ");
-    }
 }
 
 static void set_system_call_gate(unsigned int sel, unsigned int func)

reactos/ntoskrnl
ntoskrnl.def 1.182 -> 1.183
diff -u -r1.182 -r1.183
--- ntoskrnl.def	24 May 2004 12:08:55 -0000	1.182
+++ ntoskrnl.def	28 May 2004 21:16:27 -0000	1.183
@@ -1,4 +1,4 @@
-; $Id: ntoskrnl.def,v 1.182 2004/05/24 12:08:55 ekohl Exp $
+; $Id: ntoskrnl.def,v 1.183 2004/05/28 21:16:27 royce Exp $
 ;
 ; reactos/ntoskrnl/ntoskrnl.def
 ;
@@ -684,6 +684,8 @@
 READ_REGISTER_BUFFER_UCHAR@12
 READ_REGISTER_BUFFER_ULONG@12
 READ_REGISTER_BUFFER_USHORT@12
+KeRosPrintAddress@4
+KeRosDumpStackFrames@8
 RtlAbsoluteToSelfRelativeSD@12
 RtlAddAccessAllowedAce@16
 RtlAddAce@20

reactos/ntoskrnl
ntoskrnl.edf 1.168 -> 1.169
diff -u -r1.168 -r1.169
--- ntoskrnl.edf	24 May 2004 12:08:55 -0000	1.168
+++ ntoskrnl.edf	28 May 2004 21:16:27 -0000	1.169
@@ -1,4 +1,4 @@
-; $Id: ntoskrnl.edf,v 1.168 2004/05/24 12:08:55 ekohl Exp $
+; $Id: ntoskrnl.edf,v 1.169 2004/05/28 21:16:27 royce Exp $
 ;
 ; reactos/ntoskrnl/ntoskrnl.def
 ;
@@ -685,6 +685,8 @@
 READ_REGISTER_BUFFER_UCHAR=READ_REGISTER_BUFFER_UCHAR@12
 READ_REGISTER_BUFFER_ULONG=READ_REGISTER_BUFFER_ULONG@12
 READ_REGISTER_BUFFER_USHORT=READ_REGISTER_BUFFER_USHORT@12
+KeRosPrintAddress=KeRosPrintAddress@4
+KeRosDumpStackFrames=KeRosDumpStackFrames@8
 RtlAbsoluteToSelfRelativeSD=RtlAbsoluteToSelfRelativeSD@12
 RtlAddAccessAllowedAce=RtlAddAccessAllowedAce@16
 RtlAddAce=RtlAddAce@20

reactos/w32api/include/ddk
winddk.h 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- winddk.h	9 Apr 2004 20:03:21 -0000	1.7
+++ winddk.h	28 May 2004 21:16:27 -0000	1.8
@@ -9088,6 +9088,17 @@
   IN ULONG  Level,
   IN BOOLEAN  State);
 
+NTOSAPI
+BOOLEAN
+DDKAPI
+KeRosPrintAddress ( PVOID address );
+
+NTOSAPI
+VOID
+DDKAPI
+KeRosDumpStackFrames ( PULONG Frame, ULONG FrameCount );
+
+
 #ifdef DBG
 
 #define KdPrint(_x_) DbgPrint _x_
CVSspam 0.2.8