tprintf(fmt, count, count == 1 ? "" : "s");
}
-SYS_FUNC(execve)
+static void
+decode_execve(struct tcb *tcp, const unsigned int index)
{
- printpath(tcp, tcp->u_arg[0]);
+ printpath(tcp, tcp->u_arg[index + 0]);
tprints(", ");
- if (!tcp->u_arg[1] || !verbose(tcp))
- printaddr(tcp->u_arg[1]);
+ if (!tcp->u_arg[index + 1] || !verbose(tcp))
+ printaddr(tcp->u_arg[index + 1]);
else {
tprints("[");
- printargv(tcp, tcp->u_arg[1]);
+ printargv(tcp, tcp->u_arg[index + 1]);
tprints("]");
}
tprints(", ");
- if (!tcp->u_arg[2] || !verbose(tcp))
- printaddr(tcp->u_arg[2]);
+ if (!tcp->u_arg[index + 2] || !verbose(tcp))
+ printaddr(tcp->u_arg[index + 2]);
else if (abbrev(tcp))
- printargc("[/* %d var%s */]", tcp, tcp->u_arg[2]);
+ printargc("[/* %d var%s */]", tcp, tcp->u_arg[index + 2]);
else {
tprints("[");
- printargv(tcp, tcp->u_arg[2]);
+ printargv(tcp, tcp->u_arg[index + 2]);
tprints("]");
}
+}
+
+SYS_FUNC(execve)
+{
+ decode_execve(tcp, 0);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(execveat)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ decode_execve(tcp, 1);
+ tprints(", ");
+ printflags(at_flags, tcp->u_arg[4], "AT_???");
return RVAL_DECODED;
}