[debugger] IDEA-385376 Reset VM on reattach

GitOrigin-RevId: 67e896d747527092b8e16664c0645efbbccd5bb1
This commit is contained in:
Maksim Zuev
2026-01-30 19:53:09 +00:00
committed by intellij-monorepo-bot
parent 83c9f3c881
commit fdd031994d
2 changed files with 5 additions and 2 deletions
@@ -1065,6 +1065,9 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
}
catch (Throwable ignored) {
}
finally {
DebuggerManagerThreadImpl.getCurrentThread().setVmProxy(null);
}
}
var attachedNewThread = unstashAndReattach();
@@ -61,9 +61,9 @@ class DebuggerManagerThreadImpl @ApiStatus.Internal constructor(
get() = _vmProxy.get()
@ApiStatus.Internal
fun setVmProxy(proxy: VirtualMachineProxyImpl) {
fun setVmProxy(proxy: VirtualMachineProxyImpl?) {
val current = vmProxy
if (current != null && current.virtualMachine !== proxy.virtualMachine) {
if (current != null && proxy != null && current.virtualMachine !== proxy.virtualMachine) {
LOG.error("VM proxy changed from $current to $proxy")
}
_vmProxy = WeakReference(proxy)