aboutsummaryrefslogtreecommitdiff
path: root/gdbstub/internals.h
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2023-03-02 18:57:45 -0800
committerAlex Bennée <alex.bennee@linaro.org>2023-03-07 17:06:38 +0000
commit36e067b2f28892afd91d319b89350d4753ef82af (patch)
tree280a17f2797f9eebbdc48ebe13fef0bac0537ad0 /gdbstub/internals.h
parent1678ea040e5d4a4cd613a4af18d776fb2397f0a8 (diff)
gdbstub: make various helpers visible to the rest of the module
We will be needing to use these helpers between the user and softmmu files so declare them in the headers, add a system prefix and remove static from the implementations. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230302190846.2593720-10-alex.bennee@linaro.org> Message-Id: <20230303025805.625589-10-richard.henderson@linaro.org>
Diffstat (limited to 'gdbstub/internals.h')
-rw-r--r--gdbstub/internals.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index b4620f99c4..cf76627cf7 100644
--- a/gdbstub/internals.h
+++ b/gdbstub/internals.h
@@ -85,6 +85,31 @@ static inline int tohex(int v)
}
/*
+ * Connection helpers for both softmmu and user backends
+ */
+
+void gdb_put_strbuf(void);
+int gdb_put_packet(const char *buf);
+int gdb_put_packet_binary(const char *buf, int len, bool dump);
+void gdb_hextomem(GByteArray *mem, const char *buf, int len);
+void gdb_memtohex(GString *buf, const uint8_t *mem, int len);
+void gdb_memtox(GString *buf, const char *mem, int len);
+void gdb_read_byte(uint8_t ch);
+
+/* utility helpers */
+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);
+
+/*
+ * Helpers with separate softmmu and user implementations
+ */
+void gdb_put_buffer(const uint8_t *buf, int len);
+
+/*
* Break/Watch point support - there is an implementation for softmmu
* and user mode.
*/