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:
authorJeffrey Stedfast <jestedfa@microsoft.com>2020-01-16 19:33:26 +0300
committerMatt Ward <ward.matt@gmail.com>2020-01-20 13:32:30 +0300
commit6451621fdc215c712bbf19a3dbdf1b335c3a42e6 (patch)
treee4c5e88665f5056bf905335ff88cbc6a12890520 /main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol
parentdd49233341410b9eb5e04b53301615a7b5a39221 (diff)
[Debugger] Fixed VSCodeDebuggerSession to avoid KeyNotFoundException when updating breakpoints
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/960963
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol')
-rw-r--r--main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs14
1 files changed, 9 insertions, 5 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 ff06cef278..23c4ac9e3b 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
@@ -537,12 +537,16 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol
Condition = b.ConditionExpression,
HitCondition = GetHitCondition(b)
}).ToList ()
- }, (obj) => {
+ }, (args) => {
Task.Run (() => {
- for (int i = 0; i < obj.Breakpoints.Count; i++) {
- breakpoints [sourceFile.ElementAt (i)].SetStatus (obj.Breakpoints [i].Line != -1 ? BreakEventStatus.Bound : BreakEventStatus.NotBound, "");
- if (obj.Breakpoints [i].Line != sourceFile.ElementAt (i).OriginalLine)
- breakpoints [sourceFile.ElementAt (i)].AdjustBreakpointLocation (obj.Breakpoints [i].Line, obj.Breakpoints [i].Column ?? 1);
+ for (int i = 0; i < args.Breakpoints.Count; i++) {
+ var breakpoint = sourceFile.ElementAt (i);
+
+ if (breakpoints.TryGetValue (breakpoint, out var breakInfo)) {
+ breakInfo.SetStatus (args.Breakpoints[i].Line != -1 ? BreakEventStatus.Bound : BreakEventStatus.NotBound, "");
+ if (args.Breakpoints[i].Line != breakpoint.OriginalLine)
+ breakInfo.AdjustBreakpointLocation (args.Breakpoints[i].Line, args.Breakpoints[i].Column ?? 1);
+ }
}
}).Ignore ();
});