[debugger] fixed unreliable reattach

GitOrigin-RevId: dc3e58ea976675707fad555f5a52bee13f6b51e4
This commit is contained in:
Egor Ushakov
2020-10-06 12:03:27 +03:00
committed by intellij-monorepo-bot
parent 94c43871f0
commit f5e103d264
2 changed files with 7 additions and 18 deletions

View File

@@ -2005,6 +2005,10 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
}
public void reattach(final DebugEnvironment environment) {
reattach(environment, () -> {});
}
public void reattach(final DebugEnvironment environment, Runnable vmReadyCallback) {
if (!myIsStopped.get()) {
getManagerThread().schedule(new DebuggerCommandImpl() {
@Override
@@ -2026,6 +2030,7 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
myConnection = environment.getRemoteConnection();
getManagerThread().restartIfNeeded();
createVirtualMachine(environment);
vmReadyCallback.run();
});
}
});