mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
show mark for a stack frame executing a method from marked object
This commit is contained in:
+3
-1
@@ -29,6 +29,7 @@ import com.intellij.util.StringBuilderSpinAllocator;
|
||||
import com.intellij.xdebugger.XDebugSession;
|
||||
import com.intellij.xdebugger.XDebuggerManager;
|
||||
import com.intellij.xdebugger.impl.XDebugSessionImpl;
|
||||
import com.intellij.xdebugger.impl.frame.XValueMarkers;
|
||||
import com.intellij.xdebugger.impl.ui.tree.ValueMarkup;
|
||||
import com.sun.jdi.ObjectCollectedException;
|
||||
import com.sun.jdi.ObjectReference;
|
||||
@@ -77,7 +78,8 @@ public class CodeFragmentFactoryContextWrapper extends CodeFragmentFactory {
|
||||
PsiElement context = originalContext;
|
||||
XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
|
||||
if (session != null) {
|
||||
Map<?, ValueMarkup> markupMap = ((XDebugSessionImpl)session).getValueMarkers().getAllMarkers();
|
||||
XValueMarkers<?, ?> markers = ((XDebugSessionImpl)session).getValueMarkers();
|
||||
Map<?, ValueMarkup> markupMap = markers != null ? markers.getAllMarkers() : null;
|
||||
//final Map<ObjectReference, ValueMarkup> markupMap = ValueDescriptorImpl.getMarkupMap(process);
|
||||
if (markupMap != null && markupMap.size() > 0) {
|
||||
final Pair<String, Map<String, ObjectReference>> markupVariables = createMarkupVariablesText(markupMap);
|
||||
|
||||
+12
-4
@@ -32,7 +32,10 @@ import com.intellij.psi.PsiFile;
|
||||
import com.intellij.ui.FileColorManager;
|
||||
import com.intellij.util.StringBuilderSpinAllocator;
|
||||
import com.intellij.util.ui.TextTransferable;
|
||||
import com.intellij.xdebugger.XDebugSession;
|
||||
import com.intellij.xdebugger.frame.XStackFrame;
|
||||
import com.intellij.xdebugger.impl.XDebugSessionImpl;
|
||||
import com.intellij.xdebugger.impl.frame.XValueMarkers;
|
||||
import com.intellij.xdebugger.impl.ui.tree.ValueMarkup;
|
||||
import com.sun.jdi.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -40,7 +43,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Nodes of this type cannot be updated, because StackFrame objects become invalid as soon as VM has been resumed
|
||||
@@ -146,9 +148,15 @@ public class StackFrameDescriptorImpl extends NodeDescriptorImpl implements Stac
|
||||
@Nullable
|
||||
public ValueMarkup getValueMarkup() {
|
||||
if (myThisObject != null) {
|
||||
final Map<ObjectReference, ValueMarkup> markupMap = getMarkupMap(myFrame.getVirtualMachine().getDebugProcess());
|
||||
if (markupMap != null) {
|
||||
return markupMap.get(myThisObject);
|
||||
DebugProcess process = myFrame.getVirtualMachine().getDebugProcess();
|
||||
if (process instanceof DebugProcessImpl) {
|
||||
XDebugSession session = ((DebugProcessImpl)process).getSession().getXDebugSession();
|
||||
if (session instanceof XDebugSessionImpl) {
|
||||
XValueMarkers<?, ?> markers = ((XDebugSessionImpl)session).getValueMarkers();
|
||||
if (markers != null) {
|
||||
return markers.getAllMarkers().get(myThisObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -345,6 +345,7 @@ public class XDebugSessionImpl implements XDebugSession {
|
||||
.showRunContent(DefaultDebugExecutor.getDebugExecutorInstance(), descriptor);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public synchronized XValueMarkers<?, ?> getValueMarkers() {
|
||||
if (myValueMarkers == null) {
|
||||
XValueMarkerProvider<?, ?> provider = myDebugProcess.createValueMarkerProvider();
|
||||
|
||||
Reference in New Issue
Block a user