简体   繁体   English

在Visual C ++ 2003上删除调试符号

[英]Remove debugging symbols at Visual C++ 2003

Maybe someone can tell me how to remove the debugging symbols from my Visual Studio 2003 compiled c++ application? 也许有人可以告诉我如何从Visual Studio 2003编译的c ++应用程序中删除调试符号? I compiled it as "release", are the symbols already removed then or do they still exist? 我将其编译为“发行版”,这些符号是否已被删除,或者它们仍然存在? if they do, how can i remove them? 如果有,我该如何删除它们?

thanks! 谢谢!

Yes, Once you compile in release mode then the debug symbols are already removed. 是的,在发布模式下编译后,调试符号已被删除。

Adding debugging symbols to binaries increases the size of binaries because it is additional information than just needed for program to run, In Debug Mode these symbols are added to the binaries because the program is in development and hence it might be needed for debugging.But, In release mode the size of the binaries is to be as small as possible(as development is already done with) and hence these additional debug information is already removed once you select Release Mode. 在二进制文件中添加调试符号会增加二进制文件的大小,因为它不仅是程序运行所需的其他信息,在调试模式下,由于程序正在开发中,因此会将这些符号添加到二进制文件中,因此可能需要进行调试。在发布模式下,二进制文件的大小应尽可能小(因为开发已经完成),因此,一旦选择“发布模式”,这些附加调试信息将被删除。

As far as I know all debugging information are stored in .pdb file. 据我所知,所有调试信息都存储在.pdb文件中。 In .exe there is only the name of this .pdb file and nothing more. 在.exe中,只有此.pdb文件的名称,仅此而已。 Make an experiment and see it for yourself. 做一个实验,自己看看吧。 Build release both with and without debugging information and compare the difference (don't change any other option, of course). 带有和不带有调试信息的构建版本,并比较它们之间的差异(当然不要更改任何其他选项)。 Files should be almost identical. 文件应该几乎相同。 There is no reason to exclude debugging information from release build, and there are plenty of reason to include it. 没有理由从发行版本中排除调试信息,并且有很多理由要包括它。

Use debug information settings to control how and where you generate debugging symbols, whether this information is kept in object (.obj) files or in a program database (PDB). 使用调试信息设置来控制生成调试符号的方式和位置,无论此信息是保存在对象(.obj)文件中还是程序数据库(PDB)中。 Refer to /Z7, /Zi, /ZI (Debug Information Format) in MSDN. 请参考MSDN中的/ Z7,/ Zi,/ ZI(调试信息格式)

Correctly generating debug symbols in PDB database should not affect performance of your program. 在PDB数据库中正确生成调试符号不应影响程序的性能。 See John Robbin's blog Do PDB Files Affect Performance? 请参阅John Robbin的博客PDB文件会影响性能吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM