reactos/ntoskrnl/ke/i386
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
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
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