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

DAP ContinuedEvent with allThreadsContinued=true causes selected debug session to change #128744

Open
DanTup opened this issue Jul 15, 2021 · 8 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues under-discussion Issue is under discussion for relevance, priority, approach
Milestone

Comments

@DanTup
Copy link
Contributor

DanTup commented Jul 15, 2021

When sending a ContinuedEvent with allThreadsContinued=true, the selected debug session resets to the first one. This does not happen without allThreadsContinued=true.

Jul-15-2021 12-44-08

To repro:

  • Clone MockDebug
  • Add response.body.supportsRestartRequest = true; in initializeRequest
  • Implement a restartRequest that sends a ContinuedEvent with allThreadsContinued=true:
    protected async restartRequest(response: DebugProtocol.RestartResponse, args: DebugProtocol.RestartArguments) {
    	this.sendResponse(response);
    	this.sendEvent(new ContinuedEvent(0, true));
    }
  • Run the project
  • Create a second launch config:
    "configurations": [
    	{
    		"type": "mock",
    		"request": "launch",
    		"name": "Debug readme.md 1",
    		"program": "${workspaceFolder}/readme.md",
    		"stopOnEntry": true,
    		"trace": false
    	},
    	{
    		"type": "mock",
    		"request": "launch",
    		"name": "Debug readme.md 2",
    		"program": "${workspaceFolder}/readme.md",
    		"stopOnEntry": true,
    		"trace": false
    	}
    ]
  • Start both launch configurations (this can be done one at a time)
  • Select the second debug session in the debug toolbar
  • Click the Restart button
  • Note that the dropdown has reverted to the first session
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jul 15, 2021
@weinand weinand removed their assignment Jul 15, 2021
@weinand weinand added the bug Issue identified by VS Code Team member as probable bug label Jul 15, 2021
@isidorn isidorn added this to the August 2021 milestone Jul 27, 2021
@isidorn
Copy link
Contributor

isidorn commented Aug 11, 2021

@DanTup I pushed a potential fix for this. Can you please try it out with VS Code insiders from tomorrow? thank you very much!

@isidorn isidorn added the info-needed Issue requires more information from poster label Aug 11, 2021
@DanTup
Copy link
Contributor Author

DanTup commented Aug 12, 2021

@isidorn did the Insiders build today get delayed? I still see the issue, but it looks like current insiders is still only 7c25c17 from around 36 hours ago.

@isidorn
Copy link
Contributor

isidorn commented Aug 13, 2021

@DanTup I am not sure if that insiders had my fix. If it is not a problem can you try it with today's insiders (which I am sure has my change)?

@DanTup
Copy link
Contributor Author

DanTup commented Aug 23, 2021

@isidorn sorry for the delay, I've been OOO. Unfortunately this still repros in:

Version: 1.60.0-insider
Commit: 44568e5947efa4811419e529e80fb14b7554cf61
Date: 2021-08-23T10:42:53.526Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.6.0

Aug-23-2021 16-20-19

@isidorn
Copy link
Contributor

isidorn commented Aug 23, 2021

No problem, let's reopen and I can investigate

@isidorn isidorn reopened this Aug 23, 2021
@isidorn isidorn removed the info-needed Issue requires more information from poster label Aug 23, 2021
@isidorn
Copy link
Contributor

isidorn commented Aug 26, 2021

I can reproduce following your steps. And I actually think this behaviour is fine.
The problem is that Season A sends a continued event and then we pass focus to session B. This is expected, if season A was stopped in the meantime we would not pass focus. Moving out of milestone since we will not change anything here this week, and assigning to @roblourens since he now owns Debug UI.

Code pointer for focus passing https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/debug/browser/debugSession.ts#L1002

@isidorn isidorn modified the milestones: August 2021, Backlog Aug 26, 2021
@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 26, 2021
@isidorn isidorn assigned roblourens and unassigned isidorn Aug 26, 2021
@DanTup
Copy link
Contributor Author

DanTup commented Aug 30, 2021

I'm not sure I understand. The behaviour differs between allThreadsContinued=true and allThreadsContinued=false even though that doesn't make any difference to any behaviour here. Also some of the debug toolbar functionality (restart, stop, hot reload) does not require a stopped session, so changing the active session when using them based on whether the session was stopped or not seems odd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

5 participants
@roblourens @DanTup @weinand @isidorn and others