aboutsummaryrefslogtreecommitdiff
path: root/gdbstub/softmmu.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2023-03-02 18:57:57 -0800
committerAlex Bennée <alex.bennee@linaro.org>2023-03-07 20:44:08 +0000
commitc566080cd37fe328077a3c49d7fd248ce2a06bfe (patch)
tree356f3d4dd8d4e3e0303c250c57d1e5cf7f296e87 /gdbstub/softmmu.c
parent4ea5fe997db4c5d893b69072f488880c07857a54 (diff)
gdbstub: move syscall handling to new file
Our GDB syscall support is the last chunk of code that needs target specific support so move it to a new file. We take the opportunity to move the syscall state into its own singleton instance and add in a few helpers for the main gdbstub to interact with the module. I also moved the gdb_exit() declaration into syscalls.h as it feels pretty related and most of the callers of it treat it as such. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230302190846.2593720-22-alex.bennee@linaro.org> Message-Id: <20230303025805.625589-22-richard.henderson@linaro.org>
Diffstat (limited to 'gdbstub/softmmu.c')
-rw-r--r--gdbstub/softmmu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c
index d2863d0663..d3152fb6e7 100644
--- a/gdbstub/softmmu.c
+++ b/gdbstub/softmmu.c
@@ -15,6 +15,7 @@
#include "qemu/error-report.h"
#include "qemu/cutils.h"
#include "exec/gdbstub.h"
+#include "gdbstub/syscalls.h"
#include "exec/hwaddr.h"
#include "exec/tb-flush.h"
#include "sysemu/cpus.h"
@@ -113,9 +114,9 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState state)
if (running || gdbserver_state.state == RS_INACTIVE) {
return;
}
+
/* Is there a GDB syscall waiting to be sent? */
- if (gdbserver_state.current_syscall_cb) {
- gdb_put_packet(gdbserver_state.syscall_buf);
+ if (gdb_handled_syscall()) {
return;
}
@@ -384,7 +385,7 @@ int gdbserver_start(const char *device)
}
gdbserver_state.state = chr ? RS_IDLE : RS_INACTIVE;
gdbserver_system_state.mon_chr = mon_chr;
- gdbserver_state.current_syscall_cb = NULL;
+ gdb_syscall_reset();
return 0;
}