diff options
author | Arseny Chernyaev <arseny.chernyaev@jetbrains.com> | 2017-02-07 14:59:50 +0300 |
---|---|---|
committer | Artem Bukhonov <Artem.Bukhonov@jetbrains.com> | 2017-03-11 21:23:25 +0300 |
commit | 285bf950d81bc47a5fd034d148d87e8b9a961117 (patch) | |
tree | 7dfeab0fbcf00f45bf5822f5b3f76a60032cdab6 /main/src/addins/MonoDevelop.Debugger.Win32 | |
parent | 1c6ce95c7ce42e90d70889132e57ee8deaf03fdd (diff) |
implemented OnException handler
(cherry picked from commit c5583ba)
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.Win32')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs index f103652ffb..ba4dafa67c 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs +++ b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs @@ -270,6 +270,7 @@ namespace Mono.Debugging.Win32 corProcess.OnEvalException += OnEvalException;
corProcess.OnLogMessage += OnLogMessage;
corProcess.OnException2 += OnException2;
+ corProcess.OnException += OnException;
corProcess.RegisterStdOutput (OnStdOutput);
}
@@ -821,6 +822,32 @@ namespace Mono.Debugging.Win32 }
}
+ private void OnException (object sender, CorExceptionEventArgs e)
+ {
+ lock (debugLock) {
+ if (evaluating) {
+ e.Continue = true;
+ return;
+ }
+ }
+
+ TargetEventArgs args = new TargetEventArgs (
+ e.Unhandled? TargetEventType.UnhandledException: TargetEventType.ExceptionThrown);
+
+ OnStopped ();
+ e.Continue = false;
+ // If an exception is thrown while stepping, cancel the stepping operation
+ if (stepper != null && stepper.IsActive ())
+ stepper.Deactivate ();
+ autoStepInto = false;
+ SetActiveThread (e.Thread);
+
+ args.Process = GetProcess (process);
+ args.Thread = GetThread (e.Thread);
+ args.Backtrace = new Backtrace (new CorBacktrace (e.Thread, this));
+ OnTargetEvent (args);
+ }
+
public bool IsExternalCode (string fileName)
{
if (string.IsNullOrWhiteSpace (fileName))
|