mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
gdbstub: Adjust gdb_do_syscall to only use uint32_t and uint64_t
Pass %x as uint32_t and %lx as uint64_t; pass the address of %s as uint64_t and the length as uint32_t. Add casts in semihosting/syscalls.c from target_ulong to uint64_t; add casts from int to uint32_t for clarity. 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-28-richard.henderson@linaro.org>
This commit is contained in:
parent
2f70f2d791
commit
0820a075af
2 changed files with 26 additions and 20 deletions
|
@ -110,14 +110,14 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...)
|
|||
*(p++) = 'F';
|
||||
while (*fmt) {
|
||||
if (*fmt == '%') {
|
||||
target_ulong addr;
|
||||
uint64_t i64;
|
||||
uint32_t i32;
|
||||
|
||||
fmt++;
|
||||
switch (*fmt++) {
|
||||
case 'x':
|
||||
addr = va_arg(va, target_ulong);
|
||||
p += snprintf(p, p_end - p, TARGET_FMT_lx, addr);
|
||||
i32 = va_arg(va, uint32_t);
|
||||
p += snprintf(p, p_end - p, "%" PRIx32, i32);
|
||||
break;
|
||||
case 'l':
|
||||
if (*(fmt++) != 'x') {
|
||||
|
@ -127,9 +127,9 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...)
|
|||
p += snprintf(p, p_end - p, "%" PRIx64, i64);
|
||||
break;
|
||||
case 's':
|
||||
addr = va_arg(va, target_ulong);
|
||||
p += snprintf(p, p_end - p, TARGET_FMT_lx "/%x",
|
||||
addr, va_arg(va, int));
|
||||
i64 = va_arg(va, uint64_t);
|
||||
i32 = va_arg(va, uint32_t);
|
||||
p += snprintf(p, p_end - p, "%" PRIx64 "/%x" PRIx32, i64, i32);
|
||||
break;
|
||||
default:
|
||||
bad_format:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue