简体   繁体   English

C ++调试发行版

[英]C++ debug release version

Very basic question. 非常基本的问题。 I want to debug release version of my exe. 我想调试exe的发行版本。 My debug version is working fine. 我的调试版本运行正常。 But release version crashing as usual. 但是发行版本像往常一样崩溃。

Any tool or debugger available for this would be a great help. 任何可用于此目的的工具或调试器都将提供很大的帮助。

You can still enable debug information in release mode, and use a debugger as usual. 您仍然可以在发布模式下启用调试信息,并照常使用调试器。 Nothing particular here, except that the order of instructions will sometimes look weird when debugging due to optimizations. 这里没有什么特别的,除了由于优化而导致调试时指令的顺序有时看起来很奇怪。

Good luck, debugging release-mode-only bugs is tedious. 祝您好运,调试仅发布模式的错误很乏味。

I'd recommend you adding some kind of logging system or trace points to locate the source of crash. 我建议您添加某种日志记录系统或跟踪点以查找崩溃的来源。 The debugger can trick you when debugging release. 在调试发行版时,调试器可以欺骗您。 You can also elevate the warning level of your compiler to see some usual suspects such as use of unitialized variables. 您还可以提高编译器的警告级别,以查看一些常见的疑问,例如使用统一变量。

I recommend you to run exe under some memory debugger, such as Rational Purify or BoundsChecker. 我建议您在某些内存调试器(例如Rational Purify或BoundsChecker)下运行exe。 It will spot memory related bugs in your code, if any. 它将在代码中发现与内存相关的错误(如果有)。

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

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