Skip to content

Commit 0aec667

Browse files
committed
CorDebug Checking for aborted state in CorMethodCall
1 parent 5db72cd commit 0aec667

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Mono.Debugging.Win32/CorMethodCall.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ void DoProcessEvalFinished (CorEvalEventArgs evalArgs, bool isException)
4040
return;
4141
context.Session.OnEndEvaluating ();
4242
evalArgs.Continue = false;
43-
tcs.TrySetResult(new OperationResult<CorValue> (evalArgs.Eval.Result, isException));
43+
if (aborted) {
44+
tcs.TrySetCanceled ();
45+
}
46+
else {
47+
tcs.TrySetResult(new OperationResult<CorValue> (evalArgs.Eval.Result, isException));
48+
}
4449
}
4550

4651
void SubscribeOnEvals ()
@@ -69,6 +74,7 @@ public override string Description
6974
}
7075

7176
readonly TaskCompletionSource<OperationResult<CorValue>> tcs = new TaskCompletionSource<OperationResult<CorValue>> ();
77+
bool aborted = false;
7278
const int DelayAfterAbort = 500;
7379

7480
protected override void AfterCancelledImpl (int elapsedAfterCancelMs)
@@ -108,6 +114,7 @@ protected override Task<OperationResult<CorValue>> InvokeAsyncImpl (Cancellation
108114
protected override void CancelImpl ( )
109115
{
110116
eval.Abort ();
117+
aborted = true;
111118
}
112119
}
113120
}

0 commit comments

Comments
 (0)