Skip to content

Commit

Permalink
linux-user: add socket() strace
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Vivier <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
  • Loading branch information
vivier authored and Riku Voipio committed Jun 26, 2016
1 parent fb3aabf commit 8997d1b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions linux-user/strace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,29 @@ print__llseek(const struct syscallname *name,
}
#endif

#if defined(TARGET_NR_socket)
static void
print_socket(const struct syscallname *name,
abi_long arg0, abi_long arg1, abi_long arg2,
abi_long arg3, abi_long arg4, abi_long arg5)
{
abi_ulong domain = arg0, type = arg1, protocol = arg2;

print_syscall_prologue(name);
print_socket_domain(domain);
gemu_log(",");
print_socket_type(type);
gemu_log(",");
if (domain == AF_PACKET ||
(domain == AF_INET && type == TARGET_SOCK_PACKET)) {
protocol = tswap16(protocol);
}
print_socket_protocol(domain, type, protocol);
print_syscall_epilogue(name);
}

#endif

#if defined(TARGET_NR_socketcall)

#define get_user_ualx(x, gaddr, idx) \
Expand Down
2 changes: 1 addition & 1 deletion linux-user/strace.list
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@
{ TARGET_NR_sigsuspend, "sigsuspend" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_socket
{ TARGET_NR_socket, "socket" , NULL, NULL, NULL },
{ TARGET_NR_socket, "socket" , NULL, print_socket, NULL },
#endif
#ifdef TARGET_NR_socketcall
{ TARGET_NR_socketcall, "socketcall" , NULL, print_socketcall, NULL },
Expand Down

0 comments on commit 8997d1b

Please sign in to comment.