blob: d82334fc7b42fb49e4d166a0c7477ed99d3298ed [file] [log] [blame]
bellard1fddef42005-04-17 19:16:13 +00001#ifndef GDBSTUB_H
2#define GDBSTUB_H
3
pbrookcfc34752007-02-22 01:48:01 +00004#define DEFAULT_GDBSTUB_PORT "1234"
bellard1fddef42005-04-17 19:16:13 +00005
aliguorie22a25c2009-03-12 20:12:48 +00006/* 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
Blue Swirl1c14f162010-03-29 19:23:47 +000013#ifdef NEED_CPU_H
pbrooka2d1eba2007-01-28 03:10:55 +000014typedef void (*gdb_syscall_complete_cb)(CPUState *env,
15 target_ulong ret, target_ulong err);
16
blueswir17ccfb2e2008-09-14 06:45:34 +000017void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
pbrooka2d1eba2007-01-28 03:10:55 +000018int use_gdb_syscalls(void);
aliguori880a7572008-11-18 20:30:24 +000019void gdb_set_stop_cpu(CPUState *env);
Paul Brook0e1c9c52010-06-16 13:03:51 +010020void gdb_exit(CPUState *, int);
bellard1fddef42005-04-17 19:16:13 +000021#ifdef CONFIG_USER_ONLY
aurel32ca587a82008-12-18 22:44:13 +000022int gdb_queuesig (void);
bellard1fddef42005-04-17 19:16:13 +000023int gdb_handlesig (CPUState *, int);
aurel32ca587a82008-12-18 22:44:13 +000024void gdb_signalled(CPUState *, int);
aurel322b1319c2008-12-18 22:44:04 +000025void gdbserver_fork(CPUState *);
pbrook4046d912007-01-28 01:53:16 +000026#endif
pbrook56aebc82008-10-11 17:55:29 +000027/* Get or set a register. Returns the size of the register. */
28typedef int (*gdb_reg_cb)(CPUState *env, uint8_t *buf, int reg);
29void gdb_register_coprocessor(CPUState *env,
30 gdb_reg_cb get_reg, gdb_reg_cb set_reg,
31 int num_regs, const char *xml, int g_pos);
bellard1fddef42005-04-17 19:16:13 +000032
33#endif
Blue Swirl1c14f162010-03-29 19:23:47 +000034
35#ifdef CONFIG_USER_ONLY
36int gdbserver_start(int);
37#else
38int gdbserver_start(const char *port);
39#endif
40
Blue Swirl4c3b5a42011-01-20 20:54:21 +000041/* in gdbstub-xml.c, generated by scripts/feature_to_c.sh */
Blue Swirl0b65b9e2010-09-18 07:02:16 +000042extern const char *const xml_builtin[][2];
43
Blue Swirl1c14f162010-03-29 19:23:47 +000044#endif