1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

strace: Add formatting support for SC_poll

This commit is contained in:
Jean-Baptiste Boric 2021-12-12 11:54:59 +01:00 committed by Andreas Kling
parent 809855be57
commit e486d23c3f

View file

@ -582,6 +582,17 @@ static void format_select(FormattedSyscallBuilder& builder, Syscall::SC_select_p
PointerArgument { params.sigmask });
}
static void format_poll(FormattedSyscallBuilder& builder, Syscall::SC_poll_params* params_p)
{
// TODO: format fds and sigmask properly
auto params = copy_from_process(params_p).release_value_but_fixme_should_propagate_errors();
builder.add_arguments(
params.nfds,
PointerArgument { params.fds },
copy_from_process(params.timeout),
PointerArgument { params.sigmask });
}
namespace AK {
template<>
struct Formatter<struct sockaddr> : StandardFormatter {
@ -741,6 +752,9 @@ static void format_syscall(FormattedSyscallBuilder& builder, Syscall::Function s
case SC_open:
format_open(builder, (Syscall::SC_open_params*)arg1);
break;
case SC_poll:
format_poll(builder, (Syscall::SC_poll_params*)arg1);
break;
case SC_read:
format_read(builder, (int)arg1, (void*)arg2, (size_t)arg3);
result_type = Ssize;