Date: Sun, 4 Dec 2011 18:43:09 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r228261 - head/usr.bin/truss Message-ID: <201112041843.pB4Ih92H098404@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Dec 4 18:43:09 2011 New Revision: 228261 URL: http://svn.freebsd.org/changeset/base/228261 Log: Use explicit information from the kernel to detect the traps due to syscall entry and leave. Based on submision by: Dan Nelson <dnelson allantgroup com> MFC after: 1 month Modified: head/usr.bin/truss/setup.c Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Sun Dec 4 16:33:04 2011 (r228260) +++ head/usr.bin/truss/setup.c Sun Dec 4 18:43:09 2011 (r228261) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112041843.pB4Ih92H098404>