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

[Feature Request]: Reverse debugging #499

Open
puremourning opened this issue Dec 15, 2021 · 4 comments
Open

[Feature Request]: Reverse debugging #499

puremourning opened this issue Dec 15, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@puremourning
Copy link
Owner

We should support a way to step backwards. I had the idea of a WinBar button which toggles the direction.

@puremourning puremourning added the enhancement New feature or request label Dec 15, 2021
@puremourning
Copy link
Owner Author

puremourning commented Feb 7, 2022

I pushed a branch reverse-debug which containes a prototype for this. It seems to work with CodeLLDB when using rr

https://github.com/vadimcn/vscode-lldb/blob/master/MANUAL.md#reverse-debugging

Note, you must use:

 "request": "launch",
 "custom": true,'
 "reverseDebugging": true

rather than "request": "custom" ; I'm not sure why codelldb uses this wonky mapping in their vscode extension, but the above works (as in the example in the branch https://github.com/puremourning/vimspector/blob/reverse-debug/tests/testdata/cpp/simple/.vimspector.json#L104-L135)

@puremourning
Copy link
Owner Author

Use the new WinBar button (or <plug>VimspectorToggleSteppingDirection to switch between forward and reverse stepping.

Also note that CodeLLDB and indeed dap only implement "reverse step" not "reverse step over" . In practice this means that CodeLLDB steps backward 1 instruction.

In order to step back one line, use the <leader>F10 "run to cursor" mapping and it will run backwards to the cursor.

@phcerdan
Copy link
Contributor

This sounds good @puremourning, any blocker before merging it? If not ready yet, I would love to test it, but please, can I ask you to rebase the reverse-debug branch on top master? I would like to keep latest developments.

@puremourning
Copy link
Owner Author

Feel free to rebase and test yourself. I have no time to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants