diff options
author | Michael Belyaev <usrsse2@me.com> | 2019-04-12 21:22:57 +0300 |
---|---|---|
committer | Jeffrey Stedfast <jestedfa@microsoft.com> | 2019-05-28 18:26:39 +0300 |
commit | df1cf4116f0a26342acb8558a5a2175a2a2bf80c (patch) | |
tree | a839e2a2be116ea312a5d5333eaa51e587c2e8ea /main/src/addins | |
parent | eb4f62cf4df627575d789f3c9399740be63f56dc (diff) |
Workaround for .NET Core debugger which doesn't support exception type filtering
Diffstat (limited to 'main/src/addins')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs | 9 |
1 files changed, 9 insertions, 0 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 be1189696e..9f68233ec9 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 @@ -39,6 +39,7 @@ using MonoDevelop.Core; using MonoDevelop.Core.Execution; using MonoFunctionBreakpoint = Mono.Debugging.Client.FunctionBreakpoint; using VsCodeFunctionBreakpoint = Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Messages.FunctionBreakpoint; +using System.Text.RegularExpressions; namespace MonoDevelop.Debugger.VsCodeDebugProtocol { @@ -314,6 +315,8 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol return sb.ToString(); } + private static readonly Regex VsdbgExceptionNameRegex = new Regex ("Exception thrown: '(.*)' in .*"); + protected void HandleEvent (object sender, EventReceivedEventArgs obj) { Task.Run (() => { @@ -351,6 +354,12 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol args = new TargetEventArgs (TargetEventType.TargetStopped); break; case StoppedEvent.ReasonValue.Exception: + var match = VsdbgExceptionNameRegex.Match (body.Text); + if (match.Success && match.Groups.Count == 2 && !breakpoints.Select (b => b.Key).OfType<Catchpoint> ().Any (e => e.Enabled && match.Groups[1].Value == e.ExceptionName)) + { + OnContinue (); + return; + } args = new TargetEventArgs (TargetEventType.ExceptionThrown); break; default: |