gdb "No debugging symbols found in blender.exe"

gdb "No debugging symbols found in blender.exe"

当我 运行 build_windows_x64_vc17_Debug\bin>%gdb% blender.exe 我可以在 gdb-console 中看到这个:

Reading symbols from blender.exe...
(No debugging symbols found in blender.exe)

我正在通过 make debug developer ninja 从源代码构建 Blender,我是否错误地期望它包含调试符号?(结果 blender.exe 有 498MB,如果这可以被认为是任何事物的标志。)

-g 标志?

我在几个地方读到应该添加 -g 标志,所以我将它(然后也是 -ggdb)添加到环境变量中:

set CFLAGS=-g
set CXXFLAGS=-g

...并在 project(Blender) 之后进入 blender\CMakeLists.txt:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")

...也在同一个文件中:

set(PLATFORM_LINKFLAGS "-g")
set(PLATFORM_LINKFLAGS_DEBUG "-g")

...然后日志中充满了“cl:命令行警告 D9002:忽略未知选项‘-g’”

指向 pdb?

我也试过%gdb% --symbols=blender.pdb blender.exe,没区别

我的平台是 Windows 10 with VS2022 binaries/libraries.
我怀疑这是否重要,但这是我的 gdb 版本:

GNU gdb (GDB; JetBrains IDE bundle; build 145) 10.2
...
This GDB was configured as "x86_64-w64-mingw32".

根据 this reply GDB 与 MS-compiler 创建的内容不兼容。

GDB has a different debug format than Microsoft's compiler. Indeed the PDB format is not documented. So you can't use the debug information generated by a Microsoft compiler with GDB.