Skip to content

Commit f814311

Browse files
committed
[NTOS:KD] Use a PCONTEXT instead of a PKTRAP_FRAME in KDBG
1 parent 5b029ad commit f814311

File tree

7 files changed

+170
-284
lines changed

7 files changed

+170
-284
lines changed

ntoskrnl/kd/kdmain.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,27 @@ KdpReportExceptionStateChange(IN PEXCEPTION_RECORD ExceptionRecord,
2929
{
3030
KD_CONTINUE_TYPE Return = kdHandleException;
3131
#ifdef KDBG
32+
EXCEPTION_RECORD64 ExceptionRecord64;
33+
3234
/* Check if this is an assertion failure */
3335
if (ExceptionRecord->ExceptionCode == STATUS_ASSERTION_FAILURE)
3436
{
3537
/* Bump EIP to the instruction following the int 2C */
3638
ContextRecord->Eip += 2;
3739
}
40+
41+
ExceptionRecord32To64((PEXCEPTION_RECORD32)ExceptionRecord,
42+
&ExceptionRecord64);
3843
#endif
3944

4045
/* Get out of here if the Debugger isn't connected */
4146
if (KdDebuggerNotPresent) return FALSE;
4247

4348
#ifdef KDBG
4449
/* Call KDBG if available */
45-
Return = KdbEnterDebuggerException(ExceptionRecord,
50+
Return = KdbEnterDebuggerException(&ExceptionRecord64,
4651
PreviousMode,
4752
ContextRecord,
48-
TrapFrame,
4953
!SecondChanceException);
5054
#else /* not KDBG */
5155
/* We'll manually dump the stack for the user... */

ntoskrnl/kdbg/i386/kdb_help.S

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <asm.inc>
33
#include <ks386.inc>
44

5-
EXTERN _KdbEnterDebuggerException:PROC
5+
EXTERN _KdbEnterDebuggerFirstChanceException:PROC
66

77
.code
88

@@ -61,12 +61,8 @@ _KdbEnter:
6161
* Call KDB
6262
*/
6363
mov eax, esp
64-
push 1 /* FirstChance */
6564
push eax /* Push a pointer to the trap frame */
66-
push 0 /* Context */
67-
push 0 /* PreviousMode (KernelMode) */
68-
push 0 /* ExceptionRecord */
69-
call _KdbEnterDebuggerException
65+
call _KdbEnterDebuggerFirstChanceException
7066

7167
/*
7268
* Pop the arguments and unused portions of the trap frame:

0 commit comments

Comments
 (0)