ReactOS
0.4.15-dev-5640-g0dde428
|
#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 | Ke386GetGlobalDescriptorTable __sgdt |
#define | Ke386GetLocalDescriptorTable __sldt |
#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 | 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[]) |
FORCEINLINE ULONG_PTR | strtoulptr (const char *nptr, char **endptr, int base) |
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... | |
void * | memrchr (const void *s, int c, size_t n) |
static PCHAR | CountOnePageUp (_In_ PCCH Buffer, _In_ ULONG BufLength, _In_ PCCH pCurPos) |
Calculate pointer position for N lines upper of current position. More... | |
static VOID | KdpFilterEscapes (_Inout_ PSTR String) |
VOID | KdbpPagerInternal (_In_ PCHAR Buffer, _In_ ULONG BufLength, _In_ BOOLEAN DoPage) |
Prints the given string with, page by page. More... | |
VOID | KdbpPager (_In_ PCHAR Buffer, _In_ ULONG BufLength) |
Prints the given string with, page by page. More... | |
VOID | KdbpPrint (_In_ PSTR Format, _In_ ...) |
Prints the given string with printf-like formatting. More... | |
VOID | KdbpPrintUnicodeString (_In_ PCUNICODE_STRING String) |
static VOID | KdbpCommandHistoryAppend (IN PCHAR Command) |
Appends a command to the command history. More... | |
SIZE_T | KdbpReadCommand (_Out_ PCHAR Buffer, _In_ SIZE_T Size) |
Reads a line of user input from the terminal. 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 | 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 2819 of file kdb_cli.c.
Referenced by KdbpPagerInternal().
Called when KDB is initialized.
Reads the KDBinit file from the SystemRoot\System32\drivers\etc directory and executes it.
Definition at line 3803 of file kdb_cli.c.
Referenced by IoInitSystem().
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 3754 of file kdb_cli.c.
Referenced by KdbEnterDebuggerException().
KDB Main Loop.
EnteredOnSingleStep | TRUE if KDB was entered on single step. |
Definition at line 3691 of file kdb_cli.c.
Referenced by KdbpCallMainLoop(), and KdbpCliInterpretInitFile().
Displays a backtrace.
Definition at line 1245 of file kdb_cli.c.
Sets a software or hardware (memory) breakpoint at the given address.
Definition at line 1599 of file kdb_cli.c.
Lists breakpoints.
Definition at line 1461 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 820 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 2535 of file kdb_cli.c.
Enables, disables or clears a breakpoint.
Definition at line 1558 of file kdb_cli.c.
Evaluates an expression and displays the result.
Definition at line 487 of file kdb_cli.c.
Displays the list of active debug channels, or enable/disable debug channels.
Definition at line 716 of file kdb_cli.c.
Displays GDT, LDT or IDT.
Definition at line 2116 of file kdb_cli.c.
Displays help screen.
Definition at line 2758 of file kdb_cli.c.
Lists loaded modules or the one containing the specified address.
Definition at line 2050 of file kdb_cli.c.
Displays the KPCR.
Definition at line 2335 of file kdb_cli.c.
Lists processes or switches to another process context.
Definition at line 1932 of file kdb_cli.c.
Definition at line 2520 of file kdb_cli.c.
Displays CPU registers.
Definition at line 941 of file kdb_cli.c.
Sets or displays a config variables value.
Definition at line 2579 of file kdb_cli.c.
Continues execution of the system/leaves KDB.
Definition at line 1431 of file kdb_cli.c.
Lists threads or switches to another thread context.
Definition at line 1723 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 3270 of file kdb_cli.c.
Referenced by KdbpCliMainLoop().
Parses command line and executes command if found.
TRUE | Don't continue execution. |
FALSE | Continue execution (leave KDB) |
Definition at line 3629 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 441 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 695 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 3595 of file kdb_cli.c.
Referenced by KdbpDoCommand().
Prints the given string with, page by page.
Note: BufLength should be greater then (KdbNumberOfRowsTerminal * KdbNumberOfColsTerminal).
Definition at line 3206 of file kdb_cli.c.
Referenced by KdbpCmdDmesg().
Prints the given string with, page by page.
Note: BufLength should be greater then (KdbNumberOfRowsTerminal * KdbNumberOfColsTerminal).
Definition at line 2898 of file kdb_cli.c.
Referenced by KdbpPager(), and KdbpPrint().
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 3224 of file kdb_cli.c.
Referenced by KdbEnterDebuggerException(), KdbpAttachToProcess(), KdbpAttachToThread(), KdbpCliMainLoop(), KdbpCmdBackTrace(), KdbpCmdBreakPoint(), KdbpCmdBreakPointList(), KdbpCmdDisassembleX(), KdbpCmdDmesg(), KdbpCmdEnableDisableClearBreakPoint(), KdbpCmdEvalExpression(), KdbpCmdFilter(), KdbpCmdGdtLdtIdt(), KdbpCmdHelp(), KdbpCmdMod(), KdbpCmdPcr(), KdbpCmdProc(), KdbpCmdRegs(), KdbpCmdSet(), KdbpCmdStep(), KdbpCmdThread(), KdbpDeleteBreakPoint(), KdbpDisableBreakPoint(), KdbpDoCommand(), KdbpEnableBreakPoint(), KdbpEvaluateExpression(), KdbpInsertBreakPoint(), KdbpPrintUnicodeString(), and KdbpShouldStepOverInstruction().
VOID KdbpPrintUnicodeString | ( | _In_ PCUNICODE_STRING | String | ) |
Definition at line 3247 of file kdb_cli.c.
Referenced by KdbpCmdMod().
Reads a line of user input from the terminal.
[out] | Buffer | Buffer where to store the input. Trailing newlines are removed. |
[in] | Size | Size of Buffer. |
Definition at line 3351 of file kdb_cli.c.
Referenced by KdbpCliMainLoop(), and KdReceivePacket().
Definition at line 3548 of file kdb_cli.c.
Referenced by KdSystemDebugControl().
Definition at line 2862 of file kdb_cli.c.
Referenced by KdbpPagerInternal().
Definition at line 121 of file kdb_cli.c.
Referenced by KdbpCmdProc(), and KdbpCmdThread().
char __ImageBase |
Definition at line 17 of file mstscax.cpp.
Referenced by KdbpCmdMod().
struct { ... } ComponentTable[] |
Referenced by KdbpCmdFilter(), and KdbpGetComponentId().
Definition at line 364 of file kdb_cli.c.
Referenced by UhciGet32BitFrameNumber().
int Help |
Definition at line 363 of file kdb_cli.c.
Referenced by COMMAND_PROTOTYPE(), create_system_dirid(), FindCommand(), and KdbpCmdHelp().
ULONG Id |
Definition at line 178 of file kdb_cli.c.
Referenced by KdbpCmdFilter().
Definition at line 141 of file kdb_cli.c.
Referenced by KdbpCmdSet().
|
static |
Definition at line 139 of file kdb_cli.c.
Referenced by KdbpInvokeCliCallbacks(), and KdbRegisterCliCallback().
|
static |
Definition at line 144 of file kdb_cli.c.
Referenced by KdbpCommandHistoryAppend(), and KdbpReadCommand().
|
static |
Definition at line 143 of file kdb_cli.c.
Referenced by KdbpCommandHistoryAppend().
|
static |
Definition at line 145 of file kdb_cli.c.
Referenced by KdbpCommandHistoryAppend().