[NTOS:KD] Rename KdpEnterDebuggerException to KdpTrap + add KdpStub forwarder

This removes somes uses of _WINKD_ macro.
This commit is contained in:
Hervé Poussineau 2020-03-07 18:54:21 +01:00
parent 4d84c856ad
commit d0e2fada23
3 changed files with 18 additions and 10 deletions

View file

@ -158,7 +158,7 @@ KdpServiceDispatcher(ULONG Service,
BOOLEAN BOOLEAN
NTAPI NTAPI
KdpEnterDebuggerException(IN PKTRAP_FRAME TrapFrame, KdpTrap(IN PKTRAP_FRAME TrapFrame,
IN PKEXCEPTION_FRAME ExceptionFrame, IN PKEXCEPTION_FRAME ExceptionFrame,
IN PEXCEPTION_RECORD ExceptionRecord, IN PEXCEPTION_RECORD ExceptionRecord,
IN PCONTEXT Context, IN PCONTEXT Context,
@ -292,6 +292,23 @@ KdpEnterDebuggerException(IN PKTRAP_FRAME TrapFrame,
return TRUE; return TRUE;
} }
BOOLEAN
NTAPI
KdpStub(IN PKTRAP_FRAME TrapFrame,
IN PKEXCEPTION_FRAME ExceptionFrame,
IN PEXCEPTION_RECORD ExceptionRecord,
IN PCONTEXT ContextRecord,
IN KPROCESSOR_MODE PreviousMode,
IN BOOLEAN SecondChanceException)
{
return KdpTrap(TrapFrame,
ExceptionFrame,
ExceptionRecord,
ContextRecord,
PreviousMode,
SecondChanceException);
}
BOOLEAN BOOLEAN
NTAPI NTAPI
KdIsThisAKdTrap(IN PEXCEPTION_RECORD ExceptionRecord, KdIsThisAKdTrap(IN PEXCEPTION_RECORD ExceptionRecord,
@ -414,9 +431,6 @@ KdSystemDebugControl(IN SYSDBG_COMMAND Command,
PreviousMode); PreviousMode);
} }
PKDEBUG_ROUTINE KiDebugRoutine = KdpEnterDebuggerException;
CODE_SEG("INIT")
PCHAR PCHAR
NTAPI NTAPI
KdpGetDebugMode(PCHAR Currentp2) KdpGetDebugMode(PCHAR Currentp2)

View file

@ -71,9 +71,7 @@ BOOLEAN KdpContextSent;
// //
// Debug Trap Handlers // Debug Trap Handlers
// //
#ifdef _WINKD_
PKDEBUG_ROUTINE KiDebugRoutine = KdpStub; PKDEBUG_ROUTINE KiDebugRoutine = KdpStub;
#endif
PKDEBUG_SWITCH_ROUTINE KiDebugSwitchRoutine; PKDEBUG_SWITCH_ROUTINE KiDebugSwitchRoutine;
// //

View file

@ -171,10 +171,8 @@ KdInitSystem(IN ULONG BootPhase,
/* Check if we already initialized once */ /* Check if we already initialized once */
if (KdDebuggerEnabled) return TRUE; if (KdDebuggerEnabled) return TRUE;
#ifdef _WINKD_
/* Set the Debug Routine as the Stub for now */ /* Set the Debug Routine as the Stub for now */
KiDebugRoutine = KdpStub; KiDebugRoutine = KdpStub;
#endif
/* Disable break after symbol load for now */ /* Disable break after symbol load for now */
KdBreakAfterSymbolLoad = FALSE; KdBreakAfterSymbolLoad = FALSE;
@ -368,10 +366,8 @@ KdInitSystem(IN ULONG BootPhase,
/* Initialize the debugger if requested */ /* Initialize the debugger if requested */
if (EnableKd && (NT_SUCCESS(KdDebuggerInitialize0(LoaderBlock)))) if (EnableKd && (NT_SUCCESS(KdDebuggerInitialize0(LoaderBlock))))
{ {
#ifdef _WINKD_
/* Now set our real KD routine */ /* Now set our real KD routine */
KiDebugRoutine = KdpTrap; KiDebugRoutine = KdpTrap;
#endif
/* Check if we've already initialized our structures */ /* Check if we've already initialized our structures */
if (!KdpDebuggerStructuresInitialized) if (!KdpDebuggerStructuresInitialized)