diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-08-07 14:43:04 +0200 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2024-10-08 06:31:36 -0700 |
commit | 57fbc9b987ea63ccab955520276dd04e41eea4f0 (patch) | |
tree | 8d8b7262c3d076bd1e58f70ef0a43a72b582b88f /linux-user/strace.c | |
parent | 02d9169761a99060daf2c5a362d67b2b1cf9c42f (diff) |
linux-user: Factor print_buf_len() out
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-ID: <20240807124306.52903-4-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/strace.c')
-rw-r--r-- | linux-user/strace.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/linux-user/strace.c b/linux-user/strace.c index b72fcd515f..245153c1ce 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1670,6 +1670,13 @@ print_buf(abi_long addr, abi_long len, int last) } } +static void +print_buf_len(abi_long addr, abi_long len, int last) +{ + print_buf(addr, len, 0); + print_raw_param(TARGET_ABI_FMT_ld, len, last); +} + /* * Prints out raw parameter using given format. Caller needs * to do byte swapping if needed. @@ -2757,8 +2764,7 @@ static void do_print_sendrecv(const char *name, abi_long arg1) qemu_log("%s(", name); print_sockfd(sockfd, 0); - print_buf(msg, len, 0); - print_raw_param(TARGET_ABI_FMT_ld, len, 0); + print_buf_len(msg, len, 0); print_flags(msg_flags, flags, 1); qemu_log(")"); } @@ -2776,8 +2782,7 @@ static void do_print_msgaddr(const char *name, abi_long arg1) qemu_log("%s(", name); print_sockfd(sockfd, 0); - print_buf(msg, len, 0); - print_raw_param(TARGET_ABI_FMT_ld, len, 0); + print_buf_len(msg, len, 0); print_flags(msg_flags, flags, 0); print_sockaddr(addr, addrlen, 0); qemu_log(")"); |