Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 May 2010 15:36:26 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Ali Polatel <alip@exherbo.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Ability to tell the difference between normal and syscall traps
Message-ID:  <20100508123626.GC83316@deviant.kiev.zoral.com.ua>
In-Reply-To: <20100508111509.GB8186@harikalardiyari>
References:  <20100508111509.GB8186@harikalardiyari>

next in thread | previous in thread | raw e-mail | index | archive | help

--JgQwtEuHJzHdouWu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, May 08, 2010 at 02:15:09PM +0300, Ali Polatel wrote:
> Does FreeBSD's ptrace have a way to tell the difference between normal
> traps and those caused by a system call?
>=20
> On Linux? this is possible by passing PTRACE_O_TRACESYSGOOD option to the
> ptrace request PTRACE_SETOPTIONS which makes the kernel set bit 7 in the
> syscall number when delivering system call traps,
> (i.e., deliver (SIGTRAP | 0x80)).
>=20
> I'm not sure if this is possible on FreeBSD. PT_LWPINFO request looks
> related but can't be sure.
>=20
> ?: http://linux.die.net/man/2/ptrace

There is already procfs(5)-based interface to get a reason for stop.
Look at the ioctl PIOCSTATUS. Yes, you have to mount procfs.

The interface can be lifted to ptrace(2), but I think using the capacity
of procfs is not wrong there.

--JgQwtEuHJzHdouWu
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkvlWsoACgkQC3+MBN1Mb4ipZACcDTTw2Zy/whf/WscIEfyCiU35
5+gAoJz9AbZTCeR8KjW5wCJyIpLPJeMO
=arWV
-----END PGP SIGNATURE-----

--JgQwtEuHJzHdouWu--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100508123626.GC83316>