diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2017-08-30 15:45:23 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2017-08-30 15:45:23 +0000 |
| commit | 13e5e6b61611bb8ee1db804e0ee348b0b064f4ca (patch) | |
| tree | e175063484ea0699e747268b00f94b0b7bcc9ed6 /usr.bin | |
| parent | 3cc32ea6556324151257db8a1c3964e36d48747c (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/truss/extern.h | 1 | ||||
| -rw-r--r-- | usr.bin/truss/setup.c | 2 | ||||
| -rw-r--r-- | usr.bin/truss/syscall.h | 1 | ||||
| -rw-r--r-- | usr.bin/truss/syscalls.c | 32 |
4 files changed, 31 insertions, 5 deletions
diff --git a/usr.bin/truss/extern.h b/usr.bin/truss/extern.h index 5a307b6e3f2b..f19a1cbb7c92 100644 --- a/usr.bin/truss/extern.h +++ b/usr.bin/truss/extern.h @@ -35,4 +35,5 @@ extern int print_line_prefix(struct trussinfo *); extern void setup_and_wait(struct trussinfo *, char **); extern void start_tracing(struct trussinfo *, pid_t); extern void restore_proc(int); +extern void decode_siginfo(FILE *, siginfo_t *); extern void eventloop(struct trussinfo *); diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c index 991795364707..97dd9650189b 100644 --- a/usr.bin/truss/setup.c +++ b/usr.bin/truss/setup.c @@ -584,7 +584,7 @@ report_new_child(struct trussinfo *info) fprintf(info->outfile, "<new process>\n"); } -static void +void decode_siginfo(FILE *fp, siginfo_t *si) { const char *str; diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h index 8510be5d3e9b..bd4af80364ef 100644 --- a/usr.bin/truss/syscall.h +++ b/usr.bin/truss/syscall.h @@ -52,6 +52,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHex, Name, Ptr, Stat, Stat11 Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, + PSig, Siginfo, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 49cbf30cf533..a893c514f97c 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -462,11 +462,12 @@ static struct syscall decoded_syscalls[] = { { .name = "sigsuspend", .ret_type = 1, .nargs = 1, .args = { { Sigset | IN, 0 } } }, { .name = "sigtimedwait", .ret_type = 1, .nargs = 3, - .args = { { Sigset | IN, 0 }, { Ptr, 1 }, { Timespec | IN, 2 } } }, + .args = { { Sigset | IN, 0 }, { Siginfo | OUT, 1 }, + { Timespec | IN, 2 } } }, { .name = "sigwait", .ret_type = 1, .nargs = 2, - .args = { { Sigset | IN, 0 }, { Ptr, 1 } } }, + .args = { { Sigset | IN, 0 }, { PSig | OUT, 1 } } }, { .name = "sigwaitinfo", .ret_type = 1, .nargs = 2, - .args = { { Sigset | IN, 0 }, { Ptr, 1 } } }, + .args = { { Sigset | IN, 0 }, { Siginfo | OUT, 1 } } }, { .name = "socket", .ret_type = 1, .nargs = 3, .args = { { Sockdomain, 0 }, { Socktype, 1 }, { Sockprotocol, 2 } } }, { .name = "stat", .ret_type = 1, .nargs = 2, @@ -510,7 +511,8 @@ static struct syscall decoded_syscalls[] = { { Rusage | OUT, 3 } } }, { .name = "wait6", .ret_type = 1, .nargs = 6, .args = { { Idtype, 0 }, { Quad, 1 }, { ExitStatus | OUT, 2 }, - { Waitoptions, 3 }, { Rusage | OUT, 4 }, { Ptr, 5 } } }, + { Waitoptions, 3 }, { Rusage | OUT, 4 }, + { Siginfo | OUT, 5 } } }, { .name = "write", .ret_type = 1, .nargs = 3, .args = { { Int, 0 }, { BinString | IN, 1 }, { Sizet, 2 } } }, @@ -2164,6 +2166,28 @@ print_arg(struct syscall_args *sc, unsigned long *args, long *retval, fprintf(fp, "0x%lx", args[sc->offset]); break; } + case PSig: { + int sig; + + if (get_struct(pid, (void *)args[sc->offset], &sig, + sizeof(sig)) == 0) + fprintf(fp, "{ %s }", strsig2(sig)); + else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } + case Siginfo: { + siginfo_t si; + + if (get_struct(pid, (void *)args[sc->offset], &si, + sizeof(si)) != -1) { + fprintf(fp, "{ signo=%s", strsig2(si.si_signo)); + decode_siginfo(fp, &si); + fprintf(fp, " }"); + } else + fprintf(fp, "0x%lx", args[sc->offset]); + break; + } case CloudABIAdvice: fputs(xlookup(cloudabi_advice, args[sc->offset]), fp); |
