From owner-freebsd-current@FreeBSD.ORG Wed Feb 8 00:59:14 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 939F91065694 for ; Wed, 8 Feb 2012 00:59:14 +0000 (UTC) (envelope-from dmitrym@juniper.net) Received: from exprod7og119.obsmtp.com (exprod7og119.obsmtp.com [64.18.2.16]) by mx1.freebsd.org (Postfix) with ESMTP id 2A00C8FC15 for ; Wed, 8 Feb 2012 00:59:13 +0000 (UTC) Received: from P-EMHUB03-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob119.postini.com ([64.18.6.12]) with SMTP ID DSNKTzHI0r7jwVf1VE20nsELYPn1DlNthNM7@postini.com; Tue, 07 Feb 2012 16:59:14 PST Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB03-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Tue, 7 Feb 2012 16:58:06 -0800 Received: from [172.24.26.191] (dmitrym-lnx.jnpr.net [172.24.26.191]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q180w5134008; Tue, 7 Feb 2012 16:58:05 -0800 (PST) (envelope-from dmitrym@juniper.net) Message-ID: <4F31C89C.7010705@juniper.net> Date: Tue, 7 Feb 2012 16:58:04 -0800 From: Dmitry Mikulin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111229 Thunderbird/9.0 MIME-Version: 1.0 References: <20120125074824.GD2726@deviant.kiev.zoral.com.ua> <4F2094B4.70707@juniper.net> <20120126122326.GT2726@deviant.kiev.zoral.com.ua> <4F22E8FD.6010201@juniper.net> <20120129074843.GL2726@deviant.kiev.zoral.com.ua> <4F26E0D1.8040100@juniper.net> <20120130192727.GZ2726@deviant.kiev.zoral.com.ua> <4F2C756A.80900@juniper.net> <20120204204218.GC3283@deviant.kiev.zoral.com.ua> <4F3043E2.6090607@juniper.net> <20120207121022.GC3283@deviant.kiev.zoral.com.ua> <4F318D74.9030506@juniper.net> In-Reply-To: <4F318D74.9030506@juniper.net> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e4081efb-6d29-443c-8708-750833aec629 X-Mailman-Approved-At: Wed, 08 Feb 2012 02:18:25 +0000 Cc: Konstantin Belousov , freebsd-current Current , Marcel Moolenaar Subject: Re: [ptrace] please review follow fork/exec changes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 00:59:14 -0000 Well, that didn't work... Not sure why since it broke existing gdb. My guess is we're not getting the exec stops we used to get. Might have to wait till tomorrow to get more details. On 02/07/2012 12:45 PM, Dmitry Mikulin wrote: > > >> So, do you in fact need to distinguish exec stops from syscall exit >> against exec stops from PT_FOLLOW_EXEC, > > This is pretty much what I need. It's the same stop in syscall return right? I don't want to change when the stop happens, I want to have an lwpinfo flag that tells me when a stop occurred in a process under PT_FOLLOW_EXEC. > >> @@ -889,7 +890,9 @@ exec_fail_dealloc: >> >> if (error == 0) { >> PROC_LOCK(p); >> - td->td_dbgflags |= TDB_EXEC; >> + if ((p->p_flag& P_TRACED) != 0&& >> + ((P_FOLLOWEXEC) != 0 || (p->p_stops& S_PT_SCX) != 0)) >> + td->td_dbgflags |= TDB_EXEC; >> PROC_UNLOCK(p); > > There's a small bug in the patch that makes it not work. The check for P_FOLLOWEXEC should be: > > + ((p->p_flag& P_FOLLOWEXEC) != 0 || (p->p_stops& S_PT_SCX) != 0)) > > > Looks like the patch should work for me but I need to verify.