diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/CodeFragmentFactoryContextWrapper.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/CodeFragmentFactoryContextWrapper.java index bc1ca749b6ca..7a709aed4449 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/CodeFragmentFactoryContextWrapper.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/CodeFragmentFactoryContextWrapper.java @@ -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 markupMap = ((XDebugSessionImpl)session).getValueMarkers().getAllMarkers(); + XValueMarkers markers = ((XDebugSessionImpl)session).getValueMarkers(); + Map markupMap = markers != null ? markers.getAllMarkers() : null; //final Map markupMap = ValueDescriptorImpl.getMarkupMap(process); if (markupMap != null && markupMap.size() > 0) { final Pair> markupVariables = createMarkupVariablesText(markupMap); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StackFrameDescriptorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StackFrameDescriptorImpl.java index 2b6f292e0d38..28062f09c3d0 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StackFrameDescriptorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/StackFrameDescriptorImpl.java @@ -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 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; diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java index d416095cfe75..593999ca0755 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java @@ -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();