Skip to content

Commit 2d9d402

Browse files
committed
Handling exceptions in OnRun() before ForceExit, because otherwise the session is ended and the exception may be ignored.
1 parent 2c1ca37 commit 2d9d402

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Mono.Debugging/Mono.Debugging.Client/DebuggerSession.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,10 @@ public void Run (DebuggerStartInfo startInfo, DebuggerSessionOptions options)
328328
try {
329329
OnRun (startInfo);
330330
} catch (Exception ex) {
331+
// should handle exception before raising Exit event because HandleException may ignore exceptions in Exited state
332+
var exceptionHandled = HandleException (ex);
331333
ForceExit ();
332-
if (!HandleException (ex))
334+
if (!exceptionHandled)
333335
throw;
334336
}
335337
});

0 commit comments

Comments
 (0)