发布模式下的断点 [英] Break point in release mode

查看:44
本文介绍了发布模式下的断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 (C++) Visual Studio 2010.

I am using (C++) Visual Studio 2010.

我必须跟踪我的应用程序的控制流.为此,我在源代码中放置了一个断点.

I have to trace the control flow of my Application. To do so, I have put a break point in the source code.

在调试模式下运行应用程序时,会遇到断点.但是在发布模式下它没有命中.

While running the app in Debug mode, the break point hits. But in Release mode it didn't hit.

在Release模式下调试时如何导致断点被击中?

How can I cause the break point to be hit when debugging in Release mode?

推荐答案

在发布模式下,您的代码经过优化,可以改变程序的流程.例如,如果一个函数很简单并且只被调用一次,那么编译器可以在发布模式下内联该函数.

In release mode your code is optimized and that can change the flow of your program. For example, if a function is simple and only called once, the compiler can inline the function in release mode.

调试模式没有这种优化,专为调试您的代码而设计.

Debug mode doesn't have these kind of optimization and is designed for debugging your code.

这篇关于发布模式下的断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆