本文介绍了Visual C ++ 2008'Release'构建包含调试信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,当使用MS Visual Studio 2008生成新的C ++项目时,发布构建包含调试符号 - 具体以下设置已启用:

I've noticed that when generating a new C++ project using MS Visual Studio 2008, the Release build contains debugging symbols - specifically the following settings are enabled:


  • C ++ /常规/调试信息格式设置为程序数据库

  • 链接器/生成调试信息设置设置为

  • The C++/General/Debug Information Format is set to Program Database.
  • The Linker/Debugging/Generate Debug Info setting is set to Yes.

我从来没有注意到在早期版本的Visual Studio 。

I have never noticed this on earlier releases of Visual Studio.

因此,除了生成一个更大的EXE文件,是否有任何缺点,启用这些设置?

So, other than generating a larger EXE file, is there any downside to leaving these settings enabled?

推荐答案

我们已经打开了这些设置在我们的商业版本多年来没有明显的缺点。不过,这方面的优势是巨大的。

We have turned on those settings in our commercial releases for years now with no apparent downside. The upsides are enormous,though.

我们已经集成了一个崩溃转储包装程序,它将转储与其他一些信息一起打包,并通过公司收件箱发送(经用户同意)。这有助于我们发现永远需要我们重现和发现的问题。

We have integrated a crash dump packager that packages the dump along with some other information and emails it (with the user's consent) to a company inbox. This has helped us find problems that would have taken us forever to reproduce and find otherwise.

虽然它稍微偏离主题,但这里有一个链接一个很好的贡献,有人做,让你一个简单的方法来包括崩溃记者到C + + / Windows应用程序:

Although it's slightly off topic, here's a link to an excellent contribution someone made that gives you an easy way to include a crash reporter to a C++/Windows app:http://www.codeproject.com/KB/debug/crash_report.aspx

注意:这是明智的,但不包括PDB文件与您的版本。也就是说,您必须保留与您发布的版本匹配的PDB文件,以便将来可以正确地调试该问题。如果使用的PDB文件不是用构建exe的相同代码构建的,那么当您尝试调试dmp时看到的堆栈将是错误的。

Note: It would be wise, though, not to include the PDB file with your release. That said, you must keep the PDB file that matches your released version so that you can correctly debug the problem in the future. If a PDB file is used that wasn't built with the same code that built the exe, the stack you see when you try to debug the dmp will be wrong.

这篇关于Visual C ++ 2008'Release'构建包含调试信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 03:18