-
Notifications
You must be signed in to change notification settings - Fork 858
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
Cannot debug C++ program in Visual Studio Code installed within WSL #3679
Comments
Sad face... I was able to reproduce this on 18282 with VSCode 1.29.1 and vscode-cpptools 0.20.1. Ref vscode-cpptools/1408 I'll look more when I get a chance (big ask, no promises). [ed] Circular-ref vscode-cpptools#2870 which is probably where most the action will happen until I get a handle on what changed. |
The fine details of the cause of the debuggee failing to launch aren't known just yet, but cutting to the chase it isn't a WSL bug. WSL is just doing what it is told, and there is no actionable. Work-around for now is to use an earlier version of vscode-cpptools, which isn't trivial because VSCode insists on auto-updating by default. You want your I'll hold this tracker open for a while until we can say what version of VSCode and/or vscode-cpptools it gets addressed. Ref vscode-cpptools#2842. Folks are seeing a variation of this on Real Linux™ as well.
|
Nah. Two weeks since OP is long enough, and this one will just go chirping crickets since no WSL actionable. If I find further work-around on typical Ubuntu-on-WSL installs I'll post a follow up, but there is no WSL system actionable (for now anyway) so closing. This is tag linux-behavior or external depending on how you look at it. Going with the latter arbitrarily. |
The issue causing Note that the debugger can still fail to launch if you have chosen If you want the external console, you'll need the steps posted earlier:
That is, VS Code needs to be started in a dbus session, otherwise when VS Code tries to launch the [ed] There are also some configuration knobs you can tweak if you'd prefer a different external terminal console. The magic
If you'd prefer to avoid the That's about a wrap on this one. Hopefully the VS Code folks can improve the diagnostics a little, but failing to have a |
Tested on WSL in Windows 10 1803 and 1809 with Ubuntu 16.04 and Ubuntu 18.04 installed from Microsoft Store.
Installed Ubuntu desktop using:
sudo apt install ubuntu-desktop
sudo apt install compizconfig-settings-manager
Use VcXsr and MobaXterm for displaying GUI for applications.
VS Code GUI starts correctly, I have installed Microsoft's plugin for C++ development and have correctly set my configure files to debug C++ program (gdb is working correctly in bash in WSL).
When I click "Debug" button, VS Code cannot hit the break-point nor will the program (to be debugged) start. VS Code UI gives no error message but keeps waiting endlessly for debugging to start. Same configuration is working correctly in a native Ubuntu VM.
When I start VS Code using "code --verbose", I have noticed the following messages:
[6776:1121/190140.924349:ERROR:bus.cc(395)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
Have no idea whether this debug problem have something to do with the above error.
Interestingly, VS Code running in WSL can debug Python programs without a problem.
The text was updated successfully, but these errors were encountered: