Search code examples
c++windowsdebuggingclangllvm

Get source code and debug symbol with clang (using the cli)


I'm using clang 10 on Windows and I would like to compile my file with debug symbols and to be able to locate the source code while debugging.

Right now I am passing -g -gcodeview to clang when I compile and -g when linking. I am able to see the stacktrace when debugging so I assume that the symbols are correctly generated. However I can't see or step with my c++ code source with any windows debugger, I tried WinDbg and Visual Studio Debugger but I think I can safely assume that it's not a bug from their part.

I can see that I'm correctly generating my .pdb but I am maybe missing something.

Thank you !


Solution

  • I figured it out, you need to pass -gno-column-info. Here's a thread where I found the solution https://handmade.network/forums/t/3169-clang_on_windows,_debugging,_compile_times