diff options
author | Jeffrey Stedfast <jestedfa@microsoft.com> | 2019-04-19 16:53:12 +0300 |
---|---|---|
committer | Jeffrey Stedfast <jestedfa@microsoft.com> | 2019-04-22 22:47:00 +0300 |
commit | b1b5d7c1547fea80b9510a79ae96876f41b18579 (patch) | |
tree | a8bf32bfd1dd91ff04c2a936a6888d9c32266e68 /main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol | |
parent | 09999c8f7c974ecf2bd44ad5f5b15ce93e7344cd (diff) |
[Debugger] Fixed An item with the same key has already been added. Key: Mono.Debugging.Client.Breakpoint
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/824644
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs | 20 |
1 files changed, 13 insertions, 7 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 c9e5959fbc..c48f1599d3 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 @@ -104,20 +104,26 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol protected override BreakEventInfo OnInsertBreakEvent (BreakEvent breakEvent) { + BreakEventInfo breakEventInfo; + + if (breakpoints.TryGetValue (breakEvent, out breakEventInfo)) + return breakEventInfo; + + breakEventInfo = new BreakEventInfo (); + if (breakEvent is Mono.Debugging.Client.Breakpoint) { - var breakEventInfo = new BreakEventInfo (); - breakpoints.Add ((Mono.Debugging.Client.Breakpoint)breakEvent, breakEventInfo); + breakpoints.Add (breakEvent, breakEventInfo); UpdateBreakpoints (); - return breakEventInfo; } else if (breakEvent is Catchpoint) { - var catchpoint = (Catchpoint)breakEvent; - var breakEventInfo = new BreakEventInfo (); breakpoints.Add (breakEvent, breakEventInfo); UpdateExceptions (); - return breakEventInfo; + } else { + throw new NotImplementedException (breakEvent.GetType ().FullName); } - throw new NotImplementedException (breakEvent.GetType ().FullName); + + return breakEventInfo; } + bool currentExceptionState = false; void UpdateExceptions () { |