]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
gdbstub: Fix %s formatting
authorSean Anderson <sean.anderson@linux.dev>
Mon, 27 Oct 2025 11:03:41 +0000 (11:03 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 29 Oct 2025 14:13:40 +0000 (14:13 +0000)
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 <sean.anderson@linux.dev>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251027110344.2289945-35-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
gdbstub/syscalls.c

index e855df21abaeebc671eafb6c97b4bfb34307c1ce..d8bb90cc1c7fec7790aaf8ac8ebe5f412c404b97 100644 (file)
@@ -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: