Skip to content

Commit e4e06f8

Browse files
committed
[NTOS:KD] Merge KdpReport() with kd64 version
1 parent 6f5f36d commit e4e06f8

File tree

4 files changed

+22
-23
lines changed

4 files changed

+22
-23
lines changed

ntoskrnl/include/internal/kd64.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ NTAPI
281281
KdpReportExceptionStateChange(
282282
IN PEXCEPTION_RECORD ExceptionRecord,
283283
IN OUT PCONTEXT Context,
284+
#ifndef _WINKD_
285+
IN PKTRAP_FRAME TrapFrame,
286+
IN KPROCESSOR_MODE PreviousMode,
287+
#endif
284288
IN BOOLEAN SecondChanceException
285289
);
286290

ntoskrnl/kd/kdmain.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ KdpReportLoadSymbolsStateChange(IN PSTRING PathName,
3939

4040
BOOLEAN
4141
NTAPI
42-
KdpReport(IN PKTRAP_FRAME TrapFrame,
43-
IN PKEXCEPTION_FRAME ExceptionFrame,
44-
IN PEXCEPTION_RECORD ExceptionRecord,
45-
IN PCONTEXT ContextRecord,
46-
IN KPROCESSOR_MODE PreviousMode,
47-
IN BOOLEAN SecondChanceException)
42+
KdpReportExceptionStateChange(IN PEXCEPTION_RECORD ExceptionRecord,
43+
IN OUT PCONTEXT ContextRecord,
44+
IN PKTRAP_FRAME TrapFrame,
45+
IN KPROCESSOR_MODE PreviousMode,
46+
IN BOOLEAN SecondChanceException)
4847
{
4948
KD_CONTINUE_TYPE Return = kdHandleException;
50-
5149
#ifdef KDBG
5250
/* Check if this is an assertion failure */
5351
if (ExceptionRecord->ExceptionCode == STATUS_ASSERTION_FAILURE)
@@ -275,6 +273,9 @@ KdDebuggerInitialize1(
275273
/* Call the Wrapper Init Routine */
276274
if (WrapperInitRoutine)
277275
WrapperTable.KdpInitRoutine(&WrapperTable, 1);
276+
277+
NtGlobalFlag |= FLG_STOP_ON_EXCEPTION;
278+
278279
return STATUS_SUCCESS;
279280
}
280281

ntoskrnl/kd64/kdapi.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,13 +1728,13 @@ KdpReportCommandStringStateChange(IN PSTRING NameString,
17281728
}
17291729
#endif
17301730

1731+
#ifdef _WINKD_
17311732
BOOLEAN
17321733
NTAPI
17331734
KdpReportExceptionStateChange(IN PEXCEPTION_RECORD ExceptionRecord,
17341735
IN OUT PCONTEXT Context,
17351736
IN BOOLEAN SecondChanceException)
17361737
{
1737-
#ifdef _WINKD_
17381738
STRING Header, Data;
17391739
DBGKD_ANY_WAIT_STATE_CHANGE WaitStateChange;
17401740
KCONTINUE_STATUS Status;
@@ -1782,11 +1782,8 @@ KdpReportExceptionStateChange(IN PEXCEPTION_RECORD ExceptionRecord,
17821782

17831783
/* Return */
17841784
return Status;
1785-
#else
1786-
UNIMPLEMENTED;
1787-
return FALSE;
1788-
#endif
17891785
}
1786+
#endif
17901787

17911788
VOID
17921789
NTAPI
@@ -1850,6 +1847,10 @@ KdpSwitchProcessor(IN PEXCEPTION_RECORD ExceptionRecord,
18501847
/* Report a state change */
18511848
Status = KdpReportExceptionStateChange(ExceptionRecord,
18521849
ContextRecord,
1850+
#ifndef _WINKD_
1851+
NULL,
1852+
KernelMode,
1853+
#endif
18531854
SecondChanceException);
18541855

18551856
/* Restore the port data and return */

ntoskrnl/kd64/kdtrap.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@
4747

4848
/* FUNCTIONS *****************************************************************/
4949

50-
#ifndef _WINKD_
51-
BOOLEAN
52-
NTAPI
53-
KdpReport(IN PKTRAP_FRAME TrapFrame,
54-
IN PKEXCEPTION_FRAME ExceptionFrame,
55-
IN PEXCEPTION_RECORD ExceptionRecord,
56-
IN PCONTEXT ContextRecord,
57-
IN KPROCESSOR_MODE PreviousMode,
58-
IN BOOLEAN SecondChanceException);
59-
#else
6050
BOOLEAN
6151
NTAPI
6252
KdpReport(IN PKTRAP_FRAME TrapFrame,
@@ -126,6 +116,10 @@ KdpReport(IN PKTRAP_FRAME TrapFrame,
126116
Handled = KdpReportExceptionStateChange(ExceptionRecord,
127117
&Prcb->ProcessorState.
128118
ContextFrame,
119+
#ifndef _WINKD_
120+
TrapFrame,
121+
PreviousMode,
122+
#endif
129123
SecondChanceException);
130124

131125
/* Now restore the processor state, manually again. */
@@ -139,7 +133,6 @@ KdpReport(IN PKTRAP_FRAME TrapFrame,
139133
KdpControlCPressed = FALSE;
140134
return Handled;
141135
}
142-
#endif
143136

144137
BOOLEAN
145138
NTAPI

0 commit comments

Comments
 (0)