Date: Tue, 7 Feb 2012 12:45:40 -0800 From: Dmitry Mikulin <dmitrym@juniper.net> To: Konstantin Belousov <kostikbel@gmail.com> Cc: freebsd-current Current <freebsd-current@freebsd.org>, Marcel Moolenaar <marcelm@juniper.net> Subject: Re: [ptrace] please review follow fork/exec changes Message-ID: <4F318D74.9030506@juniper.net> In-Reply-To: <20120207121022.GC3283@deviant.kiev.zoral.com.ua> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F318D74.9030506>