svn commit: r229378 - stable/9/usr.bin/truss
Konstantin Belousov
kib at FreeBSD.org
Tue Jan 3 09:51:35 UTC 2012
Author: kib
Date: Tue Jan 3 09:51:34 2012
New Revision: 229378
URL: http://svn.freebsd.org/changeset/base/229378
Log:
MFC r228261:
Use explicit information from the kernel to detect the traps due to
syscall entry and leave.
Modified:
stable/9/usr.bin/truss/setup.c
Directory Properties:
stable/9/usr.bin/truss/ (props changed)
Modified: stable/9/usr.bin/truss/setup.c
==============================================================================
--- stable/9/usr.bin/truss/setup.c Tue Jan 3 09:46:51 2012 (r229377)
+++ stable/9/usr.bin/truss/setup.c Tue Jan 3 09:51:34 2012 (r229378)
@@ -202,9 +202,19 @@ waitevent(struct trussinfo *info)
find_thread(info, lwpinfo.pl_lwpid);
switch(WSTOPSIG(waitval)) {
case SIGTRAP:
- info->pr_why = info->curthread->in_syscall?S_SCX:S_SCE;
- info->curthread->in_syscall = 1 - info->curthread->in_syscall;
- break;
+ if (lwpinfo.pl_flags & PL_FLAG_SCE) {
+ info->pr_why = S_SCE;
+ info->curthread->in_syscall = 1;
+ break;
+ } else if (lwpinfo.pl_flags & PL_FLAG_SCX) {
+ info->pr_why = S_SCX;
+ info->curthread->in_syscall = 0;
+ break;
+ } else {
+ errx(1,
+ "pl_flags %x contains neither PL_FLAG_SCE nor PL_FLAG_SCX",
+ lwpinfo.pl_flags);
+ }
default:
info->pr_why = S_SIG;
info->pr_data = WSTOPSIG(waitval);
More information about the svn-src-stable-9
mailing list