gdbstub.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef GDBSTUB_H
  2. #define GDBSTUB_H
  3. #define DEFAULT_GDBSTUB_PORT "1234"
  4. /* GDB breakpoint/watchpoint types */
  5. #define GDB_BREAKPOINT_SW 0
  6. #define GDB_BREAKPOINT_HW 1
  7. #define GDB_WATCHPOINT_WRITE 2
  8. #define GDB_WATCHPOINT_READ 3
  9. #define GDB_WATCHPOINT_ACCESS 4
  10. #ifdef NEED_CPU_H
  11. typedef void (*gdb_syscall_complete_cb)(CPUArchState *env,
  12. target_ulong ret, target_ulong err);
  13. void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
  14. int use_gdb_syscalls(void);
  15. void gdb_set_stop_cpu(CPUArchState *env);
  16. void gdb_exit(CPUArchState *, int);
  17. #ifdef CONFIG_USER_ONLY
  18. int gdb_queuesig (void);
  19. int gdb_handlesig (CPUArchState *, int);
  20. void gdb_signalled(CPUArchState *, int);
  21. void gdbserver_fork(CPUArchState *);
  22. #endif
  23. /* Get or set a register. Returns the size of the register. */
  24. typedef int (*gdb_reg_cb)(CPUArchState *env, uint8_t *buf, int reg);
  25. void gdb_register_coprocessor(CPUArchState *env,
  26. gdb_reg_cb get_reg, gdb_reg_cb set_reg,
  27. int num_regs, const char *xml, int g_pos);
  28. static inline int cpu_index(CPUArchState *env)
  29. {
  30. #if defined(CONFIG_USER_ONLY) && defined(CONFIG_USE_NPTL)
  31. return env->host_tid;
  32. #else
  33. return env->cpu_index + 1;
  34. #endif
  35. }
  36. #endif
  37. #ifdef CONFIG_USER_ONLY
  38. int gdbserver_start(int);
  39. #else
  40. int gdbserver_start(const char *port);
  41. #endif
  42. /* in gdbstub-xml.c, generated by scripts/feature_to_c.sh */
  43. extern const char *const xml_builtin[][2];
  44. #endif