File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,7 @@ void SetupProcess (CorProcess corProcess)
270
270
corProcess . OnEvalException += OnEvalException ;
271
271
corProcess . OnLogMessage += OnLogMessage ;
272
272
corProcess . OnException2 += OnException2 ;
273
+ corProcess . OnException += OnException ;
273
274
corProcess . RegisterStdOutput ( OnStdOutput ) ;
274
275
}
275
276
@@ -821,6 +822,32 @@ void OnException2 (object sender, CorException2EventArgs e)
821
822
}
822
823
}
823
824
825
+ private void OnException ( object sender , CorExceptionEventArgs e )
826
+ {
827
+ lock ( debugLock ) {
828
+ if ( evaluating ) {
829
+ e . Continue = true ;
830
+ return ;
831
+ }
832
+ }
833
+
834
+ TargetEventArgs args = new TargetEventArgs (
835
+ e . Unhandled ? TargetEventType . UnhandledException : TargetEventType . ExceptionThrown ) ;
836
+
837
+ OnStopped ( ) ;
838
+ e . Continue = false ;
839
+ // If an exception is thrown while stepping, cancel the stepping operation
840
+ if ( stepper != null && stepper . IsActive ( ) )
841
+ stepper . Deactivate ( ) ;
842
+ autoStepInto = false ;
843
+ SetActiveThread ( e . Thread ) ;
844
+
845
+ args . Process = GetProcess ( process ) ;
846
+ args . Thread = GetThread ( e . Thread ) ;
847
+ args . Backtrace = new Backtrace ( new CorBacktrace ( e . Thread , this ) ) ;
848
+ OnTargetEvent ( args ) ;
849
+ }
850
+
824
851
public bool IsExternalCode ( string fileName )
825
852
{
826
853
if ( string . IsNullOrWhiteSpace ( fileName ) )
You can’t perform that action at this time.
0 commit comments