Skip to content

[wasm][debugger] Stepping out of an async method doesn't return to the call site #42421

Closed

Description

@radical

Failing test (not added to the repo yet):

        [Fact]
        public async Task StepOutOfAsyncMethod()
        {
            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", "TestAsyncStepOut2", 2);
                await EvaluateAndCheck(
                    "window.setTimeout(function() { invoke_static_method_async('[debugger-test] DebuggerTests.AsyncStepClass:TestAsyncStepOut'); }, 1);",
                    "dotnet://debugger-test.dll/debugger-async-step.cs", 21, 12,
                    "MoveNext");

                await StepAndCheck(StepKind.Out, source_file, 15, 4, "TestAsyncStepOut");
            });
        }

Stepping out, should pause at line 16 in the code below.

        public static async Task TestAsyncStepOut()
15:        {
16:            await TestAsyncStepOut2("foobar");
        }

        public static async Task<int> TestAsyncStepOut2(string some)
        {
            var resp = await client.GetAsync("http://localhost:9400/debugger-driver.html");
            Console.WriteLine($"resp: {resp}"); /// BP at this line

            return 10;
        }

@thaystg this test is on top of your #42299

Activity

  1. added
    untriaged
    on Sep 18, 2020
  2. removed
    untriaged
    on Sep 18, 2020
  3. thaystg commented on Sep 18, 2020

    @thaystg
    Member

    One question, can we merge #42299 and then fix this or should we fix this on #42299?

  4. self-assigned this
    on Sep 18, 2020
  5. radical commented on Sep 18, 2020

    @radical
    MemberAuthor

    This can be done separately.

  6. added this to the 5.0.0 milestone on Sep 22, 2020
  7. thaystg commented on Sep 25, 2020

    @thaystg
    Member

    @radical and @lewing the problem here is that we don't have a way to configure "step into external code"
    image
    as we have in Vs4Mac and VSWin, and our default is Step Into External Code, that is the reason why we are breaking on NotifyDebuggerOfWaitCompletionIfNecessary and not on TestAsyncStepOut as you expect.
    If you enable Step Into External Code on VS4Mac and run the same program, the step out will stop in NotifyDebuggerOfWaitCompletionIfNecessary as in WASM Debugger.
    What should we do? Change our default to not step into external code? Create the configuration and talk to VS guys and explain them how they can pass this information for us?

  8. lewing commented on Sep 25, 2020

    @lewing
    Member

    Are these settings communicated to the js debugger and how is that done?

    cc @captainsafia

  9. lewing commented on Sep 27, 2020

    @lewing
    Member

    @thaystg how difficult is the change assuming we know the setting?

  10. thaystg commented on Sep 27, 2020

    @thaystg
    Member

    I think it's easy, like 4 hours to implement, I'm planning to implement it on monday morning.

  11. added a commit that references this issue on Sep 28, 2020
    6108eb9
  12. 7 remaining items

  13. lewing commented on Jul 26, 2022

    @lewing
    Member

    Do we have a tracking issue for all the settings we would like to be able to read from vs?

  14. thaystg commented on Jul 27, 2022

    @thaystg
    Member

    No, but as far as I remember we have issues that should be fixed having these three parameters.

    • Just My Code.
    • Auto evaluate properties.
    • Symbol server configuration.
  15. thaystg commented on Aug 12, 2022

    @thaystg
    Member

    I'll move it to 8.0 as we didn't get the approval for the vscode-js-debug extension.
    The PR on vscode-js-debug side: microsoft/vscode-js-debug#1311

  16. modified the milestones: 7.0.0, 8.0.0 on Aug 12, 2022
  17. lewing commented on Jul 21, 2023

    @lewing
    Member

    @thaystg can we get a status update here soon?

  18. thaystg commented on Jul 22, 2023

    @thaystg
    Member

    Sure, I'll work on it on Monday :)

  19. modified the milestones: 8.0.0, 9.0.0 on Jul 24, 2023
  20. added a commit that references this issue on Jul 24, 2023
  21. ghost added
    in-pr
    on Jul 24, 2023
  22. ghost removed
    in-pr
    on Jul 26, 2023
  23. ghost locked as resolved and limited conversation to collaborators on Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-Debugger-mono

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions