2003-08-11 Casper S. Hornstrup <chorns@users.sourceforge.net>
[reactos.git] / reactos / ntoskrnl / include / internal / kd.h
1 /* $Id: kd.h,v 1.19 2003/08/11 18:50:12 chorns Exp $
2 *
3 * kernel debugger prototypes
4 */
5
6 #ifndef __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H
7 #define __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H
8
9 #include <internal/ke.h>
10 #include <internal/ldr.h>
11
12 #define KD_DEBUG_DISABLED 0x00
13 #define KD_DEBUG_GDB 0x01
14 #define KD_DEBUG_PICE 0x02
15 #define KD_DEBUG_SCREEN 0x04
16 #define KD_DEBUG_SERIAL 0x08
17 #define KD_DEBUG_BOCHS 0x10
18 #define KD_DEBUG_FILELOG 0x20
19 #define KD_DEBUG_MDA 0x40
20 #define KD_DEBUG_KDB 0x80
21
22 extern ULONG KdDebugState;
23
24 KD_PORT_INFORMATION GdbPortInfo;
25 KD_PORT_INFORMATION LogPortInfo;
26
27 typedef enum _KD_CONTINUE_TYPE
28 {
29 kdContinue = 0,
30 kdDoNotHandleException,
31 kdHandleException
32 } KD_CONTINUE_TYPE;
33
34 ULONG
35 KdpPrintString (PANSI_STRING String);
36
37 VOID
38 DebugLogWrite(PCH String);
39 VOID
40 DebugLogInit(VOID);
41 VOID
42 DebugLogInit2(VOID);
43
44 VOID
45 KdInit1(VOID);
46
47 VOID
48 KdInit2(VOID);
49
50 VOID
51 KdInit3(VOID);
52
53 VOID
54 KdPutChar(UCHAR Value);
55
56 UCHAR
57 KdGetChar(VOID);
58
59 VOID
60 KdGdbStubInit(ULONG Phase);
61
62 VOID
63 KdGdbDebugPrint (LPSTR Message);
64
65 VOID
66 KdDebugPrint (LPSTR Message);
67
68 KD_CONTINUE_TYPE
69 KdEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord,
70 PCONTEXT Context,
71 PKTRAP_FRAME TrapFrame);
72 VOID KdInitializeMda(VOID);
73 VOID KdPrintMda(PCH pch);
74
75 #ifndef KDBG
76 #define KDB_DELETEPROCESS_HOOK(PROCESS)
77 #define KDB_LOADDRIVER_HOOK(FILENAME, MODULE)
78 #define KDB_UNLOADDRIVER_HOOK(MODULE)
79 #define KDB_LOADERINIT_HOOK(NTOS, HAL)
80 #define KDB_SYMBOLFILE_HOOK(LOADBASE, FILENAME, LENGTH)
81 #else
82 #define KDB_DELETEPROCESS_HOOK(PROCESS) KdbFreeSymbolsProcess(PROCESS)
83 #define KDB_LOADDRIVER_HOOK(FILENAME, MODULE) KdbLoadDriver(FILENAME, MODULE)
84 #define KDB_UNLOADDRIVER_HOOK(MODULE) KdbUnloadDriver(MODULE)
85 #define KDB_LOADERINIT_HOOK(NTOS, HAL) KdbLdrInit(NTOS, HAL)
86 #define KDB_SYMBOLFILE_HOOK(LOADBASE, FILENAME, LENGTH) \
87 KdbProcessSymbolFile(LOADBASE, FILENAME, LENGTH)
88 #endif /* KDBG */
89
90 VOID
91 KdbLdrLoadUserModuleSymbols(PLDR_MODULE LdrModule);
92 VOID
93 KdbProcessSymbolFile(PVOID ModuleLoadBase, PCHAR FileName, ULONG Length);
94 VOID
95 KdbLdrInit(MODULE_TEXT_SECTION* NtoskrnlTextSection,
96 MODULE_TEXT_SECTION* LdrHalTextSection);
97 VOID
98 KdbUnloadDriver(PMODULE_OBJECT ModuleObject);
99 VOID
100 KdbLoadDriver(PUNICODE_STRING Filename, PMODULE_OBJECT Module);
101 VOID
102 KdbFreeSymbolsProcess(PEPROCESS Process);
103 BOOLEAN
104 KdbPrintAddress(PVOID address);
105 KD_CONTINUE_TYPE
106 KdbEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord,
107 PCONTEXT Context,
108 PKTRAP_FRAME TrapFrame);
109
110 #endif /* __INCLUDE_INTERNAL_KERNEL_DEBUGGER_H */