ReactOS 0.4.16-dev-306-g647d351
|
#include "../kd/kd.h"
Go to the source code of this file.
Classes | |
struct | _KDB_BREAKPOINT |
Typedefs | |
typedef CONTEXT | KDB_KTRAP_FRAME |
typedef CONTEXT * | PKDB_KTRAP_FRAME |
typedef enum _KDB_BREAKPOINT_TYPE | KDB_BREAKPOINT_TYPE |
typedef enum _KDB_ACCESS_TYPE | KDB_ACCESS_TYPE |
typedef struct _KDB_BREAKPOINT | KDB_BREAKPOINT |
typedef struct _KDB_BREAKPOINT * | PKDB_BREAKPOINT |
typedef enum _KDB_ENTER_CONDITION | KDB_ENTER_CONDITION |
typedef enum _KD_CONTINUE_TYPE | KD_CONTINUE_TYPE |
Enumerations | |
enum | _KDB_BREAKPOINT_TYPE { KdbBreakPointNone = 0 , KdbBreakPointSoftware , KdbBreakPointHardware , KdbBreakPointTemporary } |
enum | _KDB_ACCESS_TYPE { KdbAccessRead , KdbAccessWrite , KdbAccessReadWrite , KdbAccessExec } |
enum | _KDB_ENTER_CONDITION { KdbDoNotEnter , KdbEnterAlways , KdbEnterFromKmode , KdbEnterFromUmode } |
enum | _KD_CONTINUE_TYPE { kdContinue = 0 , kdDoNotHandleException , kdHandleException } |
typedef enum _KD_CONTINUE_TYPE KD_CONTINUE_TYPE |
typedef enum _KDB_ACCESS_TYPE KDB_ACCESS_TYPE |
typedef struct _KDB_BREAKPOINT KDB_BREAKPOINT |
typedef CONTEXT KDB_KTRAP_FRAME |
typedef struct _KDB_BREAKPOINT * PKDB_BREAKPOINT |
typedef CONTEXT * PKDB_KTRAP_FRAME |
Enumerator | |
---|---|
kdContinue | |
kdDoNotHandleException | |
kdHandleException |
Enumerator | |
---|---|
KdbAccessRead | |
KdbAccessWrite | |
KdbAccessReadWrite | |
KdbAccessExec |
Enumerator | |
---|---|
KdbBreakPointNone | |
KdbBreakPointSoftware | |
KdbBreakPointHardware | |
KdbBreakPointTemporary |
Definition at line 9 of file kdb.h.
Enumerator | |
---|---|
KdbDoNotEnter | |
KdbEnterAlways | |
KdbEnterFromKmode | |
KdbEnterFromUmode |
Definition at line 46 of file kdb.h.
Definition at line 98 of file kdps2kbd.c.
Referenced by KdbpInternalEnter(), and KdReceivePacket().
Definition at line 93 of file kdps2kbd.c.
Referenced by KdbpInternalEnter(), and KdReceivePacket().
KD_CONTINUE_TYPE KdbEnterDebuggerException | ( | IN PEXCEPTION_RECORD64 | ExceptionRecord, |
IN KPROCESSOR_MODE | PreviousMode, | ||
IN OUT PCONTEXT | Context, | ||
IN BOOLEAN | FirstChance | ||
) |
Definition at line 24 of file kdprompt.c.
Referenced by KdIoReadLine().
Initializes the KDBG debugger.
[in] | DispatchTable | Pointer to the KD dispatch table. |
[in] | BootPhase | Phase of initialization. |
Definition at line 3554 of file kdb_cli.c.
Referenced by KdbInitialize().
Switches to another process/thread context.
This function switches to the first thread in the specified process.
ProcessId | Id of the process to switch to. |
TRUE | Success. |
FALSE | Failure (i.e. invalid process id) |
Definition at line 1117 of file kdb.c.
Referenced by KdbpCmdProc().
Switches to another thread context.
ThreadId | Id of the thread to switch to. |
TRUE | Success. |
FALSE | Failure (i.e. invalid thread id) |
Definition at line 1036 of file kdb.c.
Referenced by KdbpAttachToProcess(), and KdbpCmdThread().
Called when KDB is initialized.
Loads the KDBinit file from the \SystemRoot\System32\drivers\etc directory and interprets it, by calling back into the debugger.
Definition at line 3403 of file kdb_cli.c.
Referenced by KdbInitialize().
Interprets the KDBinit file from the \SystemRoot\System32\drivers\etc directory, that has been loaded by KdbpCliInit().
This function is used to interpret the init file in the debugger context with a trap frame set up. KdbpCliInit() enters the debugger by calling DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C). In turn, this will call KdbEnterDebuggerException() which will finally call this function if KdbInitFileBuffer is not NULL.
Definition at line 3351 of file kdb_cli.c.
Referenced by KdbEnterDebuggerException().
KDB Main Loop.
EnteredOnSingleStep | TRUE if KDB was entered on single step. |
Definition at line 3274 of file kdb_cli.c.
Referenced by KdbpCallMainLoop(), and KdbpCliInterpretInitFile().
Appends a command to the command history.
[in] | Command | Pointer to the command to append to the history. |
Definition at line 37 of file kdb_cmdhist.c.
Referenced by KdbpCliMainLoop().
BOOLEAN KdbpDeleteBreakPoint | ( | IN LONG BreakPointNr | OPTIONAL, |
IN OUT PKDB_BREAKPOINT BreakPoint | OPTIONAL | ||
) |
Deletes a breakpoint.
BreakPointNr | Number of the breakpoint to delete. Can be -1 |
BreakPoint | Breakpoint to delete. Can be NULL. |
TRUE | Success. |
FALSE | Failure (invalid breakpoint number) |
Definition at line 599 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpCmdEnableDisableClearBreakPoint().
BOOLEAN KdbpDisableBreakPoint | ( | IN LONG BreakPointNr | OPTIONAL, |
IN OUT PKDB_BREAKPOINT BreakPoint | OPTIONAL | ||
) |
Disables a breakpoint.
BreakPointNr | Number of the breakpoint to disable. Can be -1 |
BreakPoint | Breakpoint to disable. Can be NULL. |
TRUE | Success. |
FALSE | Failure. |
Definition at line 868 of file kdb.c.
Referenced by KdbpCmdEnableDisableClearBreakPoint(), and KdbpDeleteBreakPoint().
Definition at line 124 of file i386-dis.c.
Referenced by KdbpCliMainLoop(), and KdbpCmdDisassembleX().
BOOLEAN KdbpEnableBreakPoint | ( | IN LONG BreakPointNr | OPTIONAL, |
IN OUT PKDB_BREAKPOINT BreakPoint | OPTIONAL | ||
) |
Enables a breakpoint.
BreakPointNr | Number of the breakpoint to enable Can be -1. |
BreakPoint | Breakpoint to enable. Can be NULL. |
TRUE | Success. |
FALSE | Failure. |
Definition at line 702 of file kdb.c.
Referenced by KdbpCmdEnableDisableClearBreakPoint(), and KdbpInsertBreakPoint().
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.
BreakPointNr | Number of the breakpoint to return information of. |
Address | Receives the address of the breakpoint. |
Type | Receives the type of the breakpoint (hardware or software) |
Size | Size - for memory breakpoints. |
AccessType | Access type - for hardware breakpoints. |
DebugReg | Debug register - for enabled hardware breakpoints. |
Enabled | Whether the breakpoint is enabled or not. |
Process | The owning process of the breakpoint. |
ConditionExpression | The expression which was given as condition for the bp. |
Definition at line 409 of file kdb.c.
Referenced by KdbpCmdBreakPointList().
Definition at line 1635 of file kdb.c.
Referenced by KdbInitialize().
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.
ExceptionNr | Number of the exception to get condition of. |
FirstChance | Whether to get first or last chance condition. |
Condition | Receives the condition setting. |
TRUE | Success. |
FALSE | Failure (invalid exception nr) |
Definition at line 973 of file kdb.c.
Referenced by KdbpCmdSet().
Definition at line 450 of file kdb_cli.c.
Definition at line 94 of file i386-dis.c.
Referenced by KdbpStepOverInstruction().
Gets the number of the next breakpoint >= Start.
Start | Breakpoint number to start searching at. -1 if no more breakpoints are found. |
Definition at line 382 of file kdb.c.
Referenced by KdbpCmdBreakPointList().
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.
The Process of the breakpoint is set to KdbCurrentProcess
Address | Address at which to set the breakpoint. |
Type | Type of breakpoint (hardware or software) |
Size | Size of breakpoint (for hardware/memory breakpoints) |
AccessType | Access type (for hardware breakpoins) |
ConditionExpression | Expression which must evaluate to true for conditional breakpoints. |
Global | Wether the breakpoint is global or local to a process. |
BreakPointNumber | Receives the breakpoint number on success |
Definition at line 478 of file kdb.c.
Referenced by KdbpCmdBreakPoint(), KdbpStepIntoInstruction(), and KdbpStepOverInstruction().
Prints the given string with, page by page.
Note: BufLength should be greater than (KdTermSize.cx * KdTermSize.cy).
Definition at line 3063 of file kdb_cli.c.
Referenced by KdbpCmdDmesg().
Prints the given string with printf-like formatting.
Format | Format of the string/arguments. |
... | Variable number of arguments matching the format specified in Format. |
Definition at line 3081 of file kdb_cli.c.
Referenced by KdbpAttachToProcess(), KdbpAttachToThread(), KdbpCmdBackTrace(), KdbpCmdBreakPoint(), KdbpCmdBreakPointList(), KdbpCmdDisassembleX(), KdbpCmdDmesg(), KdbpCmdEnableDisableClearBreakPoint(), KdbpCmdEvalExpression(), KdbpCmdFilter(), KdbpCmdGdtLdtIdt(), KdbpCmdHelp(), KdbpCmdMod(), KdbpCmdPcr(), KdbpCmdProc(), KdbpCmdRegs(), KdbpCmdSet(), KdbpCmdStep(), KdbpCmdThread(), KdbpEvaluateExpression(), and KdbpPrintUnicodeString().
VOID KdbpPrintUnicodeString | ( | _In_ PCUNICODE_STRING | String | ) |
Definition at line 3104 of file kdb_cli.c.
Referenced by KdbpCmdMod().
Definition at line 160 of file kdb_print.c.
Referenced by KdbEnterDebuggerException(), KdbpCliMainLoop(), KdbpDeleteBreakPoint(), KdbpDisableBreakPoint(), KdbpDoCommand(), KdbpEnableBreakPoint(), KdbpInsertBreakPoint(), KdbpPagerInternal(), KdbpPrintAddressInCode(), KdbpShouldStepOverInstruction(), KdbSymPrintAddress(), KdReceivePacket(), and KdSendPacket().
Definition at line 64 of file kdb_print.c.
Referenced by KdbPutsN().
Definition at line 182 of file kdb_print.c.
Referenced by KdbpCliMainLoop().
Definition at line 125 of file kdb_print.c.
Referenced by KdbPrompt().
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.
Expression | Expression to evaluate. |
TrapFrame | Register values. |
Result | Variable which receives the result on success. |
ErrOffset | Variable which receives character offset on parse error (-1 on other errors) |
ErrMsg | Buffer which receives an error message on failure (128 bytes) |
TRUE | Success. |
FALSE | Failure. |
Definition at line 1106 of file kdb_expr.c.
Referenced by KdbpEvaluateExpression().
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.
Expression | Expression "handle" returned by KdbpRpnParseExpression. |
TrapFrame | Register values. |
Result | Variable which receives the result on success. |
ErrOffset | Variable which receives character offset on parse error (-1 on other errors) |
ErrMsg | Buffer which receives an error message on failure (128 bytes) |
Definition at line 1200 of file kdb_expr.c.
Referenced by KdbEnterDebuggerException().
PVOID KdbpRpnParseExpression | ( | IN PCHAR | Expression, |
OUT PLONG ErrOffset | OPTIONAL, | ||
OUT PCHAR ErrMsg | OPTIONAL | ||
) |
Parses the given expression and returns a "handle" to it.
Expression | Expression to evaluate. |
ErrOffset | Variable which receives character offset on parse error (-1 on other errors) |
ErrMsg | Buffer which receives an error message on failure (128 bytes) |
Definition at line 1146 of file kdb_expr.c.
Referenced by KdbpInsertBreakPoint().
Definition at line 1657 of file kdb.c.
Referenced by KdbpCmdBackTrace(), KdbpCmdDisassembleX(), KdbpCmdGdtLdtIdt(), KdbpCmdThread(), KdbpOverwriteInstruction(), KdbpReadMemory(), KdbpShouldStepOverInstruction(), KdbpStepIntoInstruction(), and RpnpEvaluateStack().
Definition at line 1671 of file kdb.c.
Referenced by KdbpOverwriteInstruction().
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.
ExceptionNr | Number of the exception to set condition of (-1 for all) |
FirstChance | Whether to set first or last chance condition. |
Condition | The new condition setting. |
TRUE | Success. |
FALSE | Failure (invalid exception nr) |
Definition at line 995 of file kdb.c.
Referenced by KdbpCmdSet(), and KdbpGetCommandLineSettings().
Referenced by KdbpInternalEnter().
BOOLEAN KdbpSymFindModule | ( | IN PVOID Address | OPTIONAL, |
IN INT Index | OPTIONAL, | ||
OUT PLDR_DATA_TABLE_ENTRY * | pLdrEntry | ||
) |
Find a module...
Address | If Address is not NULL the module containing Address is searched. |
Name | If Name is not NULL the module named Name will be searched. |
Index | If Index is >= 0 the Index'th module will be returned. |
pLdrEntry | Pointer to a PLDR_DATA_TABLE_ENTRY which is filled. |
TRUE | Module was found, pLdrEntry was filled. |
FALSE | No module was found. |
Definition at line 76 of file kdb_symbols.c.
Referenced by KdbpCmdMod(), KdbSymPrintAddress(), and KdSendPacket().
Definition at line 152 of file kdb_print.c.
Referenced by KdbEnterDebuggerException(), KdbpCliInterpretInitFile(), KdbpCliMainLoop(), KdbpDisableBreakPoint(), KdbpInsertBreakPoint(), KdbpPagerInternal(), and KdbpPrintDisasm().
Definition at line 3124 of file kdb_cli.c.
Referenced by KdSystemDebugControl().
Initializes the KDB symbols implementation.
[in] | BootPhase | Phase of initialization. |
Definition at line 343 of file kdb_symbols.c.
Referenced by KdbInitialize().
Print address...
Tries to lookup line number, file name and function name for the given address and prints it. If no such information is found the address is printed in the format <module: offset>, otherwise the format will be <module: offset (filename:linenumber (functionname))>
TRUE | Module containing Address was found, Address was printed. |
FALSE | No module containing Address was found, nothing was printed. |
Definition at line 149 of file kdb_symbols.c.
Referenced by KdbpCliMainLoop(), KdbpCmdBackTrace(), KdbpCmdDisassembleX(), KdbpPrintAddressInCode(), and KeRosDumpStackFrameArray().
VOID KdbSymProcessSymbols | ( | _Inout_ PLDR_DATA_TABLE_ENTRY | LdrEntry, |
_In_ BOOLEAN | Load | ||
) |
Load symbols from image mapping. If this fails,.
LdrEntry | The entry to load symbols from |
Definition at line 297 of file kdb_symbols.c.
Referenced by KdbSymInit(), and KdSendPacket().
|
extern |
Definition at line 52 of file kdb.c.
Referenced by KdbEnterDebuggerException(), KdbpAttachToProcess(), KdbpAttachToThread(), KdbpCmdProc(), KdbpCmdThread(), and KdbpInsertBreakPoint().
|
extern |
Definition at line 54 of file kdb.c.
Referenced by KdbEnterDebuggerException(), KdbpAttachToThread(), KdbpCmdProc(), and KdbpCmdThread().
|
extern |
Definition at line 56 of file kdb.c.
Referenced by KdbEnterDebuggerException(), KdbpAttachToThread(), KdbpCliMainLoop(), KdbpCmdBackTrace(), KdbpCmdDisassembleX(), KdbpCmdRegs(), KdbpEnableBreakPoint(), KdbpEvaluateExpression(), and KdbpStepIntoInstruction().
Definition at line 137 of file kdb_cli.c.
Referenced by KdbEnterDebuggerException(), KdbpCliInit(), and KdbpCliInterpretInitFile().
|
extern |
Definition at line 48 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpCmdBreakPointList().
|
extern |
Definition at line 49 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpCmdStep().
|
extern |
Definition at line 50 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpCmdStep().