New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The coroutine states in the debugger are inaccurate when starts are undispatched #4058
Comments
I am not exactly sure what the desired behaviour is. First things first, let's figure out "undispatched" coroutines behaviour:
For the
while for
No matter the nesting statuses decision, the
If this is the root cause of our stepping problem, then we can agree this is a bug and fix it. But, if the problem lies in the fact that we have two nested running coroutines in the same thread, then this is uncharted territory where we'll have to find some solution because, depending on the angle you are looking at that, the outer coroutine might or might not be |
Fixes #4058 Additional small fix: the coroutine context injected by `probeCoroutineCreated` is used for `CoroutineStart.UNDISPATCHED` even before the first suspension.
Fixes #4058 Additional small fix: the coroutine context injected by `probeCoroutineCreated` is used for `CoroutineStart.UNDISPATCHED` even before the first suspension.
Undispatched starts of coroutines (with
CoroutineStart.UNDISPATCHED
or unconfined dispatchers(sorry, I myself got confused)) confuse the debugger.At point
A
, we'll see that the outer coroutine is considered to be running, whereas the inner coroutine is only "created" and doesn't even have a stacktrace associated with it.This is not that big of an issue when browsing the list of running coroutines: we'll see that someone executes
A
, it's not a big deal that the slightly incorrect coroutine is doing that. When introducing stepping, this becomes a problem: given a breakpoint atA
, we need a reliable way to say "run toB
in the same coroutine." When the coroutine machinery thinks thatA
is executed by the outer coroutine, this becomes impossible.Previous discussion: #3987 (comment)
The text was updated successfully, but these errors were encountered: