linux-user: Provide print_raw_param64() for 64-bit values
Add a new function print_raw_param64() to print 64-bit values in the same way as print_raw_param(). This prevents that qemu_log() is used to work around the problem that print_raw_param() can only print 32-bit values when compiled for 32-bit targets. Additionally convert the existing 64-bit users in print_timespec64(), print_rlimit64() and print_preadwrite64() over to this new function and drop some unneccessary spaces. Suggested-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Helge Deller <deller@gmx.de> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <Y9lNbFNyRSUhhrHa@p100> [lvivier: remove print_preadwrite64 and print_rlimit64 part] Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
86f04735ac
commit
8e0f5c1b10
@ -81,6 +81,7 @@ UNUSED static void print_syscall_epilogue(const struct syscallname *);
|
|||||||
UNUSED static void print_string(abi_long, int);
|
UNUSED static void print_string(abi_long, int);
|
||||||
UNUSED static void print_buf(abi_long addr, abi_long len, int last);
|
UNUSED static void print_buf(abi_long addr, abi_long len, int last);
|
||||||
UNUSED static void print_raw_param(const char *, abi_long, int);
|
UNUSED static void print_raw_param(const char *, abi_long, int);
|
||||||
|
UNUSED static void print_raw_param64(const char *, long long, int last);
|
||||||
UNUSED static void print_timeval(abi_ulong, int);
|
UNUSED static void print_timeval(abi_ulong, int);
|
||||||
UNUSED static void print_timespec(abi_ulong, int);
|
UNUSED static void print_timespec(abi_ulong, int);
|
||||||
UNUSED static void print_timespec64(abi_ulong, int);
|
UNUSED static void print_timespec64(abi_ulong, int);
|
||||||
@ -1642,6 +1643,19 @@ print_raw_param(const char *fmt, abi_long param, int last)
|
|||||||
qemu_log(format, param);
|
qemu_log(format, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Same as print_raw_param() but prints out raw 64-bit parameter.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
print_raw_param64(const char *fmt, long long param, int last)
|
||||||
|
{
|
||||||
|
char format[64];
|
||||||
|
|
||||||
|
(void)snprintf(format, sizeof(format), "%s%s", fmt, get_comma(last));
|
||||||
|
qemu_log(format, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_pointer(abi_long p, int last)
|
print_pointer(abi_long p, int last)
|
||||||
{
|
{
|
||||||
@ -1718,10 +1732,8 @@ print_timespec64(abi_ulong ts_addr, int last)
|
|||||||
print_pointer(ts_addr, last);
|
print_pointer(ts_addr, last);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qemu_log("{tv_sec = %lld"
|
print_raw_param64("{tv_sec=%" PRId64, tswap64(ts->tv_sec), 0);
|
||||||
",tv_nsec = %lld}%s",
|
print_raw_param64("tv_nsec=%" PRId64 "}", tswap64(ts->tv_nsec), last);
|
||||||
(long long)tswap64(ts->tv_sec), (long long)tswap64(ts->tv_nsec),
|
|
||||||
get_comma(last));
|
|
||||||
unlock_user(ts, ts_addr, 0);
|
unlock_user(ts, ts_addr, 0);
|
||||||
} else {
|
} else {
|
||||||
qemu_log("NULL%s", get_comma(last));
|
qemu_log("NULL%s", get_comma(last));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user