使用 clang 获取源代码和调试符号(使用 cli)

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

我在 Windows 上使用 clang 10,我想使用调试符号编译我的文件,以便能够在调试时找到源代码。

现在我在编译时将 -g -gcodeview 传递给 clang,在链接时传递 -g。调试时我能够看到堆栈跟踪,因此我假设符号已正确生成。但是,我无法使用任何 windows 调试器查看或步进我的 c++ 代码源,我尝试了 WinDbg 和 Visual Studio 调试器,但我认为我可以放心地假设这不是他们的错误。

我可以看到我正在正确生成我的 .pdb,但我可能遗漏了一些东西。

谢谢!

我明白了,你需要传递-gno-column-info。这是我找到解决方案的帖子 https://handmade.network/forums/t/3169-clang_on_windows,_debugging,_compile_times