Centralize ptrace helpers in Task.