Author: tfaber
Date: Sun Feb 19 08:38:09 2012
New Revision: 55701
URL:
http://svn.reactos.org/svn/reactos?rev=55701&view=rev
Log:
[NTOSKRNL]
- Make Trap debugging usable again. Suggested by Stefan.
Modified:
trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h
trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
trunk/reactos/ntoskrnl/ke/i386/v86vdm.c
Modified: trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h [iso-8859-1] Sun Feb 19 08:38:09
2012
@@ -98,7 +98,7 @@
VOID
FORCEINLINE
KiExitTrapDebugChecks(IN PKTRAP_FRAME TrapFrame,
- IN KTRAP_EXIT_SKIP_BITS SkipBits)
+ IN BOOLEAN SkipPreviousMode)
{
/* Make sure interrupts are disabled */
if (__readeflags() & EFLAGS_INTERRUPT_MASK)
@@ -137,7 +137,7 @@
}
/* If we're ignoring previous mode, make sure caller doesn't actually want it
*/
- if ((SkipBits.SkipPreviousMode) && (TrapFrame->PreviousPreviousMode !=
-1))
+ if (SkipPreviousMode && (TrapFrame->PreviousPreviousMode != -1))
{
DbgPrint("Exiting a trap witout restoring previous mode, yet previous mode
seems valid: %lx\n", TrapFrame->PreviousPreviousMode);
__debugbreak();
Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Sun Feb 19 08:38:09 2012
@@ -82,7 +82,7 @@
VOID
FORCEINLINE
-KiCommonExit(IN PKTRAP_FRAME TrapFrame, const ULONG Flags)
+KiCommonExit(IN PKTRAP_FRAME TrapFrame, BOOLEAN SkipPreviousMode)
{
/* Disable interrupts until we return */
_disable();
@@ -91,7 +91,7 @@
KiCheckForApcDelivery(TrapFrame);
/* Debugging checks */
- KiExitTrapDebugChecks(TrapFrame, Flags);
+ KiExitTrapDebugChecks(TrapFrame, SkipPreviousMode);
/* Restore the SEH handler chain */
KeGetPcr()->NtTib.ExceptionList = TrapFrame->ExceptionList;
@@ -112,7 +112,7 @@
KiEoiHelper(IN PKTRAP_FRAME TrapFrame)
{
/* Common trap exit code */
- KiCommonExit(TrapFrame, 0);
+ KiCommonExit(TrapFrame, TRUE);
/* Check if this was a V8086 trap */
if (TrapFrame->EFlags & EFLAGS_V86_MASK) KiTrapReturnNoSegments(TrapFrame);
@@ -140,7 +140,7 @@
TrapFrame->Eax = Status;
/* Common trap exit code */
- KiCommonExit(TrapFrame, 0);
+ KiCommonExit(TrapFrame, FALSE);
/* Restore previous mode */
KeGetCurrentThread()->PreviousMode = (CCHAR)TrapFrame->PreviousPreviousMode;
@@ -171,7 +171,7 @@
KiServiceExit2(IN PKTRAP_FRAME TrapFrame)
{
/* Common trap exit code */
- KiCommonExit(TrapFrame, 0);
+ KiCommonExit(TrapFrame, FALSE);
/* Restore previous mode */
KeGetCurrentThread()->PreviousMode = (CCHAR)TrapFrame->PreviousPreviousMode;
Modified: trunk/reactos/ntoskrnl/ke/i386/v86vdm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/v86vdm.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/v86vdm.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/v86vdm.c [iso-8859-1] Sun Feb 19 08:38:09 2012
@@ -526,8 +526,10 @@
TrapFrame->HardwareEsp = 0x11FFE;
TrapFrame->ExceptionList = EXCEPTION_CHAIN_END;
TrapFrame->Dr7 = 0;
- //TrapFrame->DbgArgMark = 0xBADB0D00;
+#ifdef TRAP_DEBUG
+ TrapFrame->DbgArgMark = 0xBADB0D00;
TrapFrame->PreviousPreviousMode = -1;
+#endif
/* Disable interrupts */
_disable();