diff options
author | Alan McGovern <alan@xamarin.com> | 2014-09-08 19:02:52 +0400 |
---|---|---|
committer | Alan McGovern <alan@xamarin.com> | 2014-09-08 19:07:13 +0400 |
commit | ece7fad1964f45650b6350cb603d9cda5462fec8 (patch) | |
tree | 70ac27b3c7e9a2601913945e16e9e0f4fc1d0509 /main/src/addins/MonoDevelop.HexEditor | |
parent | 4263095256092824de66299fd505d9fe0bf98ac1 (diff) | |
parent | 53a1cba36671954c46ae00d33cfe65bcaa97edcc (diff) |
Merge remote-tracking branch 'origin/master' into xs6
Conflicts:
main/external/xwt
version-checks
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; |