ReactOS 0.4.16-dev-306-g647d351
kdb.h
Go to the documentation of this file.
1#pragma once
2#include "../kd/kd.h"
3
4/* TYPES *********************************************************************/
5
6/* from kdb.c */
8
10{
16
17typedef enum _KDB_ACCESS_TYPE
18{
24
25typedef struct _KDB_BREAKPOINT
26{
27 KDB_BREAKPOINT_TYPE Type; /* Type of breakpoint */
28 BOOLEAN Enabled; /* Whether the bp is enabled */
29 ULONG_PTR Address; /* Address of the breakpoint */
30 BOOLEAN Global; /* Whether the breakpoint is global or local to a process */
31 PEPROCESS Process; /* Owning process */
34 union {
35 /* KdbBreakPointSoftware */
37 /* KdbBreakPointHardware */
38 struct {
42 } Hw;
45
47{
53
55{
60
61
62/* GLOBALS *******************************************************************/
63
64extern volatile PCHAR KdbInitFileBuffer;
65
72
73
74/* FUNCTIONS *****************************************************************/
75
76/* from i386/i386-dis.c */
77
78LONG
81 IN ULONG IntelSyntax);
82
83LONG
86
87/* from i386/kdb_help.S */
88
91 IN PVOID NewStack,
92 IN VOID (*Function)(VOID));
93
94/* from kdb_cli.c */
95
100 _In_ ULONG BootPhase);
101
103NTAPI
106 BOOLEAN Deregister);
107
110
111VOID
113 IN BOOLEAN EnteredOnSingleStep);
114
115VOID
117
118VOID
121
122PCSTR
124 _Inout_ PLONG NextIndex,
125 _In_ BOOLEAN Next);
126
127VOID
130 _In_ ULONG BufLength);
131
132VOID
135 _In_ ...);
136
137VOID
140
142NTAPI
144 IN PCHAR pszNum,
145 OUT ULONG_PTR *pulValue);
146
147/* from kdb_expr.c */
148
152 IN PKDB_KTRAP_FRAME TrapFrame,
154 OUT PLONG ErrOffset OPTIONAL,
156
157PVOID
160 OUT PLONG ErrOffset OPTIONAL,
162
166 IN PKDB_KTRAP_FRAME TrapFrame,
168 OUT PLONG ErrOffset OPTIONAL,
170
171/* from kdb_symbols.c */
172
177 OUT PLDR_DATA_TABLE_ENTRY* pLdrEntry);
178
183
184VOID
187 _In_ BOOLEAN Load);
188
191 _In_ ULONG BootPhase);
192
193/* from kdb.c */
194
195LONG
198
201 IN ULONG BreakPointNr,
205 OUT KDB_ACCESS_TYPE *AccessType OPTIONAL,
206 OUT UCHAR *DebugReg OPTIONAL,
210 OUT PCHAR *ConditionExpression OPTIONAL);
211
217 IN KDB_ACCESS_TYPE AccessType OPTIONAL,
218 IN PCHAR ConditionExpression OPTIONAL,
220 OUT PLONG BreakPointNr OPTIONAL);
221
224 IN LONG BreakPointNr OPTIONAL,
225 IN OUT PKDB_BREAKPOINT BreakPoint OPTIONAL);
226
229 IN LONG BreakPointNr OPTIONAL,
230 IN OUT PKDB_BREAKPOINT BreakPoint OPTIONAL);
231
234 IN LONG BreakPointNr OPTIONAL,
235 IN OUT PKDB_BREAKPOINT BreakPoint OPTIONAL);
236
239 IN LONG ExceptionNr,
240 IN BOOLEAN FirstChance,
242
245 IN LONG ExceptionNr,
246 IN BOOLEAN FirstChance,
248
251 PVOID ThreadId);
252
256
257VOID
259 _In_ PCSTR p1);
260
265 IN BOOLEAN FirstChance);
266
267/* other functions */
268
270NTAPI
272 IN ULONG_PTR Addr,
273 IN LONG Len,
275);
276
278NTAPI
280 IN ULONG_PTR Addr,
281 IN LONG Len,
283);
284
287 IN PVOID Src,
288 IN ULONG Bytes);
289
292 IN PVOID Src,
293 IN ULONG Bytes);
294
295VOID
297
298VOID
300
301
302/* From kdb_print.c */
303
304VOID
306 _In_ const CSTRING* Output);
307
308USHORT
310 _In_ const CSTRING* PromptString,
311 _Inout_ PSTRING ResponseString);
312
313VOID
317
318VOID
319KdbPuts(
321
322VOID
326 ...);
327
328SIZE_T
330 _In_ PCSTR Prompt,
PCWSTR Expression
unsigned char BOOLEAN
Type
Definition: Type.h:7
#define __cdecl
Definition: accygwin.h:79
LONG NTSTATUS
Definition: precomp.h:26
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
Definition: cdrom.h:1156
Definition: bufpool.h:45
#define Len
Definition: deflate.h:82
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2712
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
return pTarget Start()
VOID KdbpPager(_In_ PCHAR Buffer, _In_ ULONG BufLength)
Prints the given string with, page by page.
Definition: kdb_cli.c:3063
PEPROCESS KdbCurrentProcess
Definition: kdb.c:52
enum _KD_CONTINUE_TYPE KD_CONTINUE_TYPE
LONG KdbpGetNextBreakPointNr(IN ULONG Start OPTIONAL)
Gets the number of the next breakpoint >= Start.
Definition: kdb.c:382
BOOLEAN KdbSymPrintAddress(IN PVOID Address, IN PCONTEXT Context)
Print address...
Definition: kdb_symbols.c:149
PETHREAD KdbCurrentThread
Definition: kdb.c:54
enum _KDB_ENTER_CONDITION KDB_ENTER_CONDITION
PCSTR KdbGetHistoryEntry(_Inout_ PLONG NextIndex, _In_ BOOLEAN Next)
Definition: kdprompt.c:24
PKDB_KTRAP_FRAME KdbCurrentTrapFrame
Definition: kdb.c:56
CONTEXT * PKDB_KTRAP_FRAME
Definition: kdb.h:7
struct _KDB_BREAKPOINT * PKDB_BREAKPOINT
VOID KdbPrintString(_In_ const CSTRING *Output)
Definition: kdb_print.c:64
_KDB_BREAKPOINT_TYPE
Definition: kdb.h:10
@ KdbBreakPointSoftware
Definition: kdb.h:12
@ KdbBreakPointNone
Definition: kdb.h:11
@ KdbBreakPointTemporary
Definition: kdb.h:14
@ KdbBreakPointHardware
Definition: kdb.h:13
VOID KdbpCliInterpretInitFile(VOID)
Interprets the KDBinit file from the \SystemRoot\System32\drivers\etc directory, that has been loaded...
Definition: kdb_cli.c:3351
BOOLEAN NTAPI KdbRegisterCliCallback(PVOID Callback, BOOLEAN Deregister)
Definition: kdb_cli.c:3124
USHORT KdbPromptString(_In_ const CSTRING *PromptString, _Inout_ PSTRING ResponseString)
Definition: kdb_print.c:125
BOOLEAN KdbpSetEnterCondition(IN LONG ExceptionNr, IN BOOLEAN FirstChance, IN KDB_ENTER_CONDITION Condition)
Sets the first or last chance enter-condition for exception nr. ExceptionNr.
Definition: kdb.c:995
PVOID KdbpRpnParseExpression(IN PCHAR Expression, OUT PLONG ErrOffset OPTIONAL, OUT PCHAR ErrMsg OPTIONAL)
Parses the given expression and returns a "handle" to it.
Definition: kdb_expr.c:1146
BOOLEAN KdbpDisableBreakPoint(IN LONG BreakPointNr OPTIONAL, IN OUT PKDB_BREAKPOINT BreakPoint OPTIONAL)
Disables a breakpoint.
Definition: kdb.c:868
BOOLEAN KdbpGetEnterCondition(IN LONG ExceptionNr, IN BOOLEAN FirstChance, OUT KDB_ENTER_CONDITION *Condition)
Gets the first or last chance enter-condition for exception nr. ExceptionNr.
Definition: kdb.c:973
BOOLEAN KdbpRpnEvaluateExpression(IN PCHAR Expression, IN PKDB_KTRAP_FRAME TrapFrame, OUT PULONGLONG Result, OUT PLONG ErrOffset OPTIONAL, OUT PCHAR ErrMsg OPTIONAL)
Evaluates the given expression.
Definition: kdb_expr.c:1106
BOOLEAN KdbpRpnEvaluateParsedExpression(IN PVOID Expression, IN PKDB_KTRAP_FRAME TrapFrame, OUT PULONGLONG Result, OUT PLONG ErrOffset OPTIONAL, OUT PCHAR ErrMsg OPTIONAL)
Evaluates the given expression and returns the result.
Definition: kdb_expr.c:1200
VOID NTAPI KdbpStackSwitchAndCall(IN PVOID NewStack, IN VOID(*Function)(VOID))
NTSTATUS NTAPI KdbInitialize(_In_ PKD_DISPATCH_TABLE DispatchTable, _In_ ULONG BootPhase)
Initializes the KDBG debugger.
Definition: kdb_cli.c:3554
VOID KdbpPrintUnicodeString(_In_ PCUNICODE_STRING String)
Definition: kdb_cli.c:3104
BOOLEAN NTAPI KdpSafeWriteMemory(IN ULONG_PTR Addr, IN LONG Len, IN ULONGLONG Value)
volatile PCHAR KdbInitFileBuffer
Definition: kdb_cli.c:137
_KD_CONTINUE_TYPE
Definition: kdb.h:55
@ kdDoNotHandleException
Definition: kdb.h:57
@ kdContinue
Definition: kdb.h:56
@ kdHandleException
Definition: kdb.h:58
VOID KdbpCommandHistoryAppend(_In_ PCSTR Command)
Appends a command to the command history.
Definition: kdb_cmdhist.c:37
VOID KdbPuts(_In_ PCSTR String)
Definition: kdb_print.c:152
_KDB_ACCESS_TYPE
Definition: kdb.h:18
@ KdbAccessExec
Definition: kdb.h:22
@ KdbAccessRead
Definition: kdb.h:19
@ KdbAccessReadWrite
Definition: kdb.h:21
@ KdbAccessWrite
Definition: kdb.h:20
BOOLEAN KdbpAttachToProcess(PVOID ProcessId)
Switches to another process/thread context.
Definition: kdb.c:1117
VOID KdbSymProcessSymbols(_Inout_ PLDR_DATA_TABLE_ENTRY LdrEntry, _In_ BOOLEAN Load)
Load symbols from image mapping. If this fails,.
Definition: kdb_symbols.c:297
BOOLEAN NTAPI KdpSafeReadMemory(IN ULONG_PTR Addr, IN LONG Len, OUT PVOID Value)
BOOLEAN KdbpSymFindModule(IN PVOID Address OPTIONAL, IN INT Index OPTIONAL, OUT PLDR_DATA_TABLE_ENTRY *pLdrEntry)
Find a module...
Definition: kdb_symbols.c:76
BOOLEAN KdbpAttachToThread(PVOID ThreadId)
Switches to another thread context.
Definition: kdb.c:1036
KD_CONTINUE_TYPE KdbEnterDebuggerException(IN PEXCEPTION_RECORD64 ExceptionRecord, IN KPROCESSOR_MODE PreviousMode, IN OUT PCONTEXT Context, IN BOOLEAN FirstChance)
BOOLEAN KdbpEnableBreakPoint(IN LONG BreakPointNr OPTIONAL, IN OUT PKDB_BREAKPOINT BreakPoint OPTIONAL)
Enables a breakpoint.
Definition: kdb.c:702
VOID KdbpPrint(_In_ PSTR Format, _In_ ...)
Prints the given string with printf-like formatting.
Definition: kdb_cli.c:3081
BOOLEAN KdbSymInit(_In_ ULONG BootPhase)
Initializes the KDB symbols implementation.
Definition: kdb_symbols.c:343
VOID KbdDisableMouse(VOID)
Definition: kdps2kbd.c:98
_KDB_ENTER_CONDITION
Definition: kdb.h:47
@ KdbDoNotEnter
Definition: kdb.h:48
@ KdbEnterFromUmode
Definition: kdb.h:51
@ KdbEnterAlways
Definition: kdb.h:49
@ KdbEnterFromKmode
Definition: kdb.h:50
LONG KdbLastBreakPointNr
Definition: kdb.c:48
VOID KdbPutsN(_In_ PCCH String, _In_ USHORT Length)
Definition: kdb_print.c:140
struct _KDB_BREAKPOINT KDB_BREAKPOINT
VOID __cdecl KdbPrintf(_In_ PCSTR Format,...)
Definition: kdb_print.c:160
NTSTATUS KdbpSafeWriteMemory(OUT PVOID Dest, IN PVOID Src, IN ULONG Bytes)
Definition: kdb.c:1671
VOID KbdEnableMouse(VOID)
Definition: kdps2kbd.c:93
LONG KdbpGetInstLength(IN ULONG_PTR Address)
Definition: i386-dis.c:94
BOOLEAN KdbSingleStepOver
Definition: kdb.c:50
BOOLEAN KdbpDeleteBreakPoint(IN LONG BreakPointNr OPTIONAL, IN OUT PKDB_BREAKPOINT BreakPoint OPTIONAL)
Deletes a breakpoint.
Definition: kdb.c:599
ULONG KdbNumSingleSteps
Definition: kdb.c:49
NTSTATUS KdbpInsertBreakPoint(IN ULONG_PTR Address, IN KDB_BREAKPOINT_TYPE Type, IN UCHAR Size OPTIONAL, IN KDB_ACCESS_TYPE AccessType OPTIONAL, IN PCHAR ConditionExpression OPTIONAL, IN BOOLEAN Global, OUT PLONG BreakPointNr OPTIONAL)
Inserts a breakpoint into the breakpoint array.
Definition: kdb.c:478
SIZE_T KdbPrompt(_In_ PCSTR Prompt, _Out_ PCHAR Buffer, _In_ SIZE_T Size)
Definition: kdb_print.c:182
LONG KdbpDisassemble(IN ULONG_PTR Address, IN ULONG IntelSyntax)
Definition: i386-dis.c:124
NTSTATUS KdbpSafeReadMemory(OUT PVOID Dest, IN PVOID Src, IN ULONG Bytes)
Definition: kdb.c:1657
enum _KDB_ACCESS_TYPE KDB_ACCESS_TYPE
VOID KdbpGetCommandLineSettings(_In_ PCSTR p1)
Definition: kdb.c:1635
CONTEXT KDB_KTRAP_FRAME
Definition: kdb.h:7
VOID KdbpCliMainLoop(IN BOOLEAN EnteredOnSingleStep)
KDB Main Loop.
Definition: kdb_cli.c:3274
enum _KDB_BREAKPOINT_TYPE KDB_BREAKPOINT_TYPE
BOOLEAN NTAPI KdbpGetHexNumber(IN PCHAR pszNum, OUT ULONG_PTR *pulValue)
Definition: kdb_cli.c:450
NTSTATUS KdbpCliInit(VOID)
Called when KDB is initialized.
Definition: kdb_cli.c:3403
BOOLEAN KdbpGetBreakPointInfo(IN ULONG BreakPointNr, OUT ULONG_PTR *Address OPTIONAL, OUT KDB_BREAKPOINT_TYPE *Type OPTIONAL, OUT UCHAR *Size OPTIONAL, OUT KDB_ACCESS_TYPE *AccessType OPTIONAL, OUT UCHAR *DebugReg OPTIONAL, OUT BOOLEAN *Enabled OPTIONAL, OUT BOOLEAN *Global OPTIONAL, OUT PEPROCESS *Process OPTIONAL, OUT PCHAR *ConditionExpression OPTIONAL)
Returns information of the specified breakpoint.
Definition: kdb.c:409
_In_ UINT Bytes
Definition: mmcopy.h:9
UNICODE_STRING Global
Definition: symlink.c:46
@ Enabled
Definition: mountmgr.h:179
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:391
CONST CHAR * PCCH
Definition: ntbasedef.h:400
IN ULONG IN UCHAR Condition
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
static WCHAR Address[46]
Definition: ping.c:68
@ Output
Definition: arc.h:85
static int ErrMsg(int Error)
Definition: shlextdbg.cpp:71
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
Definition: shell.h:41
PVOID Condition
Definition: kdb.h:33
UCHAR SavedInstruction
Definition: kdb.h:36
BOOLEAN Enabled
Definition: kdb.h:28
UCHAR DebugReg
Definition: kdb.h:39
PCHAR ConditionExpression
Definition: kdb.h:32
ULONG_PTR Address
Definition: kdb.h:29
PEPROCESS Process
Definition: kdb.h:31
UCHAR Size
Definition: kdb.h:40
KDB_ACCESS_TYPE AccessType
Definition: kdb.h:41
KDB_BREAKPOINT_TYPE Type
Definition: kdb.h:27
union _KDB_BREAKPOINT::@1822 Data
BOOLEAN Global
Definition: kdb.h:30
struct _KDB_BREAKPOINT::@1822::@1823 Hw
Definition: btrfs_drv.h:1876
char * PSTR
Definition: typedefs.h:51
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
int32_t * PLONG
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
_In_ PWDFDEVICE_INIT _In_ PWDF_PDO_EVENT_CALLBACKS DispatchTable
Definition: wdfpdo.h:248
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
unsigned char UCHAR
Definition: xmlstorage.h:181