mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-07-21 10:24:33 +00:00
gdbstub: Remove gdb_do_syscallv
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>
This commit is contained in:
parent
131f387d74
commit
2f70f2d791
|
@ -93,24 +93,26 @@ bool gdb_handled_syscall(void)
|
||||||
* %lx - 64-bit argument printed in hex.
|
* %lx - 64-bit argument printed in hex.
|
||||||
* %s - string pointer (target_ulong) and length (int) pair.
|
* %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, *p_end;
|
||||||
char *p_end;
|
va_list va;
|
||||||
target_ulong addr;
|
|
||||||
uint64_t i64;
|
|
||||||
|
|
||||||
if (!gdb_attached()) {
|
if (!gdb_attached()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gdbserver_syscall_state.current_syscall_cb = cb;
|
gdbserver_syscall_state.current_syscall_cb = cb;
|
||||||
|
va_start(va, fmt);
|
||||||
|
|
||||||
p = &gdbserver_syscall_state.syscall_buf[0];
|
p = gdbserver_syscall_state.syscall_buf;
|
||||||
p_end = &gdbserver_syscall_state.syscall_buf[sizeof(gdbserver_syscall_state.syscall_buf)];
|
p_end = p + sizeof(gdbserver_syscall_state.syscall_buf);
|
||||||
*(p++) = 'F';
|
*(p++) = 'F';
|
||||||
while (*fmt) {
|
while (*fmt) {
|
||||||
if (*fmt == '%') {
|
if (*fmt == '%') {
|
||||||
|
target_ulong addr;
|
||||||
|
uint64_t i64;
|
||||||
|
|
||||||
fmt++;
|
fmt++;
|
||||||
switch (*fmt++) {
|
switch (*fmt++) {
|
||||||
case 'x':
|
case 'x':
|
||||||
|
@ -141,16 +143,8 @@ void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va)
|
||||||
}
|
}
|
||||||
*p = 0;
|
*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);
|
va_end(va);
|
||||||
|
gdb_syscall_handling(gdbserver_syscall_state.syscall_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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, ...);
|
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
|
* use_gdb_syscalls() - report if GDB should be used for syscalls
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue