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

Debug should resolve symbolic links for breakpoints #78443

Closed
JoshuaFox opened this issue Aug 4, 2019 · 13 comments
Closed

Debug should resolve symbolic links for breakpoints #78443

JoshuaFox opened this issue Aug 4, 2019 · 13 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues *duplicate Issue identified as a duplicate of another issue(s)
Milestone

Comments

@JoshuaFox
Copy link

JoshuaFox commented Aug 4, 2019

A breakpoint works when set on the exact same line in one VS Code tab but not in another.

There seem to be two ways of opening a Javascript file, and if the full path appears in the tab, then breakpoints work.

But if the filename only appears in the tab header, then breakpoints all become Unverified (gray; disabled) during execution.

image

If you open using CTRL-P, then both variants are usually available.
image

VS Code 1.36.1, Node 8.16.0, running Mocha tests.

@IllusionMH
Copy link
Contributor

Looks like VSCode can't map your project files to files that are reported by node.

Do you have proper values for runtimeArgs, cwd, outFiles etc. for your scenario?
https://github.com/Microsoft/vscode-recipes has recipes for different cases (including Mocha)

@JoshuaFox
Copy link
Author

Note also that the two variants of each file are treated separately in the debugger, as if they are different files. In this screenshot, each breakpoint was set in the different variant, and as you see the first is disabled.
image

@JoshuaFox
Copy link
Author

JoshuaFox commented Aug 5, 2019

  VSCode can't map your project files to files that are reported by node.

Right, but sometimes it can, as described.

runtimeArgs, cwd, outFiles

In launch.jsonruntimeArgs was OK.

  • cwd was not there, but adding the literal  path (or ${workspaceFolder} makes no difference.
  • As to outFiles, there is no transpilation, but in any case, adding the workspace folder as outFiles makes no difference.
{
	"version": "0.2.0",
	"configurations": [
		{
			"type": "node",
			"request": "launch",
			"name": "Launch via NPM",
			"runtimeExecutable": "npm",
			"runtimeArgs": [
				"run-script",
				"debugTest"
			],
			"port": 9229,
                        //cwd makes no difference, whether as literal or as variable.
			"cwd": "/full-workspace-path",
                        //outFiles likewise makes no difference.
			"outFiles": [ "${workspaceFolder}" ]

		}
		
   ]
}

@isidorn
Copy link
Contributor

isidorn commented Aug 5, 2019

Looks like a duplicate of #12448
Assigning to @weinand and @bpasero to potentially close as duplicates

@JoshuaFox
Copy link
Author

JoshuaFox commented Aug 5, 2019 via email

@IllusionMH
Copy link
Contributor

@isidorn not sure if this one is related to #12448

@JoshuaFox try use configurations from recipe for mocha instead of launching npm script.

It still looks more like a question than actual issue with VSCode.

@JoshuaFox
Copy link
Author

JoshuaFox commented Aug 5, 2019 via email

@bpasero
Copy link
Member

bpasero commented Aug 5, 2019

It is easy to find out if this is #12448 by going to each tab and copying the full absolute path (from the context menu) and then comparing the 2 paths for differences.

@bpasero bpasero added the info-needed Issue requires more information from poster label Aug 5, 2019
@JoshuaFox
Copy link
Author

JoshuaFox commented Aug 5, 2019 via email

@bpasero bpasero removed their assignment Aug 5, 2019
@isidorn
Copy link
Contributor

isidorn commented Aug 6, 2019

This sounds like a feature reuqest that we should resolve symbolic links for breakpoints. Which we do not do atm.
I do not have this on my plan to tackle this, thus assigning to backlog.

@isidorn isidorn added debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Aug 6, 2019
@isidorn isidorn added this to the Backlog milestone Aug 6, 2019
@isidorn isidorn changed the title Breakpoints are disabled depending on whether the full path of the file appears in the tab title Debug should resolve symbolic links for breakpoints Aug 6, 2019
@JoshuaFox
Copy link
Author

JoshuaFox commented Aug 6, 2019 via email

@weinand
Copy link
Contributor

weinand commented Aug 6, 2019

VS Code cannot provide symbolic link support for breakpoints by itself. It is the underlying runtime that has to support symbolic links.

In case of node.js you can enable this by adding a flag.
See https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_can-i-debug-if-im-using-symlinks for details

And there is a discussion here: #57954.

/duplicate #57954

@vscodebot vscodebot bot added the *duplicate Issue identified as a duplicate of another issue(s) label Aug 6, 2019
@vscodebot
Copy link

vscodebot bot commented Aug 6, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Aug 6, 2019
@weinand weinand removed the feature-request Request for new features or functionality label Aug 6, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

5 participants