diff options
author | delphij <delphij@FreeBSD.org> | 2007-06-26 22:42:37 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2007-06-26 22:42:37 +0000 |
commit | affd0ee0043936936b78491b24cc22a3da0724aa (patch) | |
tree | 3cc8c64db8fd7bb4e48552b4ef2c53d7e13842c5 /usr.bin/truss/sparc64-fbsd.c | |
parent | 62b8a82dc4546ba4ea96b579ad64bb24b80a2227 (diff) | |
download | FreeBSD-src-affd0ee0043936936b78491b24cc22a3da0724aa.zip FreeBSD-src-affd0ee0043936936b78491b24cc22a3da0724aa.tar.gz |
MFp4: Bugfixes for truss(1):
- Fix logic handling execve(). We will not be able to
obtain information otherwise.
- truss coredump [1].
- truss does not work against itself [2].
PR: bin/58970 [1], bin/45193 [2]
Submitted by: Howard Su
Approved by: re (kensmith)
Diffstat (limited to 'usr.bin/truss/sparc64-fbsd.c')
-rw-r--r-- | usr.bin/truss/sparc64-fbsd.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/truss/sparc64-fbsd.c b/usr.bin/truss/sparc64-fbsd.c index cc2f473..896bac7 100644 --- a/usr.bin/truss/sparc64-fbsd.c +++ b/usr.bin/truss/sparc64-fbsd.c @@ -247,13 +247,6 @@ sparc64_syscall_entry(struct trussinfo *trussinfo, int nargs) { fprintf(trussinfo->outfile, "\n"); #endif - /* - * Some system calls should be printed out before they are done -- - * execve() and exit(), for example, never return. Possibly change - * this to work for any system call that doesn't have an OUT - * parameter? - */ - if (fsc.name != NULL && (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit"))) { @@ -273,9 +266,6 @@ sparc64_syscall_entry(struct trussinfo *trussinfo, int nargs) { fsc.s_args[2] = NULL; } } - - print_syscall(trussinfo, fsc.name, fsc.nargs, fsc.s_args); - fprintf(trussinfo->outfile, "\n"); } return; @@ -296,6 +286,8 @@ sparc64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { int errorp; struct syscall *sc; + if (fsc.name == NULL) + return (-1); cpid = trussinfo->curthread->tid; if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { @@ -335,6 +327,10 @@ sparc64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { } } + if (fsc.name != NULL && + (!strcmp(fsc.name, "execve") || !strcmp(fsc.name, "exit"))) { + trussinfo->curthread->in_syscall = 1; + } /* * It would probably be a good idea to merge the error handling, * but that complicates things considerably. |