aboutsummaryrefslogtreecommitdiff
path: root/gdbstub/user.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2023-03-02 18:58:01 -0800
committerAlex Bennée <alex.bennee@linaro.org>2023-03-07 20:44:09 +0000
commit131f387d741ee2dfe953f8829e5634e49e6dfb31 (patch)
tree6dcac51627e3f1ad584594e43c5073f02f36fb40 /gdbstub/user.c
parent4692a86f1c90a26cad752409fc8d30e591e1f741 (diff)
gdbstub: split out softmmu/user specifics for syscall handling
Most of the syscall code is config agnostic aside from the size of target_ulong. In preparation for the next patch move the final bits of specialisation into the appropriate user and softmmu helpers. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230302190846.2593720-26-alex.bennee@linaro.org> Message-Id: <20230303025805.625589-26-richard.henderson@linaro.org>
Diffstat (limited to 'gdbstub/user.c')
-rw-r--r--gdbstub/user.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdbstub/user.c b/gdbstub/user.c
index 3da410e221..80488b6bb9 100644
--- a/gdbstub/user.c
+++ b/gdbstub/user.c
@@ -472,3 +472,17 @@ void gdb_breakpoint_remove_all(CPUState *cs)
{
cpu_breakpoint_remove_all(cs, BP_GDB);
}
+
+/*
+ * For user-mode syscall support we send the system call immediately
+ * and then return control to gdb for it to process the syscall request.
+ * Since the protocol requires that gdb hands control back to us
+ * using a "here are the results" F packet, we don't need to check
+ * gdb_handlesig's return value (which is the signal to deliver if
+ * execution was resumed via a continue packet).
+ */
+void gdb_syscall_handling(const char *syscall_packet)
+{
+ gdb_put_packet(syscall_packet);
+ gdb_handlesig(gdbserver_state.c_cpu, 0);
+}