28#define KDDBGPRINT(...)
31#define KDDBGPRINT KdpDbgPrint
39#define gdb_pid_to_handle gdb_tid_to_handle
45#define handle_to_gdb_pid handle_to_gdb_tid
54 Manipulate->ApiNumber = ApiNumber;
55 Manipulate->Processor = StateChange->Processor;
56 Manipulate->ProcessorLevel = StateChange->ProcessorLevel;
127# define KdpGetContextPc(Context) \
129# define KdpSetContextPc(Context, ProgramCounter) \
130 ((Context)->Eip = (ProgramCounter))
131# define KD_BREAKPOINT_TYPE UCHAR
132# define KD_BREAKPOINT_SIZE sizeof(UCHAR)
133# define KD_BREAKPOINT_VALUE 0xCC
135# define KdpSetSingleStep(Context) \
136 ((Context)->EFlags |= EFLAGS_TF)
137#elif defined(_M_AMD64)
138# define KdpGetContextPc(Context) \
140# define KdpSetContextPc(Context, ProgramCounter) \
141 ((Context)->Rip = (ProgramCounter))
142# define KD_BREAKPOINT_TYPE UCHAR
143# define KD_BREAKPOINT_SIZE sizeof(UCHAR)
144# define KD_BREAKPOINT_VALUE 0xCC
146# define KdpSetSingleStep(Context) \
147 ((Context)->EFlags |= EFLAGS_TF)
149# error "Please define relevant macros for your architecture"
KDSTATUS gdb_send_debug_io(_In_ PSTRING String, _In_ BOOLEAN WithPrefix)
void send_gdb_ntstatus(_In_ NTSTATUS Status)
KDSTATUS NTAPI KdpPollBreakIn(VOID)
void send_gdb_partial_packet(_In_ const CHAR *Buffer)
KDSTATUS NTAPI gdb_receive_packet(_Inout_ PKD_CONTEXT KdContext)
KDSTATUS gdb_send_registers(void)
KDP_SEND_HANDLER KdpSendPacketHandler
void send_gdb_partial_memory(_In_ const VOID *Buffer, _In_ size_t Length)
KDP_MANIPULATESTATE_HANDLER KdpManipulateStateHandler
KDSTATUS gdb_send_exception(void)
KDSTATUS SetContextManipulateHandler(_Out_ DBGKD_MANIPULATE_STATE64 *State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext)
FORCEINLINE VOID InitManipulateFromStateChange(_In_ ULONG ApiNumber, _In_ const DBGKD_ANY_WAIT_STATE_CHANGE *StateChange, _Out_ DBGKD_MANIPULATE_STATE64 *Manipulate)
void start_gdb_packet(void)
DBGKD_GET_VERSION64 KdVersion
KDSTATUS send_gdb_memory(_In_ const VOID *Buffer, size_t Length)
BOOLEAN(* KDP_SEND_HANDLER)(_In_ ULONG PacketType, _In_ PSTRING MessageHeader, _In_ PSTRING MessageData)
KDSTATUS finish_gdb_packet(void)
PEPROCESS find_process(_In_ UINT_PTR Pid)
KDSTATUS NTAPI KdpPollByte(OUT PUCHAR OutByte)
VOID NTAPI KdpSendByte(_In_ UCHAR Byte)
KDSTATUS NTAPI KdpReceiveByte(_Out_ PUCHAR OutByte)
DBGKD_ANY_WAIT_STATE_CHANGE CurrentStateChange
ULONG send_gdb_partial_binary(_In_ const VOID *Buffer, _In_ size_t Length)
KDDEBUGGER_DATA64 * KdDebuggerDataBlock
KDSTATUS gdb_send_register(void)
FORCEINLINE HANDLE gdb_tid_to_handle(UINT_PTR Tid)
KDSTATUS gdb_receive_and_interpret_packet(_Out_ DBGKD_MANIPULATE_STATE64 *State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext)
FORCEINLINE UINT_PTR handle_to_gdb_tid(HANDLE Handle)
KDSTATUS ContinueManipulateStateHandler(_Out_ DBGKD_MANIPULATE_STATE64 *State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext)
LIST_ENTRY * ModuleListHead
KDSTATUS send_gdb_packet(_In_ const CHAR *Buffer)
LIST_ENTRY * ProcessListHead
PETHREAD find_thread(_In_ UINT_PTR Pid, _In_ UINT_PTR Tid)
KDSTATUS(* KDP_MANIPULATESTATE_HANDLER)(_Out_ DBGKD_MANIPULATE_STATE64 *State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext)
unsigned __int3264 UINT_PTR
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String