Update frames UI when thread is stopped

(cherry picked from commit 55b11b468d)
(cherry picked from commit c6f80510d2)
This commit is contained in:
Aleksandr Eliseev
2025-12-04 13:24:10 +04:00
committed by Nikita Iarychenko
parent 7109bd9a1f
commit dde28b7cf0

View File

@@ -33,6 +33,8 @@ import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.platform.debugger.impl.shared.proxy.XDebugSessionProxy;
import com.intellij.platform.debugger.impl.ui.XDebuggerEntityConverter;
import com.intellij.psi.PsiElement;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.remote.RemoteSdkException;
@@ -51,13 +53,12 @@ import com.intellij.xdebugger.breakpoints.XBreakpointHandler;
import com.intellij.xdebugger.breakpoints.XBreakpointType;
import com.intellij.xdebugger.breakpoints.XLineBreakpoint;
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
import com.intellij.xdebugger.frame.XCompositeNode;
import com.intellij.xdebugger.frame.XDebuggerTreeNodeHyperlink;
import com.intellij.xdebugger.frame.XExecutionStack;
import com.intellij.xdebugger.frame.XStackFrame;
import com.intellij.xdebugger.frame.XSuspendContext;
import com.intellij.xdebugger.frame.XValueChildrenList;
import com.intellij.xdebugger.frame.XValueNode;
import com.intellij.xdebugger.frame.*;
import com.intellij.xdebugger.impl.XDebugSessionImpl;
import com.intellij.xdebugger.impl.frame.XDebugView;
import com.intellij.xdebugger.impl.frame.XFramesView;
import com.intellij.xdebugger.impl.ui.XDebugSessionTab;
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl;
import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants;
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeEx;
import com.intellij.xdebugger.stepping.XSmartStepIntoHandler;
@@ -1201,6 +1202,28 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
if (breakpoint != null) {
// Hit a breakpoint while already suspended. We have to remember it and stop on this breakpoint later.
myBreakpointHits.add(new BreakpointHitContext(breakpoint, threadInfo.getMessage(), suspendContext));
} else {
XDebugSession session = getSession();
if (!(session instanceof XDebugSessionImpl sessionImpl)) {
// If possible (it is XDebugSessionImpl, which currently is only implementation of XDebugSession),
// we want to rebuild only frames view
// But just in case, if in the future there is other implementation,
// we rebuild all debug views
session.rebuildViews();
return;
}
XDebugSessionTab tab = sessionImpl.getSessionTab();
if (tab == null) {
return;
}
XFramesView framesView = tab.getFramesView();
if (framesView == null) {
return;
}
XDebugSessionProxy sessionProxy = XDebuggerEntityConverter.asProxy(sessionImpl);
framesView
.processSessionEvent(XDebugView.SessionEvent.SETTINGS_CHANGED, sessionProxy);
}
}
}