void (VirtualMachine vm) { if (!isInInitialState()) { LOG.error("State is invalid " + myState.get()); } DebuggerManagerThreadImpl.assertIsManagerThread(); myPositionManager = new CompoundPositionManager(new PositionManagerImpl(this)); myProject.getMessageBus().connect(myDisposable).subscribe(ModuleRootListener.TOPIC, new ModuleRootListener() { @Override public void rootsChanged(@NotNull final ModuleRootEvent event) { DumbService.getInstance(myProject).runWhenSmart( () -> getManagerThread().schedule(PrioritizedTask.Priority.HIGH, () -> { myPositionManager.clearCache(); DebuggerSession session = mySession; if (session != null && session.isAttached()) { DebuggerUIUtil.invokeLater(() -> session.refresh(true)); } })); } }); LOG.debug("*******************VM attached******************"); vm.setDebugTraceMode(getTraceMask()); checkVirtualMachineVersion(vm); myVirtualMachineProxy = new VirtualMachineProxyImpl(this, vm); }