Skip to content

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

@DanTup

Description

@DanTup

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

Metadata

Metadata

Assignees

Labels

debugDebug viewlet, configurations, breakpoints, adapter issuesunder-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions