[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/30] gdbstub: Remove gdb_do_syscallv
From: |
Alex Bennée |
Subject: |
[PULL 26/30] gdbstub: Remove gdb_do_syscallv |
Date: |
Tue, 7 Mar 2023 21:21:35 +0000 |
From: Richard Henderson <richard.henderson@linaro.org>
This function is unused, except to implement gdb_do_syscall.
Fold the implementations together.
Signed-off-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: <20230303025805.625589-27-richard.henderson@linaro.org>
diff --git a/include/gdbstub/syscalls.h b/include/gdbstub/syscalls.h
index 5851a2c706..243eaf8ce4 100644
--- a/include/gdbstub/syscalls.h
+++ b/include/gdbstub/syscalls.h
@@ -91,17 +91,6 @@ typedef void (*gdb_syscall_complete_cb)(CPUState *cpu,
uint64_t ret, int err);
*/
void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
-/**
- * gdb_do_syscallv:
- * @cb: function to call when the system call has completed
- * @fmt: gdb syscall format string
- * @va: arguments to interpolate into @fmt
- *
- * As gdb_do_syscall, but taking a va_list rather than a variable
- * argument list.
- */
-void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va);
-
/**
* use_gdb_syscalls() - report if GDB should be used for syscalls
*
diff --git a/gdbstub/syscalls.c b/gdbstub/syscalls.c
index 6189940005..fdc68e452a 100644
--- a/gdbstub/syscalls.c
+++ b/gdbstub/syscalls.c
@@ -93,24 +93,26 @@ bool gdb_handled_syscall(void)
* %lx - 64-bit argument printed in hex.
* %s - string pointer (target_ulong) and length (int) pair.
*/
-void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va)
+void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...)
{
- char *p;
- char *p_end;
- target_ulong addr;
- uint64_t i64;
+ char *p, *p_end;
+ va_list va;
if (!gdb_attached()) {
return;
}
gdbserver_syscall_state.current_syscall_cb = cb;
+ va_start(va, fmt);
- p = &gdbserver_syscall_state.syscall_buf[0];
- p_end =
&gdbserver_syscall_state.syscall_buf[sizeof(gdbserver_syscall_state.syscall_buf)];
+ p = gdbserver_syscall_state.syscall_buf;
+ p_end = p + sizeof(gdbserver_syscall_state.syscall_buf);
*(p++) = 'F';
while (*fmt) {
if (*fmt == '%') {
+ target_ulong addr;
+ uint64_t i64;
+
fmt++;
switch (*fmt++) {
case 'x':
@@ -141,16 +143,8 @@ void gdb_do_syscallv(gdb_syscall_complete_cb cb, const
char *fmt, va_list va)
}
*p = 0;
- gdb_syscall_handling(gdbserver_syscall_state.syscall_buf);
-}
-
-void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...)
-{
- va_list va;
-
- va_start(va, fmt);
- gdb_do_syscallv(cb, fmt, va);
va_end(va);
+ gdb_syscall_handling(gdbserver_syscall_state.syscall_buf);
}
/*
--
2.39.2
- [PULL 07/30] includes: move tb_flush into its own header, (continued)
- [PULL 07/30] includes: move tb_flush into its own header, Alex Bennée, 2023/03/07
- [PULL 10/30] gdbstub: move chunk of softmmu functionality to own file, Alex Bennée, 2023/03/07
- [PULL 14/30] gdbstub: specialise handle_query_attached, Alex Bennée, 2023/03/07
- [PULL 12/30] gdbstub: rationalise signal mapping in softmmu, Alex Bennée, 2023/03/07
- [PULL 09/30] gdbstub: make various helpers visible to the rest of the module, Alex Bennée, 2023/03/07
- [PULL 11/30] gdbstub: move chunks of user code into own files, Alex Bennée, 2023/03/07
- [PULL 02/30] gdbstub: fix-up copyright and license files, Alex Bennée, 2023/03/07
- [PULL 06/30] gdbstub: move GDBState to shared internals header, Alex Bennée, 2023/03/07
- [PULL 13/30] gdbstub: abstract target specific details from gdb_put_packet_binary, Alex Bennée, 2023/03/07
- [PULL 17/30] gdbstub: specialise stub_can_reverse, Alex Bennée, 2023/03/07
- [PULL 26/30] gdbstub: Remove gdb_do_syscallv,
Alex Bennée <=
- [PULL 29/30] gdbstub: Build syscall.c once, Alex Bennée, 2023/03/07
- [PULL 28/30] stubs: split semihosting_get_target from system only stubs, Alex Bennée, 2023/03/07
- [PULL 16/30] gdbstub: introduce gdb_get_max_cpus, Alex Bennée, 2023/03/07
- [PULL 25/30] gdbstub: split out softmmu/user specifics for syscall handling, Alex Bennée, 2023/03/07
- [PULL 30/30] gdbstub: move update guest debug to accel ops, Alex Bennée, 2023/03/07
- [PULL 27/30] gdbstub: Adjust gdb_do_syscall to only use uint32_t and uint64_t, Alex Bennée, 2023/03/07
- [PULL 19/30] gdbstub: don't use target_ulong while handling registers, Alex Bennée, 2023/03/07
- [PULL 15/30] gdbstub: specialise target_memory_rw_debug, Alex Bennée, 2023/03/07
- [PULL 20/30] gdbstub: move register helpers into standalone include, Alex Bennée, 2023/03/07
- [PULL 24/30] include: split target_long definition from cpu-defs, Alex Bennée, 2023/03/07