If the format is not the syscall last argument, a comma is append. Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> --- linux-user/strace.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/linux-user/strace.c b/linux-user/strace.c index 390a50d45a..85a1efef32 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -67,7 +67,7 @@ UNUSED static void print_timeval(abi_ulong, int); UNUSED static void print_timezone(abi_ulong, int); UNUSED static void print_number(abi_long, int); UNUSED static void print_signal(abi_ulong, int); -UNUSED static void print_sockaddr(abi_ulong addr, abi_long addrlen); +UNUSED static void print_sockaddr(abi_ulong addr, abi_long addrlen, int); UNUSED static void print_socket_domain(int domain); UNUSED static void print_socket_type(int type); UNUSED static void print_socket_protocol(int domain, int type, int protocol); @@ -336,7 +336,7 @@ static void print_siginfo(const target_siginfo_t *tinfo) } static void -print_sockaddr(abi_ulong addr, abi_long addrlen) +print_sockaddr(abi_ulong addr, abi_long addrlen, int last) { struct target_sockaddr *sa; int i; @@ -418,7 +418,7 @@ print_sockaddr(abi_ulong addr, abi_long addrlen) } else { print_raw_param("0x"TARGET_ABI_FMT_lx, addr, 0); } - gemu_log(", "TARGET_ABI_FMT_ld, addrlen); + gemu_log(", "TARGET_ABI_FMT_ld"%s", addrlen, get_comma(last)); } static void @@ -1658,7 +1658,7 @@ static void do_print_sockaddr(const char *name, abi_long arg1) gemu_log("%s(", name); print_raw_param(TARGET_ABI_FMT_ld, sockfd, 0); - print_sockaddr(addr, addrlen); + print_sockaddr(addr, addrlen, 0); gemu_log(")"); } @@ -1728,7 +1728,7 @@ static void do_print_msgaddr(const char *name, abi_long arg1) print_buf(msg, len, 0); print_raw_param(TARGET_ABI_FMT_ld, len, 0); print_flags(msg_flags, flags, 0); - print_sockaddr(addr, addrlen); + print_sockaddr(addr, addrlen, 0); gemu_log(")"); } @@ -1966,7 +1966,7 @@ print_bind(const struct syscallname *name, { print_syscall_prologue(name); print_raw_param("%d", arg0, 0); - print_sockaddr(arg1, arg2); + print_sockaddr(arg1, arg2, 1); print_syscall_epilogue(name); } #endif @@ -1982,7 +1982,7 @@ print_sendto(const struct syscallname *name, print_buf(arg1, arg2, 0); print_raw_param(TARGET_ABI_FMT_ld, arg2, 0); print_flags(msg_flags, arg3, 0); - print_sockaddr(arg4, arg5); + print_sockaddr(arg4, arg5, 1); print_syscall_epilogue(name); } #endif -- 2.18.0