Implement debug_task