ReactOS 0.4.16-dev-250-g3ecd236
|
Go to the source code of this file.
Macros | |
#define | KDB_STACK_SIZE (4096*3) |
#define | KDB_STACK_ALIGN 4 |
#define | KDB_STACK_RESERVE sizeof(ULONG) /* Return address */ |
#define | KDB_MAXIMUM_BREAKPOINT_COUNT 256 |
#define | KDB_MAXIMUM_HW_BREAKPOINT_COUNT 4 |
#define | KDB_MAXIMUM_SW_BREAKPOINT_COUNT 256 |
#define | __STRING(x) #x |
#define | _STRING(x) __STRING(x) |
#define | CONST_STR_LEN(x) (sizeof(x)/sizeof(x[0]) - 1) |
Variables | |
static LONG | KdbEntryCount = 0 |
static ULONG | KdbSwBreakPointCount = 0 |
static ULONG | KdbHwBreakPointCount = 0 |
static PKDB_BREAKPOINT | KdbSwBreakPoints [KDB_MAXIMUM_SW_BREAKPOINT_COUNT] |
static PKDB_BREAKPOINT | KdbHwBreakPoints [KDB_MAXIMUM_HW_BREAKPOINT_COUNT] |
static PKDB_BREAKPOINT | KdbBreakPointToReenable = NULL |
static BOOLEAN | KdbpEvenThoughWeHaveABreakPointToReenableWeAlsoHaveARealSingleStep |
LONG | KdbLastBreakPointNr = -1 |
ULONG | KdbNumSingleSteps = 0 |
BOOLEAN | KdbSingleStepOver = FALSE |
static BOOLEAN | KdbEnteredOnSingleStep = FALSE |
PEPROCESS | KdbCurrentProcess = NULL |
PEPROCESS | KdbOriginalProcess = NULL |
PETHREAD | KdbCurrentThread = NULL |
PETHREAD | KdbOriginalThread = NULL |
PKDB_KTRAP_FRAME | KdbCurrentTrapFrame = NULL |
static KDB_KTRAP_FRAME | KdbTrapFrame = { 0 } |
static KDB_KTRAP_FRAME | KdbThreadTrapFrame = { 0 } |
static KAPC_STATE | KdbApcState |
BOOLEAN | KdbpBugCheckRequested |
static KDB_ENTER_CONDITION | KdbEnterConditions [][2] |
static const CHAR * | ExceptionNrToString [] |
|
static |
KD_CONTINUE_TYPE KdbEnterDebuggerException | ( | IN PEXCEPTION_RECORD64 | ExceptionRecord, |
IN KPROCESSOR_MODE | PreviousMode, | ||
IN PCONTEXT | Context, | ||
IN BOOLEAN | FirstChance | ||
) |
KDB Exception filter.
Called by the exception dispatcher.
ExceptionRecord | Unused. |
PreviousMode | UserMode if the exception was raised from umode, otherwise KernelMode. |
Context | Context, IN/OUT parameter. |
TrapFrame | Exception TrapFrame. |
FirstChance | TRUE when called before exception frames were serached, FALSE for the second call. |
Definition at line 1272 of file kdb.c.
Referenced by KdSendPacket().
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().
Calls the main interactive debugger loop.
Definition at line 1148 of file kdb.c.
Referenced by KdbEnterDebuggerException().
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().
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 1206 of file kdb.c.
Referenced by KdbEnterDebuggerException().
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().
Internal function to enter KDBG and run the specified procedure.
Disables interrupts, releases display ownership, ...
[in] | Procedure | The procedure to execute under the KDBG environment. Either execute the main interactive debugger loop (KdbpCallMainLoop) or run the KDBinit file (KdbpCliInterpretInitFile). |
Definition at line 1165 of file kdb.c.
Referenced by KdbEnterDebuggerException().
Checks if the breakpoint was set by the debugger.
Tries to find a breakpoint in the breakpoint array which caused the debug exception to happen.
ExpNr | Exception Number (1 or 3) |
TrapFrame | Exception trapframe |
Definition at line 649 of file kdb.c.
Referenced by KdbEnterDebuggerException().
|
static |
Definition at line 119 of file kdb.c.
Referenced by KdbpAttachToThread().
|
static |
Overwrites the instruction at Address with NewInst and stores the old instruction in *OldInst.
Process | Process in which's context to overwrite the instruction. |
Address | Address at which to overwrite the instruction. |
NewInst | New instruction (written to Address) |
OldInst | Old instruction (read from Address) |
Definition at line 155 of file kdb.c.
Referenced by KdbEnterDebuggerException(), KdbpDisableBreakPoint(), and KdbpEnableBreakPoint().
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().
Checks whether the given instruction can be single stepped or has to be stepped over using a temporary breakpoint.
TRUE | Instruction is a call. |
FALSE | Instruction is not a call. |
Definition at line 234 of file kdb.c.
Referenced by KdbpStepOverInstruction().
Steps into an instruction (interrupts)
If the given instruction should be stepped into, this function inserts a temporary breakpoint at the target instruction and returns TRUE, otherwise it returns FALSE.
TRUE | Temporary breakpoint set at target instruction. |
FALSE | No breakpoint was set. |
Definition at line 300 of file kdb.c.
Referenced by KdbEnterDebuggerException().
Steps over an instruction.
If the given instruction should be stepped over, this function inserts a temporary breakpoint after the instruction and returns TRUE, otherwise it returns FALSE.
TRUE | Temporary breakpoint set after instruction. |
FALSE | No breakpoint was set. |
Definition at line 272 of file kdb.c.
Referenced by KdbEnterDebuggerException().
Definition at line 91 of file kdb.c.
Referenced by KdbEnterDebuggerException().
|
static |
Definition at line 59 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpAttachToThread().
|
static |
Definition at line 45 of file kdb.c.
Referenced by KdbEnterDebuggerException().
Definition at line 52 of file kdb.c.
Referenced by KdbEnterDebuggerException(), KdbpAttachToProcess(), KdbpAttachToThread(), KdbpCmdProc(), KdbpCmdThread(), and KdbpInsertBreakPoint().
Definition at line 54 of file kdb.c.
Referenced by KdbEnterDebuggerException(), KdbpAttachToThread(), KdbpCmdProc(), and KdbpCmdThread().
PKDB_KTRAP_FRAME KdbCurrentTrapFrame = NULL |
Definition at line 56 of file kdb.c.
Referenced by KdbEnterDebuggerException(), KdbpAttachToThread(), KdbpCliMainLoop(), KdbpCmdBackTrace(), KdbpCmdDisassembleX(), KdbpCmdRegs(), KdbpEnableBreakPoint(), KdbpEvaluateExpression(), and KdbpStepIntoInstruction().
|
static |
Definition at line 63 of file kdb.c.
Referenced by KdbEnterDebuggerException(), KdbpGetEnterCondition(), KdbpGetExceptionNumberFromStatus(), and KdbpSetEnterCondition().
Definition at line 51 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpCallMainLoop().
|
static |
Definition at line 36 of file kdb.c.
Referenced by KdbEnterDebuggerException().
|
static |
Definition at line 42 of file kdb.c.
Referenced by KdbpDisableBreakPoint(), KdbpEnableBreakPoint(), and KdbpIsBreakPointOurs().
|
static |
Definition at line 44 of file kdb.c.
Referenced by KdbpDisableBreakPoint(), KdbpEnableBreakPoint(), and KdbpIsBreakPointOurs().
LONG KdbLastBreakPointNr = -1 |
Definition at line 48 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpCmdBreakPointList().
ULONG KdbNumSingleSteps = 0 |
Definition at line 49 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpCmdStep().
Definition at line 53 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpAttachToThread().
Definition at line 55 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpAttachToThread().
|
extern |
Definition at line 138 of file kdb_cli.c.
Referenced by KdbEnterDebuggerException(), and KdbpCmdBugCheck().
|
static |
Definition at line 47 of file kdb.c.
Referenced by KdbEnterDebuggerException().
Definition at line 50 of file kdb.c.
Referenced by KdbEnterDebuggerException(), and KdbpCmdStep().
|
static |
Definition at line 41 of file kdb.c.
Referenced by KdbpDisableBreakPoint(), KdbpEnableBreakPoint(), and KdbpIsBreakPointOurs().
|
static |
Definition at line 43 of file kdb.c.
Referenced by KdbpDisableBreakPoint(), KdbpEnableBreakPoint(), and KdbpIsBreakPointOurs().
|
static |
Definition at line 58 of file kdb.c.
Referenced by KdbpAttachToThread().
|
static |
Definition at line 57 of file kdb.c.
Referenced by KdbEnterDebuggerException(), KdbpAttachToThread(), KdbpDisableBreakPoint(), KdbpEnableBreakPoint(), and KdbpKdbTrapFrameFromKernelStack().