lkml.org 
[lkml]   [2000]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Allow debuger to examine real parent
From
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.088 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site