https://git.reactos.org/?p=reactos.git;a=commitdiff;h=329b9fa2fb486ff17bc9d…
commit 329b9fa2fb486ff17bc9d77aeac96982566780f4
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sun Mar 8 23:16:43 2020 +0100
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Mon Nov 16 08:55:03 2020 +0100
[NTOS:KD] Merge KdpReport() with kd64 version
---
ntoskrnl/include/internal/kd64.h | 4 ++++
ntoskrnl/kd/kdmain.c | 15 ++++++++-------
ntoskrnl/kd64/kdapi.c | 11 ++++++-----
ntoskrnl/kd64/kdtrap.c | 15 ++++-----------
4 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/ntoskrnl/include/internal/kd64.h b/ntoskrnl/include/internal/kd64.h
index 4802c9c9f60..1806b2fcd09 100644
--- a/ntoskrnl/include/internal/kd64.h
+++ b/ntoskrnl/include/internal/kd64.h
@@ -281,6 +281,10 @@ NTAPI
KdpReportExceptionStateChange(
IN PEXCEPTION_RECORD ExceptionRecord,
IN OUT PCONTEXT Context,
+#ifndef _WINKD_
+ IN PKTRAP_FRAME TrapFrame,
+ IN KPROCESSOR_MODE PreviousMode,
+#endif
IN BOOLEAN SecondChanceException
);
diff --git a/ntoskrnl/kd/kdmain.c b/ntoskrnl/kd/kdmain.c
index 53df4366fdb..20b19911bc6 100644
--- a/ntoskrnl/kd/kdmain.c
+++ b/ntoskrnl/kd/kdmain.c
@@ -52,15 +52,13 @@ KdpReportLoadSymbolsStateChange(IN PSTRING PathName,
BOOLEAN
NTAPI
-KdpReport(IN PKTRAP_FRAME TrapFrame,
- IN PKEXCEPTION_FRAME ExceptionFrame,
- IN PEXCEPTION_RECORD ExceptionRecord,
- IN PCONTEXT ContextRecord,
- IN KPROCESSOR_MODE PreviousMode,
- IN BOOLEAN SecondChanceException)
+KdpReportExceptionStateChange(IN PEXCEPTION_RECORD ExceptionRecord,
+ IN OUT PCONTEXT ContextRecord,
+ IN PKTRAP_FRAME TrapFrame,
+ IN KPROCESSOR_MODE PreviousMode,
+ IN BOOLEAN SecondChanceException)
{
KD_CONTINUE_TYPE Return = kdHandleException;
-
#ifdef KDBG
/* Check if this is an assertion failure */
if (ExceptionRecord->ExceptionCode == STATUS_ASSERTION_FAILURE)
@@ -288,6 +286,9 @@ KdDebuggerInitialize1(
/* Call the Wrapper Init Routine */
if (WrapperInitRoutine)
WrapperTable.KdpInitRoutine(&WrapperTable, 1);
+
+ NtGlobalFlag |= FLG_STOP_ON_EXCEPTION;
+
return STATUS_SUCCESS;
}
diff --git a/ntoskrnl/kd64/kdapi.c b/ntoskrnl/kd64/kdapi.c
index 7e5b908a1e4..df8876bc79a 100644
--- a/ntoskrnl/kd64/kdapi.c
+++ b/ntoskrnl/kd64/kdapi.c
@@ -1728,13 +1728,13 @@ KdpReportCommandStringStateChange(IN PSTRING NameString,
}
#endif
+#ifdef _WINKD_
BOOLEAN
NTAPI
KdpReportExceptionStateChange(IN PEXCEPTION_RECORD ExceptionRecord,
IN OUT PCONTEXT Context,
IN BOOLEAN SecondChanceException)
{
-#ifdef _WINKD_
STRING Header, Data;
DBGKD_ANY_WAIT_STATE_CHANGE WaitStateChange;
KCONTINUE_STATUS Status;
@@ -1782,11 +1782,8 @@ KdpReportExceptionStateChange(IN PEXCEPTION_RECORD
ExceptionRecord,
/* Return */
return Status;
-#else
- UNIMPLEMENTED;
- return FALSE;
-#endif
}
+#endif
VOID
NTAPI
@@ -1850,6 +1847,10 @@ KdpSwitchProcessor(IN PEXCEPTION_RECORD ExceptionRecord,
/* Report a state change */
Status = KdpReportExceptionStateChange(ExceptionRecord,
ContextRecord,
+#ifndef _WINKD_
+ NULL,
+ KernelMode,
+#endif
SecondChanceException);
/* Restore the port data and return */
diff --git a/ntoskrnl/kd64/kdtrap.c b/ntoskrnl/kd64/kdtrap.c
index 42a04faa460..8f098952ee2 100644
--- a/ntoskrnl/kd64/kdtrap.c
+++ b/ntoskrnl/kd64/kdtrap.c
@@ -47,16 +47,6 @@
/* FUNCTIONS *****************************************************************/
-#ifndef _WINKD_
-BOOLEAN
-NTAPI
-KdpReport(IN PKTRAP_FRAME TrapFrame,
- IN PKEXCEPTION_FRAME ExceptionFrame,
- IN PEXCEPTION_RECORD ExceptionRecord,
- IN PCONTEXT ContextRecord,
- IN KPROCESSOR_MODE PreviousMode,
- IN BOOLEAN SecondChanceException);
-#else
BOOLEAN
NTAPI
KdpReport(IN PKTRAP_FRAME TrapFrame,
@@ -126,6 +116,10 @@ KdpReport(IN PKTRAP_FRAME TrapFrame,
Handled = KdpReportExceptionStateChange(ExceptionRecord,
&Prcb->ProcessorState.
ContextFrame,
+#ifndef _WINKD_
+ TrapFrame,
+ PreviousMode,
+#endif
SecondChanceException);
/* Now restore the processor state, manually again. */
@@ -139,7 +133,6 @@ KdpReport(IN PKTRAP_FRAME TrapFrame,
KdpControlCPressed = FALSE;
return Handled;
}
-#endif
BOOLEAN
NTAPI