码迷,mamicode.com
首页 > 其他好文 > 详细

VS2010使用Release进行调试的三个必须设置选项

时间:2018-04-27 12:21:03      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:bugs   inf   info   int   path   run   fonts   details   cte   

How to: Debug a Release Build

You can debug a release build of an application.

To debug a release build

  1. Open the Property Pages dialog box for the project. For details, see Working with Project Properties.

  2. Click the C/C++ node. Set Debug Information Format to C7 compatible (/Z7) or Program Database (/Zi).

  3. Expand Linker and click the General node. Set Enable Incremental Linking to No (/INCREMENTAL:NO).

  4. Select the Debugging node. Set Generate Debug Info to Yes (/DEBUG).

  5. Select the Optimization node. Set References to /OPT:REF and Enable COMDAT Folding to /OPT:ICF.

  6. You can now debug your release build application. To find a problem, step through the code (or use Just-In-Time debugging) until you find where the failure occurs, and then determine the incorrect parameters or code.

    If an application works in a debug build, but fails in a release build, one of the compiler optimizations may be exposing a defect in the source code. To isolate the problem, disable selected optimizations for each source code file until you locate the file and the optimization that is causing the problem. (To expedite the process, you can divide the files into two groups, disable optimization on one group, and when you find a problem in a group, continue dividing until you isolate the problem file.)

    You can use /RTC to try to expose such bugs in your debug builds.

    For more information, see Optimizing Your Code.

===============

 

设置在Release模式下调试的方法:
1.工程项目上右键 -> 属性
2.c++ -> 常规 -〉调试信息格式    选  程序数据库(/Zi)或(/ZI), 注意:如果是库的话,只能(Zi)
3.c++ -> 优化 -〉优化            选  禁止(/Od)
4.连接器 -〉调试 -〉生成调试信息 选  是 (/DEBUG)



https://blog.csdn.net/haizimin/article/details/50262901

在有的情况下,我们可能不能直接利用Debug模式进行程序调试,那么如何在Release模式下进行程序调试呢?

一、将项目属性设置为Release,生成--->配置管理器:

技术分享图片

 

二、按Alt+F7,弹出属性页进行设置:

技术分享图片技术分享图片技术分享图片




VS2010使用Release进行调试的三个必须设置选项

标签:bugs   inf   info   int   path   run   fonts   details   cte   

原文地址:https://www.cnblogs.com/kungfupanda/p/8960672.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!