[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 09/12] linux-user/strace: Add print_sockfd()
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v4 09/12] linux-user/strace: Add print_sockfd() |
Date: |
Tue, 3 Jul 2018 12:33:43 -0300 |
Extract common print_sockfd() from various socket related syscalls.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
linux-user/strace.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/linux-user/strace.c b/linux-user/strace.c
index 48ba715557..54060eed93 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1651,6 +1651,11 @@ static void do_print_socket(const char *name, abi_long
arg1)
gemu_log(")");
}
+static void print_sockfd(abi_long sockfd, int last)
+{
+ print_raw_param(TARGET_ABI_FMT_ld, sockfd, last);
+}
+
static void do_print_sockaddr(const char *name, abi_long arg1)
{
abi_ulong sockfd, addr, addrlen;
@@ -1660,7 +1665,7 @@ static void do_print_sockaddr(const char *name, abi_long
arg1)
get_user_ualx(addrlen, arg1, 2);
gemu_log("%s(", name);
- print_raw_param(TARGET_ABI_FMT_ld, sockfd, 0);
+ print_sockfd(sockfd, 0);
print_sockaddr(addr, addrlen);
gemu_log(")");
}
@@ -1673,7 +1678,7 @@ static void do_print_listen(const char *name, abi_long
arg1)
get_user_ualx(backlog, arg1, 1);
gemu_log("%s(", name);
- print_raw_param(TARGET_ABI_FMT_ld, sockfd, 0);
+ print_sockfd(sockfd, 0);
print_raw_param(TARGET_ABI_FMT_ld, backlog, 1);
gemu_log(")");
}
@@ -1708,7 +1713,7 @@ static void do_print_sendrecv(const char *name, abi_long
arg1)
get_user_ualx(flags, arg1, 3);
gemu_log("%s(", name);
- print_raw_param(TARGET_ABI_FMT_ld, sockfd, 0);
+ print_sockfd(sockfd, 0);
print_buf(msg, len, 0);
print_raw_param(TARGET_ABI_FMT_ld, len, 0);
print_flags(msg_flags, flags, 1);
@@ -1727,7 +1732,7 @@ static void do_print_msgaddr(const char *name, abi_long
arg1)
get_user_ualx(addrlen, arg1, 5);
gemu_log("%s(", name);
- print_raw_param(TARGET_ABI_FMT_ld, sockfd, 0);
+ print_sockfd(sockfd, 0);
print_buf(msg, len, 0);
print_raw_param(TARGET_ABI_FMT_ld, len, 0);
print_flags(msg_flags, flags, 0);
@@ -1743,7 +1748,7 @@ static void do_print_shutdown(const char *name, abi_long
arg1)
get_user_ualx(how, arg1, 1);
gemu_log("shutdown(");
- print_raw_param(TARGET_ABI_FMT_ld, sockfd, 0);
+ print_sockfd(sockfd, 0);
switch (how) {
case SHUT_RD:
gemu_log("SHUT_RD");
@@ -1770,7 +1775,7 @@ static void do_print_msg(const char *name, abi_long arg1)
get_user_ualx(flags, arg1, 2);
gemu_log("%s(", name);
- print_raw_param(TARGET_ABI_FMT_ld, sockfd, 0);
+ print_sockfd(sockfd, 0);
print_pointer(msg, 0);
print_flags(msg_flags, flags, 1);
gemu_log(")");
@@ -1787,7 +1792,7 @@ static void do_print_sockopt(const char *name, abi_long
arg1)
get_user_ualx(optlen, arg1, 4);
gemu_log("%s(", name);
- print_raw_param(TARGET_ABI_FMT_ld, sockfd, 0);
+ print_sockfd(sockfd, 0);
switch (level) {
case SOL_TCP:
gemu_log("SOL_TCP,");
--
2.18.0
- [Qemu-devel] [PATCH v4 00/12] linux-user: strace improvements, Philippe Mathieu-Daudé, 2018/07/03
- [Qemu-devel] [PATCH v4 01/12] linux-user/syscall: Verify recvfrom(addr) is user-writable, Philippe Mathieu-Daudé, 2018/07/03
- [Qemu-devel] [PATCH v4 02/12] linux-user/strace: Improve capget()/capset() output, Philippe Mathieu-Daudé, 2018/07/03
- [Qemu-devel] [PATCH v4 05/12] linux-user/strace: Improve settimeofday(), Philippe Mathieu-Daudé, 2018/07/03
- [Qemu-devel] [PATCH v4 06/12] linux-user/syscall: Introduce target_sockaddr_nl, Philippe Mathieu-Daudé, 2018/07/03
- [Qemu-devel] [PATCH v4 09/12] linux-user/strace: Add print_sockfd(),
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v4 08/12] linux-user/strace: Improve recvmsg() output, Philippe Mathieu-Daudé, 2018/07/03
- [Qemu-devel] [PATCH v4 10/12] linux-user/strace: Let print_sockaddr() have a 'last' argument, Philippe Mathieu-Daudé, 2018/07/03