From cd4298ae04814283f3ffa366315ff1fab35c82fe Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sun, 23 Jul 2023 15:33:39 +0300 Subject: [PATCH] Userland: Teach strace(1) to format pledge(2) --- Userland/Utilities/strace.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Userland/Utilities/strace.cpp b/Userland/Utilities/strace.cpp index 4e7e615617..bf8e71a43b 100644 --- a/Userland/Utilities/strace.cpp +++ b/Userland/Utilities/strace.cpp @@ -579,6 +579,15 @@ static void format_close(FormattedSyscallBuilder& builder, int fd) builder.add_arguments(fd); } +static ErrorOr format_pledge(FormattedSyscallBuilder& builder, Syscall::SC_pledge_params* params_p) +{ + auto params = TRY(copy_from_process(params_p)); + builder.add_arguments( + StringArgument { params.promises }, + StringArgument { params.execpromises }); + return {}; +} + static ErrorOr format_poll(FormattedSyscallBuilder& builder, Syscall::SC_poll_params* params_p) { // TODO: format fds and sigmask properly @@ -749,6 +758,9 @@ static ErrorOr format_syscall(FormattedSyscallBuilder& builder, Syscall::F case SC_open: TRY(format_open(builder, (Syscall::SC_open_params*)arg1)); break; + case SC_pledge: + TRY(format_pledge(builder, (Syscall::SC_pledge_params*)arg1)); + break; case SC_poll: TRY(format_poll(builder, (Syscall::SC_poll_params*)arg1)); break;