summaryrefslogtreecommitdiffstats
path: root/usr.bin/truss/ia64-fbsd.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/ia64-fbsd.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/ia64-fbsd.c')
-rw-r--r--usr.bin/truss/ia64-fbsd.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/truss/ia64-fbsd.c b/usr.bin/truss/ia64-fbsd.c
index 471e834..70140b6 100644
--- a/usr.bin/truss/ia64-fbsd.c
+++ b/usr.bin/truss/ia64-fbsd.c
@@ -204,13 +204,6 @@ ia64_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"))) {
@@ -230,9 +223,6 @@ ia64_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;
@@ -254,6 +244,8 @@ ia64_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) {
@@ -293,6 +285,10 @@ ia64_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.
OpenPOWER on IntegriCloud