From 5ac1c7ac3466d134ca53cfcb21236f499b7767fd Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 10 Jun 2017 00:45:07 +0000 Subject: [PATCH] Decode the arguments to ptrace(). This does not decode structures returned by ptrace(). --- usr.bin/truss/syscall.h | 1 + usr.bin/truss/syscalls.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h index ac1e17c50d4..be5da1ece4f 100644 --- a/usr.bin/truss/syscall.h +++ b/usr.bin/truss/syscall.h @@ -50,6 +50,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHex, Name, Ptr, Stat, Ioctl, Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol, Sockoptlevel, Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, + Ptraceop, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 979aca61762..6df97c28953 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -361,6 +361,8 @@ static struct syscall decoded_syscalls[] = { { QuadHex, 3 } } }, { .name = "procctl", .ret_type = 1, .nargs = 4, .args = { { Idtype, 0 }, { Quad, 1 }, { Procctl, 2 }, { Ptr, 3 } } }, + { .name = "ptrace", .ret_type = 1, .nargs = 4, + .args = { { Ptraceop, 0 }, { Int, 1 }, { Ptr, 2 }, { Int, 3 } } }, { .name = "pwrite", .ret_type = 1, .nargs = 4, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 }, { QuadHex, 3 } } }, @@ -2130,6 +2132,10 @@ print_arg(struct syscall_args *sc, unsigned long *args, long *retval, case Priowhich: print_integer_arg(sysdecode_prio_which, fp, args[sc->offset]); break; + case Ptraceop: + print_integer_arg(sysdecode_ptrace_request, fp, + args[sc->offset]); + break; case CloudABIAdvice: fputs(xlookup(cloudabi_advice, args[sc->offset]), fp);