Defines |
| #define | NDEBUG |
| #define | KDB_STACK_SIZE (4096*3) |
| #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) |
Functions |
| ULONG NTAPI | KiSsFromTrapFrame (IN PKTRAP_FRAME TrapFrame) |
| ULONG NTAPI | KiEspFromTrapFrame (IN PKTRAP_FRAME TrapFrame) |
| VOID NTAPI | KiSsToTrapFrame (IN PKTRAP_FRAME TrapFrame, IN ULONG Ss) |
| VOID NTAPI | KiEspToTrapFrame (IN PKTRAP_FRAME TrapFrame, IN ULONG Esp) |
| static VOID | KdbpTrapFrameToKdbTrapFrame (PKTRAP_FRAME TrapFrame, PKDB_KTRAP_FRAME KdbTrapFrame) |
| static VOID | KdbpKdbTrapFrameToTrapFrame (PKDB_KTRAP_FRAME KdbTrapFrame, PKTRAP_FRAME TrapFrame) |
| static VOID | KdbpKdbTrapFrameFromKernelStack (PVOID KernelStack, PKDB_KTRAP_FRAME KdbTrapFrame) |
| static NTSTATUS | KdbpOverwriteInstruction (IN PEPROCESS Process, IN ULONG_PTR Address, IN UCHAR NewInst, OUT PUCHAR OldInst OPTIONAL) |
| | Overwrites the instruction at Address with NewInst and stores the old instruction in *OldInst.
|
| BOOLEAN | KdbpShouldStepOverInstruction (ULONG_PTR Eip) |
| | Checks whether the given instruction can be single stepped or has to be stepped over using a temporary breakpoint.
|
| BOOLEAN | KdbpStepOverInstruction (ULONG_PTR Eip) |
| | Steps over an instruction.
|
| BOOLEAN | KdbpStepIntoInstruction (ULONG_PTR Eip) |
| | Steps into an instruction (interrupts)
|
| LONG | KdbpGetNextBreakPointNr (IN ULONG Start OPTIONAL) |
| | Gets the number of the next breakpoint >= Start.
|
| 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.
|
| 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.
|
| BOOLEAN | KdbpDeleteBreakPoint (IN LONG BreakPointNr OPTIONAL, IN OUT PKDB_BREAKPOINT BreakPoint OPTIONAL) |
| | Deletes a breakpoint.
|
| static LONG | KdbpIsBreakPointOurs (IN NTSTATUS ExceptionCode, IN PKTRAP_FRAME TrapFrame) |
| | Checks if the breakpoint was set by the debugger.
|
| BOOLEAN | KdbpEnableBreakPoint (IN LONG BreakPointNr OPTIONAL, IN OUT PKDB_BREAKPOINT BreakPoint OPTIONAL) |
| | Enables a breakpoint.
|
| BOOLEAN | KdbpDisableBreakPoint (IN LONG BreakPointNr OPTIONAL, IN OUT PKDB_BREAKPOINT BreakPoint OPTIONAL) |
| | Disables a breakpoint.
|
| 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.
|
| 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.
|
| BOOLEAN | KdbpAttachToThread (PVOID ThreadId) |
| | Switches to another thread context.
|
| BOOLEAN | KdbpAttachToProcess (PVOID ProcessId) |
| | Switches to another process/thread context.
|
| static VOID | KdbpCallMainLoop (VOID) |
| | Calls the main loop ...
|
| static VOID | KdbpInternalEnter () |
| | Internal function to enter KDB.
|
| static ULONG | KdbpGetExceptionNumberFromStatus (IN NTSTATUS ExceptionCode) |
| KD_CONTINUE_TYPE | KdbEnterDebuggerException (IN PEXCEPTION_RECORD ExceptionRecord OPTIONAL, IN KPROCESSOR_MODE PreviousMode, IN PCONTEXT Context, IN OUT PKTRAP_FRAME TrapFrame, IN BOOLEAN FirstChance) |
| | KDB Exception filter.
|
| VOID NTAPI INIT_FUNCTION | KdbpGetCommandLineSettings (PCHAR p1) |
| NTSTATUS | KdbpSafeReadMemory (OUT PVOID Dest, IN PVOID Src, IN ULONG Bytes) |
| NTSTATUS | KdbpSafeWriteMemory (OUT PVOID Dest, IN PVOID Src, IN ULONG Bytes) |
Variables |
| static LONG | KdbEntryCount = 0 |
| static CHAR | KdbStack [KDB_STACK_SIZE] |
| static ULONG | KdbBreakPointCount = 0 |
| static KDB_BREAKPOINT | KdbBreakPoints [KDB_MAXIMUM_BREAKPOINT_COUNT] = {{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 |
| LONG | KdbLastBreakPointNr = -1 |
| ULONG | KdbNumSingleSteps = 0 |
| BOOLEAN | KdbSingleStepOver = FALSE |
| ULONG | KdbDebugState = 0 |
| 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 [] |