Reuse ldotcommons get_debugger. Remove duplicated code