Windows 具有完整嵌入式调试符号的可执行文件?

Windows executables with complete embedded debug symbols?

是否存在 Windows 可执行文件(使用 Visual Studio 用 C++ 编写)可以包含其完整调试符号的情况?或者整套调试符号只包含在它的 .pdb 文件中?

有没有一种方法可以配置构建 windows 应用程序,以便我们可以在没有 .pdb 文件的情况下调试它?

来自the documentation for your toolchain

The compiler's C7 Compatible (/Z7) option causes the compiler to leave the debugging information in the .obj files. You can also use the Program Database (/Zi) compiler option to store the debugging information in a PDB for the .obj file. The linker looks for the object's PDB first in the absolute path written in the .obj file, and then in the directory that contains the .obj file. You cannot specify an object's PDB file name or location to the linker.

It is not possible to create an .exe or .dll that contains debug information. Debug information is always placed in a .obj or .pdb file.

这不排除其他工具将调试信息放入 EXE 文件的一部分...但 Microsoft Visual Studio 的 C++ 工具永远不会这样做。

有关将调试信息放入 OBJ 文件(可能包含在 LIB 静态库中)而不是 PDB 的信息,请阅读 the documentation on the compiler option for Debug Information Format