using System;
using System.Threading.Tasks;
class C
{
public static void Main() {
var instance = new Instance();
instance.Start().Wait();
}
}
class Instance
{
public static async Task F() { for(var i=0; i<100; i++) { Console.WriteLine(i); await Task.Delay(10); } }
public async Task Start() {
var a = 1;
await F();//<---------Breakpoint
var z = 2;
var x = 3;
}
}
If I place breakpoint at line await F(); and when it hit I click on StepOver execution passes to instance.Start().Wait();. That is caused by side effects of method rewriting that compiler does under the hood. Is it possible to have more userfriendly experience and to continue on var z = 2; instead?
To achieve this I've been looking at ISymUnmanagedAsyncMethod::GetAsyncStepInfo, This method returns an await's return instruction, identifying a potential yield, and breakpointMethod/breakpointOffset pair that tells us where the asynchronous operation will resume. Yet, I cannot get my head around how to integrate it in project.
Consider this program:
If I place breakpoint at line
await F();
and when it hit I click on StepOver execution passes toinstance.Start().Wait();
. That is caused by side effects of method rewriting that compiler does under the hood. Is it possible to have more userfriendly experience and to continue onvar z = 2;
instead?To achieve this I've been looking at ISymUnmanagedAsyncMethod::GetAsyncStepInfo, This method returns an await's return instruction, identifying a potential yield, and breakpointMethod/breakpointOffset pair that tells us where the asynchronous operation will resume. Yet, I cannot get my head around how to integrate it in project.
Any thoughts on this?