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

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

--eHhjakXzOLJAF9wJ
Content-Type: text/plain; charset=iso-8859-9
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Kostik Belousov yazm=FD=FE:
> 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 t=
he
> > 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
>=20
> There is already procfs(5)-based interface to get a reason for stop.
> Look at the ioctl PIOCSTATUS. Yes, you have to mount procfs.
>=20
> The interface can be lifted to ptrace(2), but I think using the capacity
> of procfs is not wrong there.

Thanks, although not optimal, this solution works for me :-)

--=20
Regards,
Ali Polatel

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iEYEABECAAYFAkvleX0ACgkQQU4yORhF8iBWCQCfUPIsE9xqRSqBtmrrTZxkOlPG
CgMAoJG2R79OMaqlPRPIVXaypQ1WhMwz
=pjdd
-----END PGP SIGNATURE-----

--eHhjakXzOLJAF9wJ--



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