运行 gcc -gcodeview

huangapple go评论75阅读模式
英文:

Run gcc -gcodeview

问题

我想在Windows + MSYS2|UCRT64上运行gcc,使用-gcodeview标志,以生成pdb文件。这些文件是必需的,以生成包括源文件中行号的堆栈跟踪信息。

但是gcc/g++始终报告调试级别未被识别:g++: error: unrecognized debug output level ‘codeview’

我需要使用特定标志编译和配置gcc以支持CodeView吗?

英文:

I want to run gcc on Windows + MSYS2|UCRT64 with the -gcodeview flag, to generate pdb files. Those are required, to generate stacktraces including line numbers in source files.

But gcc/g++ always reports, that the debug level is unrecognized: g++: error: unrecognized debug output level ‘codeview’

Do I have to compile and configure gcc with a specific flag to support CodeView?

答案1

得分: 2

你链接的GCC文档版本是开发分支14.0的。当前的发布版本是13.1.0,在其调试选项中不包括-gcodeview。所以这是新添加的功能,适用于14版本。

我的MSYS2/mingw64安装使用的是gcc 13.1.0;我假设ucrt64版本也是如此。

所以,要生成codeview调试信息,你要么需要安装开发版本的gcc(可能需要从源代码构建),并希望它处于可用状态,要么等待14.1版本发布并被采用。

英文:

The version of the GCC documentation you linked to is for the development branch 14.0. The current release, 13.1.0, doesn't include -gcodeview in its debug options. So it's something new added for 14.

My MSYS2/mingw64 installation is using gcc 13.1.0; I assume the ucrt64 version is too.

So, basically, to generate codeview debug information, you either need to install a development version of gcc (Possibly having to build it from source) and hope it's in a usable state, or wait for 14.1 to be released and adopted.

huangapple
  • 本文由 发表于 2023年6月22日 00:17:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76525310.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定