How do I return to the caller of a task? #652
Replies: 1 comment
-
|
with async/await you don’t “return to the caller” like a normal stack frame. The compiler turns your method into a state machine and schedules a continuation that resumes wherever the UniTask/Task is awaited. So after you step over return, the debugger jumps to whatever continuation gets picked up next — which often looks random. How to actually find the caller/continuation:
Tiny repro & how I debug it
Why the jump looks random Practical tips
Hope that clears it up — you don’t step back to a caller; you navigate to the awaiting site via the async stack or UniTask Tracker. If you want, I can attach screenshots of Parallel Stacks / Tracker with a tiny sample. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I put a breakpoint on a return statement of an async method, and step over, execution jumps to a seemingly random place in the code. How do I find the location of the caller of the currently executing task?
Beta Was this translation helpful? Give feedback.
All reactions