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

Updating breakpoint from debug adapter does not work if another session is focused #80014

Closed
dgozman opened this issue Aug 28, 2019 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues help wanted Issues identified as good community contribution opportunities verified Verification succeeded

Comments

@dgozman
Copy link
Contributor

dgozman commented Aug 28, 2019

When implementing Debug Adapter Protocol, I sometimes issue breakpoints event where breakpoints change the verified status from false to true. If that happens while another debugging session is current (focused), the update is ignored.

I think the problem is in this line. Here idFromAdapter depends on currently focused debugging session, which may or may not be the one receiving the event.

Steps to reproduce:

  • Use this modified version of vscode-mock-debug.
  • Run the mock debug extension on testWorkspace folder included in the branch above.
  • Set breakpoint in the session2.md file on the line with "lazy".
  • Launch "Bug" configuration.
  • Two scenarios
    • If you select "Session2" during first 5 seconds, breakpoint on the "lazy" line will be verified after 5 seconds (Session2 will emit "breakpoint changed" DAP event).
    • If you don't select "Session2" during first 5 seconds (e.g. do nothing, Session1 will be focused by default), the breakpoint will not be verified, and switching between sessions afterwards does not help.
@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues bug Issue identified by VS Code Team member as probable bug labels Aug 28, 2019
@isidorn isidorn added under-discussion Issue is under discussion for relevance, priority, approach and removed bug Issue identified by VS Code Team member as probable bug labels Aug 29, 2019
@isidorn
Copy link
Contributor

isidorn commented Aug 29, 2019

@dgozman your analysis is correct. That line is the issue and should look at the id from the recieving session, not from the focussed session.
This is not a regression, thus I plan to fix this next milestone.
Also I am open to a PR which fixes this since you already nicely found the root cause.

Proposed fix: idFromAdapter should be a real method and not a getter. This method needs to be passed in a sessionId so it is not dependent on the focused session.

@isidorn isidorn added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities and removed under-discussion Issue is under discussion for relevance, priority, approach labels Aug 29, 2019
@isidorn isidorn added this to the September 2019 milestone Aug 29, 2019
dgozman added a commit to dgozman/vscode that referenced this issue Aug 29, 2019
@isidorn isidorn mentioned this issue Aug 30, 2019
@isidorn isidorn closed this as completed in 54b3b7f Sep 2, 2019
isidorn added a commit that referenced this issue Sep 2, 2019
@roblourens roblourens added the verified Verification succeeded label Oct 3, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 17, 2019
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 help wanted Issues identified as good community contribution opportunities verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants