Messages in this thread | | | Subject | Re: Allow debuger to examine real parent | From | Mike Coleman <> | Date | 09 Mar 2000 13:03:59 -0600 |
| |
Jamie Lokier <lk@tantalophile.demon.co.uk> writes: > Pavel Machek wrote: > > - p->pid, p->p_pptr->pid, > > + p->pid, p->p_opptr->pid, p->p_pptr->pid != p->p_opptr->pid ? p->p_opptr->pid : 0, > > I think you should compare p->p_pptr and p->p_opptr to check for a > tracer, not the pid values. Because the pid values can be the same even > when there's a tracer: > > - the real parent is tracing its child; or > > - someone used CLONE_PID
This is a good point, but in the case where the real parent is tracing, won't p->p_pptr == p->p_opptr anyway?
If the new field is going to be called 'Tracer', it should probably always give a pid if the child is being traced. So, the above line would turn into something like
+ p->pid, p->p_opptr->pid, + p->p_pptr != p->p_opptr && p->flags & (PF_PTRACED|PF_TRACESYS) ? p->p_pptr->pid : 0,
Alternatively, the new field would just be 'OriginalPPID' and always spit out p->p_opptr->pid. This would be a little less useful, though.
--Mike
-- Any sufficiently adverse technology is indistinguishable from Microsoft.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |