Skip to content

Commit

Permalink
linux-user/strace: Improve bind() output
Browse files Browse the repository at this point in the history
Tested-By: Guido Günther <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
  • Loading branch information
philmd authored and vivier committed Oct 21, 2019
1 parent d84fe1e commit bb10540
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion linux-user/strace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@ print_socket(const struct syscallname *name,

#endif

#if defined(TARGET_NR_socketcall)
#if defined(TARGET_NR_socketcall) || defined(TARGET_NR_bind)

static void print_sockfd(abi_long sockfd, int last)
{
Expand Down Expand Up @@ -2054,6 +2054,19 @@ print_socketcall(const struct syscallname *name,
}
#endif

#if defined(TARGET_NR_bind)
static void
print_bind(const struct syscallname *name,
abi_long arg0, abi_long arg1, abi_long arg2,
abi_long arg3, abi_long arg4, abi_long arg5)
{
print_syscall_prologue(name);
print_sockfd(arg0, 0);
print_sockaddr(arg1, arg2, 1);
print_syscall_epilogue(name);
}
#endif

#if defined(TARGET_NR_stat) || defined(TARGET_NR_stat64) || \
defined(TARGET_NR_lstat) || defined(TARGET_NR_lstat64)
static void
Expand Down
2 changes: 1 addition & 1 deletion linux-user/strace.list
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{ TARGET_NR_bdflush, "bdflush" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_bind
{ TARGET_NR_bind, "bind" , NULL, NULL, NULL },
{ TARGET_NR_bind, "bind" , NULL, print_bind, NULL },
#endif
#ifdef TARGET_NR_bpf
{ TARGET_NR_bpf, "bpf" , NULL, NULL, NULL },
Expand Down

0 comments on commit bb10540

Please sign in to comment.