diff options
author | Keting Yang <ketyang@microsoft.com> | 2020-01-06 19:54:25 +0300 |
---|---|---|
committer | Keting Yang <ketyang@microsoft.com> | 2020-01-06 19:54:25 +0300 |
commit | 4cd87f9b4be9e105089fbaa8e5493d9d9ae56493 (patch) | |
tree | 3f4a6cfa25da52db718f9bc6dbd4a113af2b7d5e /main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol | |
parent | 646c822be1860ea4cc5d690008f8f2ff0bf2ac03 (diff) |
avoid using string to check the exception type
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs | 6 |
1 files changed, 4 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 bc56c02ac5..0432d0aa52 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 @@ -168,7 +168,7 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol currentExceptionState = hasCustomExceptions; var exceptionRequest = new SetExceptionBreakpointsRequest ( Capabilities.ExceptionBreakpointFilters.Where (f => hasCustomExceptions || (f.Default ?? false)).Select (f => f.Filter).ToList ()); - exceptionRequest.ExceptionOptions = new List<ExceptionOptions> () { new ExceptionOptions (ExceptionBreakMode.Unhandled)}; + exceptionRequest.ExceptionOptions = new List<ExceptionOptions> () {new ExceptionOptions(ExceptionBreakMode.UserUnhandled)}; protocolClient.SendRequest (exceptionRequest, null); unhandleExceptionRegistered = true; } @@ -352,6 +352,7 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol return string.IsNullOrWhiteSpace (catchpoint.ConditionExpression) || EvaluateCondition (frameId, catchpoint.ConditionExpression) != false; } + protected void HandleEvent (object sender, EventReceivedEventArgs obj) { Task.Run (() => { @@ -408,7 +409,8 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol // It's OK to evaluate expressions in external code stackFrame = (VsCodeStackFrame)backtrace.GetFrame (0); } - if (body.Text.Contains (GettextCatalog.GetString ("but was not handled in user code"))){ + var response = protocolClient.SendRequestSync (new ExceptionInfoRequest (body.ThreadId ?? -1)); + if (response.BreakMode.Equals (ExceptionBreakMode.UserUnhandled)) { args = new TargetEventArgs (TargetEventType.UnhandledException); } else { if (!breakpoints.Select (b => b.Key).OfType<Catchpoint> ().Any (c => ShouldStopOnExceptionCatchpoint (c, stackFrame.frameId))) { |