diff options
author | David Karlaš <david.karlas@xamarin.com> | 2016-05-23 17:26:54 +0300 |
---|---|---|
committer | David Karlaš <david.karlas@xamarin.com> | 2016-05-23 18:55:02 +0300 |
commit | c2fd3ed0be51b21a02cb86a8e1a68655df5f3910 (patch) | |
tree | a9a22c2d2f94ccd8c439b564674956e11abe506a /main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs | |
parent | f10f3278bf3942de9ce0fc4e11c83ed16822cce3 (diff) |
Bug 34197 - Long DebuggerDisplay attribute output always adds ellipsis
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs index dfd2462ca5..c3c203e41b 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs @@ -42,11 +42,14 @@ namespace MonoDevelop.Debugger.PreviewVisualizers public override Control GetVisualizerWidget (ObjectValue val) { + var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone (); + ops.AllowTargetInvoke = true; + ops.ChunkRawStrings = true; + ops.EllipsizedLength = 5000;//Preview window can hold aprox. 4700 chars + val.Refresh (ops);//Refresh DebuggerDisplay/String value with full length instead of ellipsized string value = val.Value; Gdk.Color col = Styles.PreviewVisualizerTextColor.ToGdkColor (); - if (!val.IsNull && (val.TypeName == "string" || val.TypeName == "char[]")) - value = '"' + GetString (val) + '"'; if (DebuggingService.HasInlineVisualizer (val)) value = DebuggingService.GetInlineVisualizer (val).InlineVisualize (val); @@ -78,33 +81,6 @@ namespace MonoDevelop.Debugger.PreviewVisualizers } #endregion - - string GetString (ObjectValue val) - { - var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone (); - ops.AllowTargetInvoke = true; - ops.ChunkRawStrings = true; - if (val.TypeName == "string") { - var rawString = val.GetRawValue (ops) as RawValueString; - var length = rawString.Length; - if (length > 0) { - return Mono.Debugging.Evaluation.ExpressionEvaluator.EscapeString (rawString.Substring (0, Math.Min (length, 4096))); - } else { - return ""; - } - } else if (val.TypeName == "char[]") { - var rawArray = val.GetRawValue (ops) as RawValueArray; - var length = rawArray.Length; - if (length > 0) { - return Mono.Debugging.Evaluation.ExpressionEvaluator.EscapeString (new string (rawArray.GetValues (0, Math.Min (length, 4096)) as char [])); - } else { - return ""; - } - - } else { - throw new InvalidOperationException (); - } - } } } |