4 #define KdDebuggerEnabled _KdDebuggerEnabled
5 #define KdDebuggerNotPresent _KdDebuggerNotPresent
9 // Kernel Debugger Port Definition
11 typedef struct _KD_PORT_INFORMATION
16 } KD_PORT_INFORMATION
, *PKD_PORT_INFORMATION
;
18 struct _KD_DISPATCH_TABLE
;
19 extern KD_PORT_INFORMATION GdbPortInfo
;
20 extern BOOLEAN _KdDebuggerEnabled
;
21 extern BOOLEAN _KdDebuggerNotPresent
;
22 extern BOOLEAN KdBreakAfterSymbolLoad
;
23 extern BOOLEAN KdPitchDebugger
;
24 extern BOOLEAN KdIgnoreUmExceptions
;
29 PKD_PORT_INFORMATION PortInformation
,
37 PKD_PORT_INFORMATION PortInformation
,
50 PKD_PORT_INFORMATION PortInformation
,
62 PKD_PORT_INFORMATION PortInformation
,
66 /* SYMBOL ROUTINES **********************************************************/
69 #if defined(KDBG) || DBG
73 IN PLDR_DATA_TABLE_ENTRY LdrEntry
);
81 KdbSymGetAddressInformation(
82 IN PROSSYM_INFO RosSymInfo
,
83 IN ULONG_PTR RelativeAddress
,
84 OUT PULONG LineNumber OPTIONAL
,
85 OUT PCH FileName OPTIONAL
,
86 OUT PCH FunctionName OPTIONAL
91 # define KdbInit() KdbpCliInit()
92 # define KdbModuleLoaded(FILENAME) KdbpCliModuleLoaded(FILENAME)
94 # define KdbEnterDebuggerException(ER, PM, C, TF, F) kdHandleException
95 # define KdbInit() do { } while (0)
96 # define KdbEnter() do { } while (0)
97 # define KdbModuleLoaded(X) do { } while (0)
100 /* KD ROUTINES ***************************************************************/
102 typedef enum _KD_CONTINUE_TYPE
105 kdDoNotHandleException
,
112 (NTAPI
*PKDP_INIT_ROUTINE
)(
113 struct _KD_DISPATCH_TABLE
*DispatchTable
,
119 (NTAPI
*PKDP_PRINT_ROUTINE
)(
126 (NTAPI
*PKDP_PROMPT_ROUTINE
)(PCH String
);
130 (NTAPI
*PKDP_EXCEPTION_ROUTINE
)(
131 PEXCEPTION_RECORD ExceptionRecord
,
133 PKTRAP_FRAME TrapFrame
139 IN PEXCEPTION_RECORD ExceptionRecord
,
141 IN KPROCESSOR_MODE PreviousMode
144 /* INIT ROUTINES *************************************************************/
150 PLOADER_PARAMETER_BLOCK LoaderBlock
156 struct _KD_DISPATCH_TABLE
*DispatchTable
,
163 struct _KD_DISPATCH_TABLE
*DispatchTable
,
170 struct _KD_DISPATCH_TABLE
*DispatchTable
,
177 struct _KD_DISPATCH_TABLE
*DispatchTable
,
184 struct _KD_DISPATCH_TABLE
*DispatchTable
,
190 struct _KD_DISPATCH_TABLE
*DispatchTable
,
194 /* KD ROUTINES ***************************************************************/
199 IN PKTRAP_FRAME TrapFrame
,
200 IN PEXCEPTION_RECORD ExceptionRecord
,
214 IN USHORT InStringLength
,
216 IN USHORT OutStringLength
221 KdpDetectConflicts(PCM_RESOURCE_LIST DriverList
);
251 /* KD GLOBALS ***************************************************************/
255 (NTAPI
*PKDEBUG_ROUTINE
)(
256 IN PKTRAP_FRAME TrapFrame
,
257 IN PKEXCEPTION_FRAME ExceptionFrame
,
258 IN PEXCEPTION_RECORD ExceptionRecord
,
260 IN KPROCESSOR_MODE PreviousMode
,
261 IN BOOLEAN SecondChance
264 /* serial debug connection */
265 #define DEFAULT_DEBUG_PORT 2 /* COM2 */
266 #define DEFAULT_DEBUG_COM1_IRQ 4 /* COM1 IRQ */
267 #define DEFAULT_DEBUG_COM2_IRQ 3 /* COM2 IRQ */
268 #define DEFAULT_DEBUG_BAUD_RATE 115200 /* 115200 Baud */
270 /* KD Native Modes */
278 /* KD Private Debug Modes */
279 typedef struct _KDP_DEBUG_MODE
291 /* Currently Supported Wrappers */
302 /* KD Internal Debug Services */
303 typedef enum _KDP_DEBUG_SERVICE
305 DumpNonPagedPool
= 0x1e, /* a */
306 ManualBugCheck
= 0x30, /* b */
307 DumpNonPagedPoolStats
= 0x2e, /* c */
308 DumpNewNonPagedPool
= 0x20, /* d */
309 DumpNewNonPagedPoolStats
= 0x12, /* e */
310 DumpAllThreads
= 0x21, /* f */
311 DumpUserThreads
= 0x22, /* g */
312 KdSpare1
= 0x23, /* h */
313 KdSpare2
= 0x17, /* i */
314 KdSpare3
= 0x24, /* j */
315 EnterDebugger
= 0x25, /* k */
316 ThatsWhatSheSaid
= 69 /* FIGURE IT OUT */
320 /* Dispatch Table for Wrapper Functions */
321 typedef struct _KD_DISPATCH_TABLE
323 LIST_ENTRY KdProvidersList
;
324 PKDP_INIT_ROUTINE KdpInitRoutine
;
325 PKDP_PRINT_ROUTINE KdpPrintRoutine
;
326 PKDP_PROMPT_ROUTINE KdpPromptRoutine
;
327 PKDP_EXCEPTION_ROUTINE KdpExceptionRoutine
;
329 KD_DISPATCH_TABLE
, *PKD_DISPATCH_TABLE
;
331 /* The current Debugging Mode */
332 extern KDP_DEBUG_MODE KdpDebugMode
;
334 /* The current Port IRQ */
335 extern ULONG KdpPortIrq
;
337 /* The current Port */
338 extern ULONG KdpPort
;
340 /* Port Information for the Serial Native Mode */
341 extern KD_PORT_INFORMATION SerialPortInfo
;
343 /* Init Functions for Native Providers */
344 extern PKDP_INIT_ROUTINE InitRoutines
[KdMax
];
346 /* Wrapper Init Function */
347 extern PKDP_INIT_ROUTINE WrapperInitRoutine
;
349 /* Dispatch Tables for Native Providers */
350 extern KD_DISPATCH_TABLE DispatchTable
[KdMax
];
352 /* Dispatch Table for the Wrapper */
353 extern KD_DISPATCH_TABLE WrapperTable
;
355 /* The KD Native Provider List */
356 extern LIST_ENTRY KdProviders
;
358 /* Whether to enter KDB as early as possible or not */
359 extern BOOLEAN KdpEarlyBreak
;
361 extern PKDEBUG_ROUTINE KiDebugRoutine
;
362 extern KD_CONTEXT KdpContext
;
363 extern ULONG Kd_WIN2000_Mask
;