aboutsummaryrefslogtreecommitdiff
path: root/gdbstub/internals.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdbstub/internals.h')
-rw-r--r--gdbstub/internals.h43
1 files changed, 42 insertions, 1 deletions
diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index cf76627cf7..83989af859 100644
--- a/gdbstub/internals.h
+++ b/gdbstub/internals.h
@@ -17,6 +17,18 @@
* Shared structures and definitions
*/
+enum {
+ GDB_SIGNAL_0 = 0,
+ GDB_SIGNAL_INT = 2,
+ GDB_SIGNAL_QUIT = 3,
+ GDB_SIGNAL_TRAP = 5,
+ GDB_SIGNAL_ABRT = 6,
+ GDB_SIGNAL_ALRM = 14,
+ GDB_SIGNAL_IO = 23,
+ GDB_SIGNAL_XCPU = 24,
+ GDB_SIGNAL_UNKNOWN = 143
+};
+
typedef struct GDBProcess {
uint32_t pid;
bool attached;
@@ -57,6 +69,8 @@ typedef struct GDBState {
int supported_sstep_flags;
} GDBState;
+/* lives in main gdbstub.c */
+extern GDBState gdbserver_state;
/*
* Inline utility function, convert from int to hex and back
@@ -101,7 +115,6 @@ CPUState *gdb_first_attached_cpu(void);
void gdb_append_thread_id(CPUState *cpu, GString *buf);
int gdb_get_cpu_index(CPUState *cpu);
-void gdb_init_gdbserver_state(void);
void gdb_create_default_process(GDBState *s);
/*
@@ -110,6 +123,34 @@ void gdb_create_default_process(GDBState *s);
void gdb_put_buffer(const uint8_t *buf, int len);
/*
+ * Command handlers - either softmmu or user only
+ */
+void gdb_init_gdbserver_state(void);
+
+typedef enum GDBThreadIdKind {
+ GDB_ONE_THREAD = 0,
+ GDB_ALL_THREADS, /* One process, all threads */
+ GDB_ALL_PROCESSES,
+ GDB_READ_THREAD_ERR
+} GDBThreadIdKind;
+
+typedef union GdbCmdVariant {
+ const char *data;
+ uint8_t opcode;
+ unsigned long val_ul;
+ unsigned long long val_ull;
+ struct {
+ GDBThreadIdKind kind;
+ uint32_t pid;
+ uint32_t tid;
+ } thread_id;
+} GdbCmdVariant;
+
+#define get_param(p, i) (&g_array_index(p, GdbCmdVariant, i))
+
+void gdb_handle_query_rcmd(GArray *params, void *user_ctx); /* softmmu */
+
+/*
* Break/Watch point support - there is an implementation for softmmu
* and user mode.
*/