From a87295e8df0923dab9857c1a340d23fe3278a336 Mon Sep 17 00:00:00 2001 From: pbrook Date: Sat, 26 May 2007 15:09:38 +0000 Subject: M68k system mode semihosting. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2861 c046a42c-6fe2-441c-8c8c-71466251a162 --- gdbstub.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gdbstub.c') diff --git a/gdbstub.c b/gdbstub.c index 7dcaade66d..fd20c9ca7f 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -963,14 +963,16 @@ static void gdb_vm_stopped(void *opaque, int reason) /* Send a gdb syscall request. This accepts limited printf-style format specifiers, specifically: - %x - target_ulong argument printed in hex. - %s - string pointer (target_ulong) and length (int) pair. */ + %x - target_ulong argument printed in hex. + %lx - 64-bit argument printed in hex. + %s - string pointer (target_ulong) and length (int) pair. */ void gdb_do_syscall(gdb_syscall_complete_cb cb, char *fmt, ...) { va_list va; char buf[256]; char *p; target_ulong addr; + uint64_t i64; GDBState *s; s = gdb_syscall_state; @@ -993,11 +995,18 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, char *fmt, ...) addr = va_arg(va, target_ulong); p += sprintf(p, TARGET_FMT_lx, addr); break; + case 'l': + if (*(fmt++) != 'x') + goto bad_format; + i64 = va_arg(va, uint64_t); + p += sprintf(p, "%" PRIx64, i64); + break; case 's': addr = va_arg(va, target_ulong); p += sprintf(p, TARGET_FMT_lx "/%x", addr, va_arg(va, int)); break; default: + bad_format: fprintf(stderr, "gdbstub: Bad syscall format string '%s'\n", fmt - 1); break; -- cgit v1.2.3