aboutsummaryrefslogtreecommitdiff
path: root/gdbstub
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-03-02 18:58:03 -0800
committerAlex Bennée <alex.bennee@linaro.org>2023-03-07 20:44:09 +0000
commit0820a075af2ee1090217c59c3d8ec966907cec1c (patch)
tree76731d8682610ed91f6393710ba6116f2e7e4ae7 /gdbstub
parent2f70f2d7917357621fbc4fadeb1bb6f99bd805e0 (diff)
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>
Diffstat (limited to 'gdbstub')
-rw-r--r--gdbstub/syscalls.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdbstub/syscalls.c b/gdbstub/syscalls.c
index fdc68e452a..9f479010b1 100644
--- a/gdbstub/syscalls.c
+++ b/gdbstub/syscalls.c
@@ -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: