blob: 5740041c76c260a573bd43ae1e0f24fb04e44520 [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
pbrooka2d1eba2007-01-28 03:10:55 +000013typedef void (*gdb_syscall_complete_cb)(CPUState *env,
14 target_ulong ret, target_ulong err);
15
blueswir17ccfb2e2008-09-14 06:45:34 +000016void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
pbrooka2d1eba2007-01-28 03:10:55 +000017int use_gdb_syscalls(void);
aliguori880a7572008-11-18 20:30:24 +000018void gdb_set_stop_cpu(CPUState *env);
bellard1fddef42005-04-17 19:16:13 +000019#ifdef CONFIG_USER_ONLY
aurel32ca587a82008-12-18 22:44:13 +000020int gdb_queuesig (void);
bellard1fddef42005-04-17 19:16:13 +000021int gdb_handlesig (CPUState *, int);
bellarde9009672005-04-26 20:42:36 +000022void gdb_exit(CPUState *, int);
aurel32ca587a82008-12-18 22:44:13 +000023void gdb_signalled(CPUState *, int);
bellard1fddef42005-04-17 19:16:13 +000024int gdbserver_start(int);
aurel322b1319c2008-12-18 22:44:04 +000025void gdbserver_fork(CPUState *);
pbrook4046d912007-01-28 01:53:16 +000026#else
pbrookcfc34752007-02-22 01:48:01 +000027int gdbserver_start(const char *port);
pbrook4046d912007-01-28 01:53:16 +000028#endif
pbrook56aebc82008-10-11 17:55:29 +000029/* Get or set a register. Returns the size of the register. */
30typedef int (*gdb_reg_cb)(CPUState *env, uint8_t *buf, int reg);
31void gdb_register_coprocessor(CPUState *env,
32 gdb_reg_cb get_reg, gdb_reg_cb set_reg,
33 int num_regs, const char *xml, int g_pos);
bellard1fddef42005-04-17 19:16:13 +000034
35#endif