From owner-freebsd-toolchain@FreeBSD.ORG Mon Apr 16 04:55:55 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35197106566C for ; Mon, 16 Apr 2012 04:55:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A6A9D8FC08 for ; Mon, 16 Apr 2012 04:55:54 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q3G4tpoT099733; Mon, 16 Apr 2012 07:55:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q3G4tp5v080671; Mon, 16 Apr 2012 07:55:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q3G4tpZ2080670; Mon, 16 Apr 2012 07:55:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 16 Apr 2012 07:55:51 +0300 From: Konstantin Belousov To: Dmitry Mikulin Message-ID: <20120416045551.GZ2358@deviant.kiev.zoral.com.ua> References: <4F8737E9.6010300@juniper.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JvcmYpkcIfvRd+Gm" Content-Disposition: inline In-Reply-To: <4F8737E9.6010300@juniper.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: toolchain@freebsd.org Subject: Re: gdb support for follow-fork X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2012 04:55:55 -0000 --JvcmYpkcIfvRd+Gm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 12, 2012 at 01:15:37PM -0700, Dmitry Mikulin wrote: > Hi, >=20 > I implemented support for follow-fork mode in gdb and would like to submi= t=20 > it for a review. The feature allows users to specify which process to=20 > follow when the inferior does a fork(). The default mode is to stay with= =20 > the parent. A gdb command is used to switch between following the=20 > child/parent: >=20 > set follow-fork-mode child > set follow-fork-mode parent >=20 > When gdb is set to follow the child, it detaches from the parent at the= =20 > fork() point and continues to trace the newly created child. >=20 > Gdb uses support that has recently been implemented in the FreeBSD kernel= .=20 > A new ptrace() request, PT_FOLLOW_FORK was added to generate a SIGTRAP at= =20 > the point where a child process is created. This allows gdb switch from= =20 > parent to child. PT_FOLLOW_EXEC was added to SIGTRAP on return from exit(= )=20 > to allow gdb to load a new binary for debugging. >=20 > I attached the patch here. > Please let me know if can provide additional info. Yes, could you, please, split the patch somewhat ? It would be much easier to review if you were able to provide relatively small pieces with descriptions. --JvcmYpkcIfvRd+Gm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+LplYACgkQC3+MBN1Mb4jKIACfQPHnrrTi5ROomB2yR776Vmy8 bJcAoNFL61TdqVkVw4nizSSLgZK185Om =HiE6 -----END PGP SIGNATURE----- --JvcmYpkcIfvRd+Gm--