Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Apr 2012 07:55:51 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Dmitry Mikulin <dmitrym@juniper.net>
Cc:        toolchain@freebsd.org
Subject:   Re: gdb support for follow-fork
Message-ID:  <20120416045551.GZ2358@deviant.kiev.zoral.com.ua>
In-Reply-To: <4F8737E9.6010300@juniper.net>
References:  <4F8737E9.6010300@juniper.net>

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

[-- Attachment #1 --]
On Thu, Apr 12, 2012 at 01:15:37PM -0700, Dmitry Mikulin wrote:
> Hi,
> 
> I implemented support for follow-fork mode in gdb and would like to submit 
> it for a review. The feature allows users to specify which process to 
> follow when the inferior does a fork(). The default mode is to stay with 
> the parent. A gdb command is used to switch between following the 
> child/parent:
> 
> set follow-fork-mode child
> set follow-fork-mode parent
> 
> When gdb is set to follow the child, it detaches from the parent at the 
> fork() point and continues to trace the newly created child.
> 
> Gdb uses support that has recently been implemented in the FreeBSD kernel. 
> A new ptrace() request, PT_FOLLOW_FORK was added to generate a SIGTRAP at 
> the point where a child process is created. This allows gdb switch from 
> parent to child. PT_FOLLOW_EXEC was added to SIGTRAP on return from exit() 
> to allow gdb to load a new binary for debugging.
> 
> 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.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (FreeBSD)

iEYEARECAAYFAk+LplYACgkQC3+MBN1Mb4jKIACfQPHnrrTi5ROomB2yR776Vmy8
bJcAoNFL61TdqVkVw4nizSSLgZK185Om
=HiE6
-----END PGP SIGNATURE-----

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