Debugging on Windows Subsystem for Linux

On Windows 10 and later, you can run and debug Linux applications locally, if you have the Windows System for Linux (WSL), also referred to as Bash for Windows, installed.

If the WSL is found, you will see that instead of "Windows PC", the CrossBox device picker will show an entry called "Windows PC w/ Linux Sub-system". Select this item to run your Linux apps locally.

  • Installing Windows Subsystem for Linux for use with Water on Windows

In addition to installing the WLS itself, you also need to install the gdbserver tool on Linux; if you fail to do so, your debug session will fail with an error message to that effect. You can install gdbserver by opening a "Bash" command prompt window from the Start menu, and running the following command in it:

sudo apt-get install gdbserver

Launching

The IDEs will automatically take care of launching your project in the local Linux subsystem, and attaching the debugger, when you run your project.

Debugging

Once your your application is launched, you can debug your code the same as you would any other project. For example, you can set Breakpoints to pause execution when a certain part of your code is hit, and you will automatically "break" into the debugger, if any Exception occurs.

See Also