[MSDN] How to Debug a Release Build

 
Visual C++ Concepts: Building a C/C++ Program
How to: Debug a Release Build
You can debug a release build.
To enable debugging of a release build, change the following release build options
1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
2. Enable /Z7 or /Zi.
3. Select/INCREMENTAL:NO.
4. Select /DEBUG:Yes.
5. Select /OPT:REF.
6. Select /OPT:ICF.
You can now debug your release build application. To find the problem, step through the code (or of using Just-In-Time debugging) until you find where the failure occurs, and then determine the incorrect parameters or code.
If a program works in a debug build, but fails in a release build, it is likely that one of the compiler optimizations is exposing a defect in your source code. To isolate the problem, you should disable selected optimizations for each source code file, until you locate the file and the optimization that is causing the problem. For example, you may want to divide the files into two groups, disable optimization on one group, and continue dividing until you isolate the problem to a single file.
You may want to use /RTC to try to expose such bugs in your debug builds.
See Optimizing Your Code for more information.
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值