> If we want to do this then we'd need to fix up every ptrace> implementation in every architecture to call the appropriate function;> it's a separate problem.

which code relies on having debugged children only in the ->children listand not in the ->ptrace_children list?

> > i'm not sure about this either. What happens if an (untraced) parent has> > traced and untraced children, and does a wait4. Would it confuse the> > debugger if the parent could get one of the traced tasks as a result in> > wait4? And how does the debugger solve this problem?> > Well, it seems to me that when a traced task has an event, it should be> reported first to the debugger - for signals this happens in do_signal -> and then possibly to the normal parent. But I'm not sure if this> actually happens right now or not. Worth investigating some more.

it just cannot happen. There are only two kinds of events passed viawait4: tracing related and exit related. An exiting task is not tracedanymore. And two tasks cannot trace the same task - so it can never happenthat wait4 wants to look at ->ptrace_children for events.