From: Sean Anderson Date: Mon, 27 Oct 2025 11:03:41 +0000 (+0000) Subject: gdbstub: Fix %s formatting X-Git-Tag: v10.2.0-rc1~36^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=524fc77d2322814f0dfde272559d74ec1599f01e;p=thirdparty%2Fqemu.git gdbstub: Fix %s formatting The format string for %s has two format characters. This causes it to emit strings like "466f5bd8/6x" instead of "466f5bd8/6". GDB detects this and returns EIO, causing all open File I/O calls to fail. Fixes: 0820a075af ("gdbstub: Adjust gdb_do_syscall to only use uint32_t and uint64_t") Signed-off-by: Sean Anderson Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20251027110344.2289945-35-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- diff --git a/gdbstub/syscalls.c b/gdbstub/syscalls.c index e855df21ab..d8bb90cc1c 100644 --- a/gdbstub/syscalls.c +++ b/gdbstub/syscalls.c @@ -127,7 +127,7 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...) case 's': i64 = va_arg(va, uint64_t); i32 = va_arg(va, uint32_t); - p += snprintf(p, p_end - p, "%" PRIx64 "/%x" PRIx32, i64, i32); + p += snprintf(p, p_end - p, "%" PRIx64 "/%" PRIx32, i64, i32); break; default: bad_format: