Test:
[Fact]
public async Task BreakOnAwaitThenStepOverToNextAwaitCall()
{
var insp = new Inspector();
//Collect events
var scripts = SubscribeToScripts(insp);
await Ready();
await insp.Ready(async (cli, token) =>
{
ctx = new DebugTestContext(cli, insp, token, scripts);
string source_file = "dotnet://debugger-test.dll/debugger-async-step.cs";
await SetBreakpointInMethod("debugger-test.dll", "DebuggerTests.AsyncStepClass", "MethodWithTwoAwaitsAsync", 2);
await EvaluateAndCheck(
"window.setTimeout(function() { invoke_static_method_async('[debugger-test] DebuggerTests.AsyncStepClass:StepOverTestAsync'); }, 1);",
"dotnet://debugger-test.dll/debugger-async-step.cs", 53, 12,
"MoveNext");
await StepAndCheck(StepKind.Over, source_file, 54, 12, "MoveNext");
});
}
This fails with:
---- Assert.Equal() Failure
↓ (pos 50)
Expected: ···ugger-async-step.cs#47#12
Actual: ···ugger-async-step.cs#16707565#-1
The reason is that the location on the call frame is garbage:
"location": {
"scriptId": "dotnet://501_4",
"lineNumber": 16707565,
"columnNumber": -1
},
.. though the functionLocation is correct:
"functionLocation": {
"scriptId": "dotnet://501_4",
"lineNumber": 45,
"columnNumber": 8
},
This is the full call frame, for reference:
{
"functionName": "MoveNext",
"callFrameId": "dotnet:scope:1",
"functionLocation": {
"scriptId": "dotnet://501_4",
"lineNumber": 45,
"columnNumber": 8
},
"location": {
"scriptId": "dotnet://501_4",
"lineNumber": 16707565,
"columnNumber": -1
},
"url": "file:///Users/radical/dev/r3/src/mono/wasm/debugger/tests/debugger-async-step.cs",
"scopeChain": [
{
"type": "local",
"object": {
"type": "object",
"className": "Object",
"description": "Object",
"objectId": "dotnet:scope:1"
},
"name": "MoveNext",
"startLocation": {
"scriptId": "dotnet://501_4",
"lineNumber": 45,
"columnNumber": 8
},
"endLocation": {
"scriptId": "dotnet://501_4",
"lineNumber": 16707565,
"columnNumber": -1
}
}
]
}
This test is based on @thaystg's #42299
Test:
This fails with:
The reason is that the
locationon the call frame is garbage:.. though the
functionLocationis correct:This is the full call frame, for reference:
This test is based on @thaystg's #42299