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进行调试的三个必须设置选项的更多相关文章

  1. vs2010下release版本调试设置

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

  2. [原]设置vs的release版本调试

    通过三步设置就可以实现realse下的调试啦: 1.设置“C/C++”------>“常规”------->“调试信息格式”设置成:“程序数据库(/Zi)” 2.设置“链接器”------ ...

  3. VS2010如何进行程序调试

    VS2010如何进行程序调试 一.前言 对于初步学习C++的朋友,程序的调试是一项必备的技能.尤其是像C++这样难学的语言,程序调试的基本方法更是至关重要.毕竟,谁也不想自己幸幸苦苦一天敲出来的代码就 ...

  4. vs2010中release模式下调试程序

    debug模式调试信息全,但是速度很慢,在数据量比较大的时候非常影响调试效率,release模式速度快,但是没有调试信息.所以在编译的时候很多编译器会提供一种折中的编译方式,在release下提供调试 ...

  5. vs2008 怎么在Release下调试代码

    vs2008 怎么在Release下调试代码 (适用VS2005/VS2008) 在当前工程点击右键选择properties,选择 All Configurations C++>General- ...

  6. vs2008 release下调试状态设置[转]

    这是一个老生常谈的话题,但还是有时候会漏洞一些设置.总结一些,总共需要三个地方设置, 分别是1)c\c++-> General->Debug Information Format. 2) ...

  7. dev c++必须修改的三处默认设置

    此文档记录参加pat考试并且以dev c++[针对5.11版本]软件作为开发工具时,必须修改的三个默认设置. 1.修改默认语言标准 Dev C++ 5.11 版本支持较新的 C 和 C++ 标准,但是 ...

  8. httpClient中的三种超时设置小结

    httpClient中的三种超时设置小结   本文章给大家介绍一下关于Java中httpClient中的三种超时设置小结,希望此教程能给各位朋友带来帮助. ConnectTimeoutExceptio ...

  9. Java中httpClient中三种超时设置

    本文章给大家介绍一下关于Java中httpClient中的三种超时设置小结 在Apache的HttpClient包中,有三个设置超时的地方: /* 从连接池中取连接的超时时间*/ ConnManage ...

随机推荐

  1. 在Linux上进行内核参数调整

    在Solaris上,使用工具mdb就可以直接修改内核内存里的内容.而在Linux上,则通常使用命令sysctl(8)做类似的事情. 本文以Fedora为例,介绍如何在Linux上进行内核参数调整. 常 ...

  2. JDBC中链接数据库前为什么要用Class.forName(驱动类)加载驱动类?

    使用JDBC链接数据库时,为什么要先使用Class.forName(String name)来加载类? 答: 实际上就是为了加载类时,调用静态初始化块中的注册函数. 可以看一下MySql的Driber ...

  3. C# 1.0 到 4.0 的进化 1

    定义一个产品类 Product C# 1 using System; using System.Collections; namespace C1 { public class Product { s ...

  4. quartz ? * 区别

    官方文档上提到问号时是这样说的: The '?' character is allowed for the day-of-month and day-of-week fields. It is use ...

  5. SpringMVC官方文档阅读

    默认的DispatcherServlet配置 在spring-webmvc-4.3.16.RELEASE.jar/org/springframework/web/servlet/路径下的Dispatc ...

  6. UIKit 框架之WebView

    // // ViewController.m // UIWebView // // Created by City--Online on 15/5/18. // Copyright (c) 2015年 ...

  7. 如何使SpringBoot作为Maven构建的项目的一个子模块

    1.问题 一般使用springboot都会引用springboot作为parent,在实际项目中web只是系统模块的一个子集.当然你可以做两个项目来管理,一个项目用来做各种支持包,一个项目专门做web ...

  8. 利用JavaMail发送邮件:smtp.163.com

    一.利用JavaMail发送邮件案例: 1.maven项目结构: 2.先在pom.xml里边加入Javamail依赖,系统会根据坐标自动下载mail包(前提是配置好了maven): 3.配置email ...

  9. Android - AssetManager

    http://blog.csdn.net/luoshengyang/article/details/8791064

  10. Windows7系统如果安装&升级IE11浏览器

    作为一个前端工作人员,IE678简直就是噩梦,还好现在大多数网站已经开始放弃了对IE6/7/8的支持了. 由于Win7系统默认是安装的IE8,所以在打开部分网站时会提示:IE浏览器版本过低.解决方法如 ...