From owner-freebsd-hackers Mon Dec 23 1: 6:22 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92E9D37B401 for ; Mon, 23 Dec 2002 01:06:20 -0800 (PST) Received: from nebula.wanadoo.fr (ca-sqy-14-72.abo.wanadoo.fr [80.8.67.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33A8243EDA for ; Mon, 23 Dec 2002 01:06:19 -0800 (PST) (envelope-from dak@wanadoo.fr) Received: from nebula.wanadoo.fr (localhost [127.0.0.1]) by nebula.wanadoo.fr (8.12.6/8.12.6) with ESMTP id gBN96jbu000632; Mon, 23 Dec 2002 10:06:45 +0100 (CET) (envelope-from dak@nebula.wanadoo.fr) Received: (from dak@localhost) by nebula.wanadoo.fr (8.12.6/8.12.6/Submit) id gBN96iKW000631; Mon, 23 Dec 2002 10:06:44 +0100 (CET) Date: Mon, 23 Dec 2002 10:06:44 +0100 From: Aurelien Nephtali To: John Cc: hackers@freebsd.org Subject: Re: Accessing trap frame from userland? Message-ID: <20021223090644.GA615@nebula.wanadoo.fr> References: <20021222183400.GA77934@nebula.wanadoo.fr> <20021223025159.GA27162@BSDWins.Com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <20021223025159.GA27162@BSDWins.Com> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 22, 2002 at 09:51:59PM -0500, John wrote: > After the interupt (from the child issuing a PT_TRACE_ME > ptrace() call, you need to call i386_clr_watch(). >=20 > At this point, you can single step the process using > ptrace(PT_STEP), or by calling i386_set_watch() with > a new address (type DBREG_DR7_EXEC), and then calling > ptrace(PT_CONTINUE). Note: this all assumes you are > getting and putting the debug registers correctly. >=20 > Hope this helps. It's been a while since I've looked > at this stuff... somewhere I've got a sample program > that traces dynamic image loads. If I can find it I'll > hang it off website. >=20 > -john Mmh, that's the method I try to avoid :), according to me it's 'ugly' :) si= nce that need a big if() hack to handle the break issuing from a PT_STEP without mixing it with an user wanted breakpoint. I'd rather trying to access the 'trap frame' if it's possible, otherwise I'll do the single-step-ugly-hack method :) -- Aurelien --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+BtIkDNsbHbt8ok8RAsQlAJ445z3FP+E17+9NEC0XXjWrYj/RHACgnbOa 4Dnmr/e4bP3dWJZJlY/AyfI= =3zVb -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message