Search code examples
windows-subsystem-for-linuxclion

CLion WSL Debugging is not working on Windows 10


enter image description here

enter image description here

enter image description here

I can execute my project on WSL(Ubuntu 22.04 LTS) but I can't debug my project. CLion is installed on Windows 10.

Error message is as below.

com.jetbrains.cidr.execution.debugger.backend.gdb.GDBDriver$GDBCommandException: Warning:
Cannot insert breakpoint 3.
Cannot access memory at address 0x806be6e

Process finished with exit code -1

I'm looking forward your wise answer. Thank you.


Solution

  • Are you wsl version 1 or 2? I am having the same problem with wsl 1 as you. I solved this problem by upgrading wsl to wsl 2.

    To see whether your Linux distribution is set to WSL 1 or WSL 2, use the command: wsl -l -v. To change versions, use the command: wsl --set-version <distro name> 2 replacing with the name of the Linux distribution that you want to update. For example, wsl --set-version Ubuntu-20.04 2 will set your Ubuntu 20.04 distribution to use WSL 2.

    If an error occurs during the upgrade process, refer to Microsoft's official documentation. Here's the link