Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

"debug test" with an already launched debugging session #1707

Unanswered
GLabat asked this question in Help
Discussion options

Hi all.

We have been using the VSCode Go extension (congrats for the integration) for several years now and for a couple of months, an issue impacts our debugging workflow.
We did not find any related issue on the subject and we are looking for advices here.

We use the following debugging pattern:

  • start a debug session defined in launch.json
  • use the mighty "debug test" to debug a specific test function which requires the previously started debug session

Whereas it used to work (not sure exactly when it stops working), we now get the following error message ‘Debug session has already been started’.

As a (painful) workaround, we use the following pattern:

  • add a breakpoint on the first line of the test function
  • click on "debug test"
  • when the breakpoint is reached, start the debug session from launch.json
  • continue debugging

Since this works, since the "compounds" section of launch.json also works, there seems to be no limitation in debugging several processes at the same time.

After a quick search, the culprit code seems to be located in

if (vscode.debug.activeDebugSession) {
vscode.commands.registerCommand('go.debug.cursor', (args) => {
			if (vscode.debug.activeDebugSession) {
				vscode.window.showErrorMessage('Debug session has already been started');
				return;
			}
			const goConfig = getGoConfig();
			testAtCursor(goConfig, 'debug', args);
		})

The final question is: why is the vscode.debug.activeDebugSession flag taken into account when locally debugging a specific test?

A local build of the extension without the test on vscode.debug.activeDebugSession seems to be fine.

Should there be a better place to ask, please redirect me to it!
Thanks.

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

That check was added as a workaround for #109 (microsoft/vscode-go#1383). Ability to use multiple debugging sessions is cool. I think more correct way to handle the original issue is to address only this specific case (debug session started with the test codelens).

You must be logged in to vote
2 replies
Comment options

Filed #1710

Comment options

Thanks for the analyse and issue @hyangah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /