-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add documentation for WSL #626
Conversation
* [Visual Studio Code](https://code.visualstudio.com) + Microsoft C/C++ extension for VSCode. | ||
|
||
## How-To | ||
To debug, commands will be routed from Windows through `bash.exe` to setup debugging. Because our extension runs as a 32-bit process, it will need to use the `C:\Windows\SysNative` folder to access the executable that is normally in `C:\Windows\System32`. We will be using the `"pipeTransport"` ability within the extension to do debugging and `"sourceFileMap"` to map the source from the subsystem's paths back to Windows path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which executable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bash.exe . I'll add that in.
Do we want to include anything about configuration of I included the following in mine:
@bitcrazed pointed out that this could theoretically be risky. One alternative could be to tell users to copy header files from /usr/include to a location outside of the lxss folder and use that for the includePath, but the problem there is that header updates won't get automatically pulled through. I've stuck with the original solution for now though. |
@timsneath Thanks for the info. I work on the debugging experience but hopefully @bobbrow @ronglums @sean-mcmanus can chime in. Are there plans for additional instructions/configurations from a Language Server standpoint that you will be providing to help this experience? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments enclosed...
@@ -0,0 +1,88 @@ | |||
# Windows 10's Windows Subsystem for Linux | |||
With the release of Windows 10 Creator's Update, you will now be able to use Visual Studio Code and the Microsoft C/C++ extension to debug your `Windows Subsystem for Linux (WSL)` Bash on Ubuntu projects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the official name is "Windows 10 Creators Update" (no apostrophe) - see https://blogs.windows.com/buildingapps/2017/04/05/windows-10-creators-update-creators-update-sdk-released/ for an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
## Prerequisites | ||
* [Windows 10 Creator's Update with Windows Subsystem for Linux and Bash.](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) | ||
* Install g++/gcc and gdb to allow compiling and debugging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In WSL, right? Not in Windows? Probably want to make that really clear. Perhaps worth calling out sudo apt get build-essential
as the right command to get stuff set up, unless you think the audience will already know all this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added WSL
to the sentence. The command you provided isn't correct but i'll add something in regards to using the package manager to install tools.
To debug, commands will be routed from Windows through `bash.exe` to setup debugging. Because our extension runs as a 32-bit process, it will need to use the `C:\Windows\SysNative` folder to access the `bash.exe` executable that is normally in `C:\Windows\System32`. We will be using the `"pipeTransport"` ability within the extension to do debugging and `"sourceFileMap"` to map the source from the subsystem's paths back to Windows path. | ||
|
||
**NOTE: Applications will need to be compiled in the `Windows Subsystem for Linux (WSL)` prior to debugging.** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth a link back to https://code.visualstudio.com/Docs/editor/debugging so users who aren't familiar with launch.json and debugging in Visual Studio Code in general have a point of reference...? This page also explains how to create a launch.json and the various elements contained within it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timsneath This isn't a tutorial but an addition of documentation within our repo for debugging. As such, I'm assuming that the user knows launch.json
} | ||
``` | ||
|
||
### Example `launch.json` for Attaching to an Existing Process |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm dumb, but I don't understand when I'd use the latter? This is like Debug / Attach to Process in 'full' VS, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a process already running in Bash on Windows and want to debug it, this is how you do it.
* [Visual Studio Code](https://code.visualstudio.com) + Microsoft C/C++ extension for VSCode. | ||
|
||
## How-To | ||
To debug, commands will be routed from Windows through `bash.exe` to setup debugging. Because our extension runs as a 32-bit process, it will need to use the `C:\Windows\SysNative` folder to access the `bash.exe` executable that is normally in `C:\Windows\System32`. We will be using the `"pipeTransport"` ability within the extension to do debugging and `"sourceFileMap"` to map the source from the subsystem's paths back to Windows path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setup
is used as a verb a few times in this document, but when spelled as one word it is a noun. Replace with set up
(two words)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@robotdad Are you able to shed some light on how VC++ for Linux handles headers & Intellisense? |
For VC Linux support we carry basic IntelliSense for libstdc++, it isn't tailored for any specific Linux system. To get IntelliSense specific to your Linux system you need to copy your include files (or map them to a Windows drive etc.) and give that local path to VS to parse them. That's described here |
🍺 to Marc for NOT instructing users to copy files from %localappdata%\lxss Using [p]scp to copy files from Linux is a MUCH better bet. |
@bobbrow @caslan @rajkumar42 @ronglums Please review