diff options
author | Jeffrey Stedfast <jestedfa@microsoft.com> | 2019-07-24 18:07:32 +0300 |
---|---|---|
committer | Jeffrey Stedfast <jestedfa@microsoft.com> | 2019-07-26 19:38:35 +0300 |
commit | 9662791c2c8f6c9923b4912d6dc63858cae6fe3d (patch) | |
tree | 8d98482206608c38f47637bc5f009305a33cfc66 /main | |
parent | 5471e49d168e83ae9448e9f770210a1602b29ef1 (diff) |
[Debugger] Fixed .NET Core debugger to allow use of SHA256 and MD5 hashes
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/951772
Diffstat (limited to 'main')
2 files changed, 14 insertions, 7 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs index 2e5e08f885..0ed6f75f22 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs +++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs @@ -340,7 +340,7 @@ namespace MonoDevelop.Debugger.Soft TimeBetweenConnectionAttempts = 800, MaxConnectionAttempts = -1, }; - }; + } var dsi = new SoftDebuggerStartInfo (startArgs) { Command = StringParserService.Parse (command), diff --git a/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VsCodeStackFrame.cs b/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VsCodeStackFrame.cs index 09930da9ee..d4bcc54d57 100644 --- a/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VsCodeStackFrame.cs +++ b/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VsCodeStackFrame.cs @@ -58,7 +58,7 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol this.frameId = frame.Id; } - static byte [] HexToByteArray (string hex) + static byte[] HexToByteArray (string hex) { if (hex.Length % 2 == 1) throw new ArgumentException (); @@ -69,14 +69,21 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol return bytes; } - static byte [] GetHashBytes (Source source) + static byte[] GetHashBytes (Source source) { if (source == null) return null; - var checkSum = source.Checksums.FirstOrDefault (c => c.Algorithm == ChecksumAlgorithm.SHA1); - if (checkSum == null) - return null; - return HexToByteArray (checkSum.ChecksumValue); + + foreach (var checksum in source.Checksums) { + switch (checksum.Algorithm) { + case ChecksumAlgorithm.SHA256: + case ChecksumAlgorithm.SHA1: + case ChecksumAlgorithm.MD5: + return HexToByteArray (checksum.ChecksumValue); + } + } + + return null; } public override string FullStackframeText { |