From 99585cd4be38915b1ca7201db259c84cd6e7b32d Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Sun, 31 Jan 2016 15:20:49 +0100 Subject: [PATCH] CPP-5661 When debugger reports an error during evaluation or variable collection, it should be reported in UI --- .../testSrc/com/intellij/xdebugger/XDebuggerTestUtil.java | 8 +++++++- .../testSrc/com/intellij/xdebugger/XTestValueNode.java | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestUtil.java b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestUtil.java index 7d98cf9b03a2..eee3e5c65cfc 100644 --- a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestUtil.java +++ b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestUtil.java @@ -28,11 +28,11 @@ import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.testFramework.UsefulTestCase; +import com.intellij.util.ui.TextTransferable; import com.intellij.util.ui.UIUtil; import com.intellij.xdebugger.breakpoints.*; import com.intellij.xdebugger.evaluation.XDebuggerEvaluator; import com.intellij.xdebugger.frame.*; -import com.intellij.xdebugger.frame.XNamedValue; import com.intellij.xdebugger.impl.XDebugSessionImpl; import com.intellij.xdebugger.impl.breakpoints.XBreakpointUtil; import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl; @@ -117,6 +117,12 @@ public class XDebuggerTestUtil { throws InterruptedException { return collectStacks(thread == null ? getActiveThread(session) : thread); } + + public static String getFramePresentation(XStackFrame frame) { + TextTransferable.ColoredStringBuilder builder = new TextTransferable.ColoredStringBuilder(); + frame.customizePresentation(builder); + return builder.getBuilder().toString(); + } public static List collectStacks(@NotNull XExecutionStack thread) throws InterruptedException { return collectStacks(thread, TIMEOUT * 2); diff --git a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XTestValueNode.java b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XTestValueNode.java index 45ad3306831a..ea4684e69d8b 100644 --- a/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XTestValueNode.java +++ b/platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XTestValueNode.java @@ -11,6 +11,7 @@ import javax.swing.*; import java.util.concurrent.Semaphore; public class XTestValueNode extends XValueNodePresentationConfigurator.ConfigurableXValueNodeImpl { + public Icon myIcon; public String myName; public String myType; public String myValue; @@ -24,6 +25,7 @@ public class XTestValueNode extends XValueNodePresentationConfigurator.Configura public void applyPresentation(@Nullable Icon icon, @NotNull XValuePresentation valuePresentation, boolean hasChildren) { + myIcon = icon; myType = valuePresentation.getType(); myValue = XValuePresentationUtil.computeValueText(valuePresentation); myHasChildren = hasChildren;