summaryrefslogtreecommitdiffstats
path: root/usr.bin/truss/amd64-fbsd32.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2007-06-26 22:42:37 +0000
committerdelphij <delphij@FreeBSD.org>2007-06-26 22:42:37 +0000
commitaffd0ee0043936936b78491b24cc22a3da0724aa (patch)
tree3cc8c64db8fd7bb4e48552b4ef2c53d7e13842c5 /usr.bin/truss/amd64-fbsd32.c
parent62b8a82dc4546ba4ea96b579ad64bb24b80a2227 (diff)
downloadFreeBSD-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/amd64-fbsd32.c')
-rw-r--r--usr.bin/truss/amd64-fbsd32.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/usr.bin/truss/amd64-fbsd32.c b/usr.bin/truss/amd64-fbsd32.c
index f9e435d..6abd99f 100644
--- a/usr.bin/truss/amd64-fbsd32.c
+++ b/usr.bin/truss/amd64-fbsd32.c
@@ -222,13 +222,6 @@ i386_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"))) {
@@ -249,8 +242,6 @@ i386_syscall_entry(struct trussinfo *trussinfo, int nargs) {
}
}
- print_syscall(trussinfo, fsc.name, fsc.nargs, fsc.s_args);
- fprintf(trussinfo->outfile, "\n");
}
return;
@@ -272,6 +263,8 @@ i386_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)&regs, 0) < 0)
@@ -326,6 +319,11 @@ i386_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused)
retval = 0;
}
+ 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.
OpenPOWER on IntegriCloud