[KDGDB]
[reactos.git] / reactos / drivers / base / kdgdb / kdgdb.h
1 /*
2 * COPYRIGHT: GPL, see COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: drivers/base/kddll/kddll.h
5 * PURPOSE: Base definitions for the kernel debugger.
6 */
7
8 #ifndef _KDGDB_H_
9 #define _KDGDB_H_
10
11 #define NOEXTAPI
12 #include <ntifs.h>
13 #include <halfuncs.h>
14 #include <stdio.h>
15 #include <arc/arc.h>
16 #include <windbgkd.h>
17 #include <kddll.h>
18
19 // #define KDDEBUG /* uncomment to enable debugging this dll */
20
21 #ifndef KDDEBUG
22 #define KDDBGPRINT(...)
23 #else
24 extern ULONG KdpDbgPrint(const char* Format, ...);
25 #define KDDBGPRINT KdpDbgPrint
26 #endif
27
28 /* gdb_input.c */
29 extern HANDLE gdb_dbg_thread;
30 KDSTATUS gdb_interpret_input(_Out_ DBGKD_MANIPULATE_STATE64* State, _Out_ PSTRING MessageData, _Out_ PULONG MessageLength, _Inout_ PKD_CONTEXT KdContext);
31
32 /* gdb_receive.c */
33 extern CHAR gdb_input[];
34 KDSTATUS NTAPI gdb_receive_packet(_Inout_ PKD_CONTEXT KdContext);
35 char hex_value(char ch);
36
37 /* gdb_send.c */
38 void send_gdb_packet(_In_ CHAR* Buffer);
39 void send_gdb_memory(_In_ VOID* Buffer, size_t Length);
40 void gdb_send_debug_io(_In_ PSTRING String);
41 void gdb_send_exception(void);
42
43 /* kdcom.c */
44 KDSTATUS NTAPI KdpPollBreakIn(VOID);
45 VOID NTAPI KdpSendByte(_In_ UCHAR Byte);
46 KDSTATUS NTAPI KdpReceiveByte(_Out_ PUCHAR OutByte);
47
48 /* kdpacket.c */
49 extern DBGKD_ANY_WAIT_STATE_CHANGE CurrentStateChange;
50 extern DBGKD_GET_VERSION64 KdVersion;
51 extern KDDEBUGGER_DATA64* KdDebuggerDataBlock;
52
53 /* arch_sup.c */
54 void gdb_send_registers(void);
55
56 #endif /* _KDGDB_H_ */