Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DanTup opened this issue Dec 12, 2019 · 6 comments
Closed

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

DanTup opened this issue Dec 12, 2019 · 6 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session is enhancement
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Dec 12, 2019

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

microsoft/vscode-debugadapter-node#43

@DanTup DanTup added is enhancement in debugger Relates to the debug adapter or process of launching a debug session labels Dec 12, 2019
@DanTup DanTup added this to the v3.8.0 milestone Dec 12, 2019
@nbros
Copy link

nbros commented Dec 15, 2019

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

@DanTup
Copy link
Member Author

DanTup commented Dec 17, 2019

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 :-)

@nbros
Copy link

nbros commented Dec 20, 2019

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).

@DanTup
Copy link
Member Author

DanTup commented Dec 20, 2019

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).

@nbros
Copy link

nbros commented Dec 20, 2019

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!

@DanTup DanTup closed this as completed in caa7fb3 Dec 23, 2019
@DanTup
Copy link
Member Author

DanTup commented Dec 23, 2019

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
Labels
in debugger Relates to the debug adapter or process of launching a debug session is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants