Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornosami <jasonimison@gmail.com>2019-04-08 14:50:48 +0300
committernosami <jasonimison@gmail.com>2019-04-08 14:50:48 +0300
commit15e0c5e3f15ec1be52345257521cc857f69a3628 (patch)
treea29dd803ae71ae33801947aeb275f04e26e8ebe6 /main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol
parent1e57fb28e048e268ad88b4585acaa60591c06891 (diff)
Add support for .NET Core breakpoint hit count
Fixes VSTS #802065
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol')
-rw-r--r--main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs b/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs
index 395bb8ebe1..c9e5959fbc 100644
--- a/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs
+++ b/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs
@@ -366,6 +366,22 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol
List<string> pathsWithBreakpoints = new List<string> ();
+ static readonly Dictionary<HitCountMode, string> conditions = new Dictionary<HitCountMode, string> {
+ { HitCountMode.EqualTo, "=" },
+ { HitCountMode.GreaterThan, ">" },
+ { HitCountMode.GreaterThanOrEqualTo, ">=" },
+ { HitCountMode.LessThan, "<" },
+ { HitCountMode.LessThanOrEqualTo, "<=" },
+ { HitCountMode.MultipleOf, "%" }};
+
+ string GetHitCondition (Mono.Debugging.Client.Breakpoint breakpoint)
+ {
+ if (breakpoint.HitCountMode == HitCountMode.None)
+ return null;
+
+ return conditions [breakpoint.HitCountMode] + breakpoint.HitCount;
+ }
+
void UpdateBreakpoints ()
{
var bks = breakpoints.Select (b => b.Key).OfType<Mono.Debugging.Client.Breakpoint> ().Where (b => b.Enabled && !string.IsNullOrEmpty (b.FileName)).GroupBy (b => b.FileName).ToArray ();
@@ -396,8 +412,8 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol
Breakpoints = sourceFile.Select (b => new SourceBreakpoint {
Line = b.OriginalLine,
Column = b.OriginalColumn,
- Condition = b.ConditionExpression
- //TODO: HitCondition = b.HitCountMode + b.HitCount, wait for .Net Core Debugger
+ Condition = b.ConditionExpression,
+ HitCondition = GetHitCondition(b)
}).ToList ()
}, (obj) => {
Task.Run (() => {