diff options
Diffstat (limited to 'main/src/addins/MonoDevelop.HexEditor')
-rw-r--r-- | main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Rendering/TextEditorMargin.cs | 2 | ||||
-rw-r--r-- | main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs | 19 |
2 files changed, 13 insertions, 8 deletions
diff --git a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Rendering/TextEditorMargin.cs b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Rendering/TextEditorMargin.cs index 4a376c3fea..da22d92f36 100644 --- a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Rendering/TextEditorMargin.cs +++ b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Rendering/TextEditorMargin.cs @@ -71,7 +71,7 @@ namespace Mono.MHex.Rendering for (int i = 0; i < lineBytes.Length; i++) { byte b = lineBytes[i]; char ch = (char)b; - if (b < 128 && (Char.IsLetterOrDigit (ch) || Char.IsPunctuation (ch))) { + if (!char.IsControl (ch)) { sb.Append (ch); } else { sb.Append ("."); diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs index 002444879c..9ea23c4739 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs @@ -81,12 +81,16 @@ namespace MonoDevelop.HexEditor public override Widget GetVisualizerWidget (ObjectValue val) { - hexEditor = new Mono.MHex.HexEditor (); + var options = DebuggingService.DebuggerSession.EvaluationOptions.Clone (); + options.AllowTargetInvoke = true; + options.ChunkRawStrings = true; IBuffer buffer = null; + hexEditor = new Mono.MHex.HexEditor (); + if (val.TypeName != "string") { - var raw = (RawValueArray) val.GetRawValue (); + var raw = (RawValueArray) val.GetRawValue (options); switch (val.TypeName) { case "sbyte[]": @@ -100,10 +104,7 @@ namespace MonoDevelop.HexEditor break; } } else { - var ops = DebuggingService.DebuggerSession.EvaluationOptions.Clone (); - ops.ChunkRawStrings = true; - - buffer = new RawStringBuffer ((RawValueString) val.GetRawValue (ops)); + buffer = new RawStringBuffer ((RawValueString) val.GetRawValue (options)); } hexEditor.HexEditorData.Buffer = buffer; @@ -119,13 +120,17 @@ namespace MonoDevelop.HexEditor public override bool StoreValue (ObjectValue val) { + var options = DebuggingService.DebuggerSession.EvaluationOptions.Clone (); + options.AllowTargetInvoke = true; + switch (val.TypeName) { case "byte[]": // HACK: make sure to load the full byte stream... long length = hexEditor.HexEditorData.Length; + hexEditor.HexEditorData.GetBytes (length - 1, 1); - val.SetRawValue (hexEditor.HexEditorData.Bytes); + val.SetRawValue (hexEditor.HexEditorData.Bytes, options); return true; default: return false; |