Move debugger management logic in the core