VSCode cannot debug using stable-x86_64-pc-windows-gnu

I am using MinGW64, VSCode and Clion. By using stable-x86_64-pc-windows-msvc, I can debug and breakpoints work. But with stable-x86_64-pc-windows-gnu, when I debug, CLion shows error:

diesel_demo/target/debug/diesel_demo.exe

Process finished with exit code 1

And VSCode shows error:

Breakpoint warning: Unexpected symbol reader error while processing diesel_demo.exe. - g:\workspace\diesel_demo\src\main.rs:14
Breakpoint warning: Unexpected symbol reader error while processing diesel_demo.exe. - g:\workspace\diesel_demo\src\bin\show_posts.rs:7
Loaded 'G:\workspace\diesel_demo\target\debug\diesel_demo.exe'.
Loaded 'C:\Windows\System32\ntdll.dll'.
Loaded 'C:\Windows\System32\kernel32.dll'.
Loaded 'C:\Windows\System32\KernelBase.dll'.
Loaded 'C:\Windows\System32\advapi32.dll'.
Loaded 'C:\Windows\System32\msvcrt.dll'.
Loaded 'C:\Windows\System32\sechost.dll'.
Loaded 'C:\Windows\System32\rpcrt4.dll'.
Loaded 'C:\Windows\System32\userenv.dll'.
Loaded 'C:\Windows\System32\profapi.dll'.
Loaded 'C:\Windows\System32\ws2_32.dll'.
Loaded 'C:\Windows\System32\nsi.dll'.
Loaded 'C:\Program Files (x86)\Lua\5.1\clibs\libmysql.dll'. Module was built without symbols.
Unloaded 'C:\Program Files (x86)\Lua\5.1\clibs\libmysql.dll'.
The program '[10012] diesel_demo.exe' has exited with code -1073741701 (0xc000007b).

I am wondering, what decides which DLL to load, is it stable-x86_64-pc-windows-gnu? Where does it look for DLLs? Why it looks for C:\Program Files (x86)\Lua\5.1\clibs? How to solve this problem. Thank you.

The crates you use decide which DLLs to use. In this case mysqlclient-sys used by the diesel crate decided to use libmysql.dll.

Lack of symbols in a DLL should not prevent application from being debugged. You wouldn't get source code or function names when stepping through that particular library, but everything else should work fine.

However, your debugger may be incompatible with the gnu toolchain. I'm not familiar with Windows debuggers, but I wouldn't be surprised if Microsoft's debugger didn't work with "Linux" debug information and vice-versa.

Thanks kornel

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.