Skip to content

Change "Step Back" to use "RestartFrame" #2171

Closed

Description

@DanTup

Turns out the DAP has a message for RestartFrame, and using StepBack for this wasn't necessary:

microsoft/vscode-debugadapter-node#43

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    in debuggingRelates to the debug adapter or process of running debug sessions
    on Dec 12, 2019
  2. added this to the v3.8.0 milestone on Dec 12, 2019
  3. nbros commented on Dec 15, 2019

    @nbros

    VS Code v1.41 also has a new inline action in the call stack view that seems like a good place to put this action:
    restart frame
    https://code.visualstudio.com/updates/v1_41#_restart-frame-as-an-inline-action-in-the-call-stack-view

  4. DanTup commented on Dec 17, 2019

    @DanTup
    MemberAuthor

    It was that release note that made me realise I'd used the wrong thing 😄 I believe by moving it to use the correct request, it will automatically appear here :-)

  5. nbros commented on Dec 20, 2019

    @nbros

    Good 🙂
    Would that allow restarting from any selected frame even the current one? Currently the "Step Back" command seems to restart from the parent frame instead of the current frame, with confusing results when the top method in the stack is async (the whole stack changes instead of just the top frame when stepping back through an async gap).

  6. DanTup commented on Dec 20, 2019

    @DanTup
    MemberAuthor

    Would that allow restarting from any selected frame even the current one?

    Yep!

    Currently the "Step Back" command seems to restart from the parent frame instead of the current frame

    Hmm, I'm not sure this would change. Currently we send Rewind with no frame offset which means it defaults to 1, which is the lowest value allowed (see docs). In my testing, it moved you up a frame, but such that "step into" would go back into the function you were previously in?

    confusing results when the top method in the stack is async (the whole stack changes instead of just the top frame when stepping back through an async gap)

    I'm not sure I understand what you mean, butI suspect this feature is acting upon the real stack rather than the "async stack" we show (which is simplified to make async code easier to understand).

  7. nbros commented on Dec 20, 2019

    @nbros

    Thank you for your explanation, I hadn't realized that the Step Back action was rewinding to the call site in the parent frame instead of the beginning of the current frame.

    I'm not sure I understand what you mean, but I suspect this feature is acting upon the real stack rather than the "async stack" we show (which is simplified to make async code easier to understand).

    That is a good explanation, thanks!

  8. DanTup commented on Dec 23, 2019

    @DanTup
    MemberAuthor

    I've changed this over and it now works from the calls stack. However, the thing mentioned above is weird (you can only restart parent frames) and trying to do it on the current frame fails because Rewind doesn't support restarting from the current stack frame. VS Code also fails to render the error (I've opened microsoft/vscode#87605) so this failure is currently silent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions