OSDN Git Service

7fe00506c707acfd25fd7845a60966e297386c1e
[qmiga/qemu.git] / include / exec / gdbstub.h
1 #ifndef GDBSTUB_H
2 #define GDBSTUB_H
3
4 #define DEFAULT_GDBSTUB_PORT "1234"
5
6 /* GDB breakpoint/watchpoint types */
7 #define GDB_BREAKPOINT_SW        0
8 #define GDB_BREAKPOINT_HW        1
9 #define GDB_WATCHPOINT_WRITE     2
10 #define GDB_WATCHPOINT_READ      3
11 #define GDB_WATCHPOINT_ACCESS    4
12
13 typedef struct GDBFeature {
14     const char *xmlname;
15     const char *xml;
16     int num_regs;
17 } GDBFeature;
18
19
20 /* Get or set a register.  Returns the size of the register.  */
21 typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg);
22 typedef int (*gdb_set_reg_cb)(CPUArchState *env, uint8_t *buf, int reg);
23
24 /**
25  * gdb_register_coprocessor() - register a supplemental set of registers
26  * @cpu - the CPU associated with registers
27  * @get_reg - get function (gdb reading)
28  * @set_reg - set function (gdb modifying)
29  * @num_regs - number of registers in set
30  * @xml - xml name of set
31  * @gpos - non-zero to append to "general" register set at @gpos
32  */
33 void gdb_register_coprocessor(CPUState *cpu,
34                               gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg,
35                               int num_regs, const char *xml, int g_pos);
36
37 /**
38  * gdbserver_start: start the gdb server
39  * @port_or_device: connection spec for gdb
40  *
41  * For CONFIG_USER this is either a tcp port or a path to a fifo. For
42  * system emulation you can use a full chardev spec for your gdbserver
43  * port.
44  */
45 int gdbserver_start(const char *port_or_device);
46
47 /**
48  * gdb_find_static_feature() - Find a static feature.
49  * @xmlname: The name of the XML.
50  *
51  * Return: The static feature.
52  */
53 const GDBFeature *gdb_find_static_feature(const char *xmlname);
54
55 void gdb_set_stop_cpu(CPUState *cpu);
56
57 /* in gdbstub-xml.c, generated by scripts/feature_to_c.py */
58 extern const GDBFeature gdb_static_features[];
59
60 #endif