Debugging Linux Version in WSL using Visual Studio Code - hyvanmielenpelit/GnollHack GitHub Wiki
Overview
You can install the Linux version of GnollHack to Windows Subsystem for Linux and then debug it using these instructions.
Installing Visual Studio Code for Debugging
Visual Studio Code on Windows.
1. Install2. In WSL
Type code
in WSL to install vscode server in Ubuntu.
3. In Windows VS Code
- Install Remote – WSL Extension.
- Install C/C++ Extension (for Debugging) for your user
- Open remote GnollHack folder on WSL side
- Start Debug should work if GnollHack is compiled
- Close VS Code
4. In WSL (open in Windows by typing wsl, if not already open)
Set root password in WSL by
sudo –i
passwd
5. In Windows Command Prompt
Change default user to root by typing ubuntu2004 config --default-user root
.
6. In Windows VS Code
-
Open VS Code
-
Open GnollHack remote location in WSL (opens automatically due to step 4, or if not, open from green toolbar box in left bottom corner):
-
This should install vs code server for root
-
Install C/C++ Extension (for Debugging in VS Code) for root. The end result in Extensions window: