aboutsummaryrefslogtreecommitdiff
path: root/gdbstub/syscalls.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/syscalls.c
parent4692a86f1c90a26cad752409fc8d30e591e1f741 (diff)
downloadqemu-131f387d741ee2dfe953f8829e5634e49e6dfb31.zip
qemu-131f387d741ee2dfe953f8829e5634e49e6dfb31.tar.gz
qemu-131f387d741ee2dfe953f8829e5634e49e6dfb31.tar.bz2
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/syscalls.c')
-rw-r--r--gdbstub/syscalls.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/gdbstub/syscalls.c b/gdbstub/syscalls.c
index 4653793..6189940 100644
--- a/gdbstub/syscalls.c
+++ b/gdbstub/syscalls.c
@@ -105,9 +105,7 @@ void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va)
}
gdbserver_syscall_state.current_syscall_cb = cb;
-#ifndef CONFIG_USER_ONLY
- vm_stop(RUN_STATE_DEBUG);
-#endif
+
p = &gdbserver_syscall_state.syscall_buf[0];
p_end = &gdbserver_syscall_state.syscall_buf[sizeof(gdbserver_syscall_state.syscall_buf)];
*(p++) = 'F';
@@ -142,27 +140,8 @@ void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va)
}
}
*p = 0;
-#ifdef CONFIG_USER_ONLY
- gdb_put_packet(gdbserver_syscall_state.syscall_buf);
- /*
- * 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).
- */
- gdb_handlesig(gdbserver_state.c_cpu, 0);
-#else
- /*
- * In this case wait to send the syscall packet until notification that
- * the CPU has stopped. This must be done because if the packet is sent
- * now the reply from the syscall request could be received while the CPU
- * is still in the running state, which can cause packets to be dropped
- * and state transition 'T' packets to be sent while the syscall is still
- * being processed.
- */
- qemu_cpu_kick(gdbserver_state.c_cpu);
-#endif
+
+ gdb_syscall_handling(gdbserver_syscall_state.syscall_buf);
}
void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...)