提交 42b15d70 编写于 作者: P Philippe Mathieu-Daudé 提交者: Laurent Vivier

linux-user/strace: Let print_sockaddr() have a 'last' argument

If the format is not the syscall last argument, a comma is append.
Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: NLaurent Vivier <laurent@vivier.eu>
Reviewed-by: NLaurent Vivier <laurent@vivier.eu>
Message-Id: <20191021114857.20538-9-f4bug@amsat.org>
Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
上级 bb10540e
......@@ -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, abi_long, 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
......@@ -1751,7 +1751,7 @@ static void do_print_sockaddr(const char *name, abi_long arg1)
gemu_log("%s(", name);
print_sockfd(sockfd, 0);
print_sockaddr(addr, addrlen);
print_sockaddr(addr, addrlen, 0);
gemu_log(")");
}
......@@ -1821,7 +1821,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(")");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册