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

Breakpoints stay on their original line number (do not follow statements) when code is edited during a debug run #56398

Closed
mawright opened this issue Aug 14, 2018 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@mawright
Copy link

I reported this bug to the vscode-python repo but was referred upstream to the core vscode repo. My example below is in Python but a Microsoft dev on vscode-python confirmed it also affects the native Typescript debugger: microsoft/vscode-python#2389

  • VSCode Version: 1.26.0, and 1.27.0-insider
  • OS Version: Ubuntu 16.04

Behavior

When lines are added/removed in the source code while a debug run is active (i.e., when paused at a breakpoint), all breakpoints stay at their line number and are not moved up or down as lines are added or removed. This means that when the debug run is relaunched, any breakpoints below added/removed lines will be on a different statement than when they were created.
This also means that the behavior of how breakpoints move is different between whether you are editing code while debugging or not. During normal operation, breakpoints move with their statements. During debugging, breakpoints stay in place.

Expected Behavior

If code is edited during debugging, breakpoints follow their original statement (moving down 1 line for each line inserted above and up 1 line for each line deleted above) after the debug run is ended.

Steps to Reproduce:

  1. Non-debug behavior: Breakpoint moves with its original statement c = 3
    works_nondebug
  2. Debug behavior: The statement c = 3 begins at line 5, is moved down two lines, but the breakpoint stays at line 5, even after the debug run is completed.
    doesntwork_debug

Does this issue occur when all extensions are disabled?: N/A, since I can't run my Python test without the Python extension. However I tested it on the insiders build with the only installed extension being Python and it still happened.

@isidorn isidorn added bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels Aug 15, 2018
@isidorn isidorn added this to the Backlog milestone Aug 15, 2018
@isidorn isidorn modified the milestones: Backlog, August 2018 Aug 22, 2018
@t-brieger
Copy link

little addition: it happens on break points in any language, not only python.

@isidorn
Copy link
Contributor

isidorn commented Aug 24, 2018

You can try out the fix in tomorrow's insiders and let me know if it is ok now. Thank you

@miguelsolorio miguelsolorio added the verified Verification succeeded label Aug 30, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants