ReactOS
0.4.15-dev-1618-g9c8ed68
|
#include <ntoskrnl.h>
#include <debug.h>
Go to the source code of this file.
Macros | |
#define | NDEBUG |
#define | KEY_BS 8 |
#define | KEY_ESC 27 |
#define | KEY_DEL 127 |
#define | KEY_SCAN_UP 72 |
#define | KEY_SCAN_DOWN 80 |
#define | KEYSC_END 0x004f |
#define | KEYSC_PAGEUP 0x0049 |
#define | KEYSC_PAGEDOWN 0x0051 |
#define | KEYSC_HOME 0x0047 |
#define | KEYSC_ARROWUP 0x0048 |
#define | KDB_ENTER_CONDITION_TO_STRING(cond) |
#define | KDB_ACCESS_TYPE_TO_STRING(type) |
#define | NPX_STATE_TO_STRING(state) |
#define | KD_DEBUG_PRINT_FILTER(Name) { #Name, DPFLTR_##Name##_ID } |
Typedefs | |
typedef BOOLEAN(NTAPI * | PKDBG_CLI_ROUTINE) (IN PCHAR Command, IN ULONG Argc, IN PCH Argv[]) |
Functions | |
static BOOLEAN | KdbpCmdEvalExpression (ULONG Argc, PCHAR Argv[]) |
Evaluates an expression and displays the result. More... | |
static BOOLEAN | KdbpCmdDisassembleX (ULONG Argc, PCHAR Argv[]) |
Disassembles 10 instructions at eip or given address or displays 16 dwords from memory at given address. More... | |
static BOOLEAN | KdbpCmdRegs (ULONG Argc, PCHAR Argv[]) |
Displays CPU registers. More... | |
static BOOLEAN | KdbpCmdBackTrace (ULONG Argc, PCHAR Argv[]) |
Displays a backtrace. More... | |
static BOOLEAN | KdbpCmdContinue (ULONG Argc, PCHAR Argv[]) |
Continues execution of the system/leaves KDB. More... | |
static BOOLEAN | KdbpCmdStep (ULONG Argc, PCHAR Argv[]) |
Continues execution of the system/leaves KDB. More... | |
static BOOLEAN | KdbpCmdBreakPointList (ULONG Argc, PCHAR Argv[]) |
Lists breakpoints. More... | |
static BOOLEAN | KdbpCmdEnableDisableClearBreakPoint (ULONG Argc, PCHAR Argv[]) |
Enables, disables or clears a breakpoint. More... | |
static BOOLEAN | KdbpCmdBreakPoint (ULONG Argc, PCHAR Argv[]) |
Sets a software or hardware (memory) breakpoint at the given address. More... | |
static BOOLEAN | KdbpCmdThread (ULONG Argc, PCHAR Argv[]) |
Lists threads or switches to another thread context. More... | |
static BOOLEAN | KdbpCmdProc (ULONG Argc, PCHAR Argv[]) |
Lists processes or switches to another process context. More... | |
static BOOLEAN | KdbpCmdMod (ULONG Argc, PCHAR Argv[]) |
Lists loaded modules or the one containing the specified address. More... | |
static BOOLEAN | KdbpCmdGdtLdtIdt (ULONG Argc, PCHAR Argv[]) |
Displays GDT, LDT or IDT. More... | |
static BOOLEAN | KdbpCmdPcr (ULONG Argc, PCHAR Argv[]) |
Displays the KPCR. More... | |
static BOOLEAN | KdbpCmdTss (ULONG Argc, PCHAR Argv[]) |
Displays the TSS. More... | |
static BOOLEAN | KdbpCmdBugCheck (ULONG Argc, PCHAR Argv[]) |
Bugchecks the system. More... | |
static BOOLEAN | KdbpCmdReboot (ULONG Argc, PCHAR Argv[]) |
static BOOLEAN | KdbpCmdFilter (ULONG Argc, PCHAR Argv[]) |
Displays the list of active debug channels, or enable/disable debug channels. More... | |
static BOOLEAN | KdbpCmdSet (ULONG Argc, PCHAR Argv[]) |
Sets or displays a config variables value. More... | |
static BOOLEAN | KdbpCmdHelp (ULONG Argc, PCHAR Argv[]) |
Displays help screen. More... | |
static BOOLEAN | KdbpCmdDmesg (ULONG Argc, PCHAR Argv[]) |
Display debug messages on screen, with paging. More... | |
BOOLEAN | ExpKdbgExtPool (ULONG Argc, PCHAR Argv[]) |
BOOLEAN | ExpKdbgExtPoolUsed (ULONG Argc, PCHAR Argv[]) |
BOOLEAN | ExpKdbgExtPoolFind (ULONG Argc, PCHAR Argv[]) |
BOOLEAN | ExpKdbgExtFileCache (ULONG Argc, PCHAR Argv[]) |
BOOLEAN | ExpKdbgExtDefWrites (ULONG Argc, PCHAR Argv[]) |
BOOLEAN | ExpKdbgExtIrpFind (ULONG Argc, PCHAR Argv[]) |
BOOLEAN | ExpKdbgExtHandle (ULONG Argc, PCHAR Argv[]) |
static BOOLEAN | KdbpEvaluateExpression (IN PCHAR Expression, IN LONG ErrOffset, OUT PULONGLONG Result) |
Evaluates an expression... More... | |
BOOLEAN NTAPI | KdbpGetHexNumber (IN PCHAR pszNum, OUT ULONG_PTR *pulValue) |
static BOOLEAN | KdbpGetComponentId (IN PCSTR ComponentName, OUT PULONG ComponentId) |
Retrieves the component ID corresponding to a given component name. More... | |
static PKTSS | KdbpRetrieveTss (IN USHORT TssSelector, OUT PULONG pType OPTIONAL, IN PKDESCRIPTOR pGdtr OPTIONAL) |
FORCEINLINE BOOLEAN | KdbpIsNestedTss (IN USHORT TssSelector, IN PKTSS Tss) |
static BOOLEAN | KdbpContextFromPrevTss (IN OUT PCONTEXT Context, OUT PUSHORT TssSelector, IN OUT PKTSS *pTss, IN PKDESCRIPTOR pGdtr) |
VOID | KdbpPager (IN PCHAR Buffer, IN ULONG BufLength) |
Prints the given string with, page by page. More... | |
VOID | KdbpPrint (IN PCHAR Format, IN ... OPTIONAL) |
Prints the given string with printf-like formatting. More... | |
void * | memrchr (const void *s, int c, size_t n) |
PCHAR | CountOnePageUp (PCHAR Buffer, ULONG BufLength, PCHAR pCurPos) |
Calculate pointer position for N lines upper of current position. More... | |
static VOID | KdbpCommandHistoryAppend (IN PCHAR Command) |
Appends a command to the command history. More... | |
static VOID | KdbpReadCommand (OUT PCHAR Buffer, IN ULONG Size) |
Reads a line of user-input. More... | |
BOOLEAN NTAPI | KdbRegisterCliCallback (PVOID Callback, BOOLEAN Deregister) |
static BOOLEAN | KdbpInvokeCliCallbacks (IN PCHAR Command, IN ULONG Argc, IN PCHAR Argv[]) |
Invokes registered CLI callbacks until one of them handled the Command. More... | |
static BOOLEAN | KdbpDoCommand (IN PCHAR Command) |
Parses command line and executes command if found. More... | |
VOID | KdbpCliMainLoop (IN BOOLEAN EnteredOnSingleStep) |
KDB Main Loop. More... | |
VOID | KdbpCliModuleLoaded (IN PUNICODE_STRING Name) |
Called when a module is loaded. More... | |
VOID | KdbpCliInterpretInitFile (VOID) |
This function is called by KdbEnterDebuggerException... More... | |
VOID | KdbpCliInit (VOID) |
Called when KDB is initialized. More... | |
#define KDB_ENTER_CONDITION_TO_STRING | ( | cond | ) |
Calculate pointer position for N lines upper of current position.
Used by KdbpPager(). Now N lines count is hardcoded to KdbNumberOfRowsTerminal.
Definition at line 2881 of file kdb_cli.c.
Referenced by KdbpPager().
Called when KDB is initialized.
Reads the KDBinit file from the SystemRoot\System32\drivers\etc directory and executes it.
Definition at line 3735 of file kdb_cli.c.
This function is called by KdbEnterDebuggerException...
Used to interpret the init file in a context with a trapframe setup (KdbpCliInit call KdbEnter which will call KdbEnterDebuggerException which will call this function if KdbInitFileBuffer is not NULL.
Definition at line 3686 of file kdb_cli.c.
Referenced by KdbEnterDebuggerException().
KDB Main Loop.
EnteredOnSingleStep | TRUE if KDB was entered on single step. |
Definition at line 3608 of file kdb_cli.c.
Referenced by KdbpCallMainLoop(), and KdbpCliInterpretInitFile().
VOID KdbpCliModuleLoaded | ( | IN PUNICODE_STRING | Name | ) |
Called when a module is loaded.
Name | Filename of the module which was loaded. |
Definition at line 3669 of file kdb_cli.c.
Displays a backtrace.
Definition at line 1109 of file kdb_cli.c.
Sets a software or hardware (memory) breakpoint at the given address.
Definition at line 1450 of file kdb_cli.c.
Lists breakpoints.
Definition at line 1312 of file kdb_cli.c.
Disassembles 10 instructions at eip or given address or displays 16 dwords from memory at given address.
Definition at line 788 of file kdb_cli.c.
Display debug messages on screen, with paging.
Keys for per-page view: Home, End, PageUp, Arrow Up, PageDown, all others are as PageDown.
Definition at line 2359 of file kdb_cli.c.
Enables, disables or clears a breakpoint.
Definition at line 1409 of file kdb_cli.c.
Evaluates an expression and displays the result.
Definition at line 460 of file kdb_cli.c.
Displays the list of active debug channels, or enable/disable debug channels.
Definition at line 684 of file kdb_cli.c.
Displays GDT, LDT or IDT.
Definition at line 1964 of file kdb_cli.c.
Displays help screen.
Definition at line 2582 of file kdb_cli.c.
Lists loaded modules or the one containing the specified address.
Definition at line 1900 of file kdb_cli.c.
Displays the KPCR.
Definition at line 2183 of file kdb_cli.c.
Lists processes or switches to another process context.
Definition at line 1782 of file kdb_cli.c.
Definition at line 2338 of file kdb_cli.c.
Displays CPU registers.
Definition at line 909 of file kdb_cli.c.
Sets or displays a config variables value.
Definition at line 2403 of file kdb_cli.c.
Continues execution of the system/leaves KDB.
Definition at line 1282 of file kdb_cli.c.
Lists threads or switches to another thread context.
Definition at line 1574 of file kdb_cli.c.
Displays the TSS.
Definition at line 2230 of file kdb_cli.c.
Appends a command to the command history.
Command | Pointer to the command to append to the history. |
Definition at line 3200 of file kdb_cli.c.
Referenced by KdbpCliMainLoop().
|
static |
Definition at line 1061 of file kdb_cli.c.
Referenced by KdbpCmdBackTrace().
Parses command line and executes command if found.
TRUE | Don't continue execution. |
FALSE | Continue execution (leave KDB) |
Definition at line 3546 of file kdb_cli.c.
Referenced by KdbpCliInterpretInitFile(), and KdbpCliMainLoop().
|
static |
Evaluates an expression...
Much like KdbpRpnEvaluateExpression, but prints the error message (if any) at the given offset.
Expression | Expression to evaluate. |
ErrOffset | Offset (in characters) to print the error message at. |
Result | Receives the result on success. |
TRUE | Success. |
FALSE | Failure. |
Definition at line 414 of file kdb_cli.c.
Referenced by KdbpCmdBackTrace(), KdbpCmdBreakPoint(), KdbpCmdDisassembleX(), KdbpCmdEvalExpression(), and KdbpCmdMod().
Retrieves the component ID corresponding to a given component name.
ComponentName | The name of the component. |
ComponentId | Receives the component id on success. |
TRUE | Success. |
FALSE | Failure. |
Definition at line 663 of file kdb_cli.c.
Referenced by KdbpCmdFilter().
Invokes registered CLI callbacks until one of them handled the Command.
Command | - Command line to parse and execute if possible. |
Argc | - Number of arguments in Argv |
Argv | - Array of strings, each of them containing one argument. |
Definition at line 3512 of file kdb_cli.c.
Referenced by KdbpDoCommand().
Definition at line 1040 of file kdb_cli.c.
Referenced by KdbpCmdBackTrace().
Prints the given string with, page by page.
Note: BufLength should be greater then (KdbNumberOfRowsTerminal * KdbNumberOfColsTerminal).
Definition at line 2933 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 2618 of file kdb_cli.c.
Referenced by KdbEnterDebuggerException(), KdbpAttachToProcess(), KdbpAttachToThread(), KdbpCliMainLoop(), KdbpCliModuleLoaded(), KdbpCmdBackTrace(), KdbpCmdBreakPoint(), KdbpCmdBreakPointList(), KdbpCmdDisassembleX(), KdbpCmdDmesg(), KdbpCmdEnableDisableClearBreakPoint(), KdbpCmdEvalExpression(), KdbpCmdFilter(), KdbpCmdGdtLdtIdt(), KdbpCmdHelp(), KdbpCmdMod(), KdbpCmdPcr(), KdbpCmdProc(), KdbpCmdRegs(), KdbpCmdSet(), KdbpCmdStep(), KdbpCmdThread(), KdbpCmdTss(), KdbpDeleteBreakPoint(), KdbpDisableBreakPoint(), KdbpDoCommand(), KdbpEnableBreakPoint(), KdbpEvaluateExpression(), KdbpInsertBreakPoint(), KdbpReadCommand(), and KdbpShouldStepOverInstruction().