Visual Studio 断点被移动
我最初使用 Visual Studio C++ Express,我已切换到 Ultimate,目前我对调试器为何移动我的断点感到困惑,例如:
if(x > y) {
int z = x/y; < --- breakpoint set here
}
int h = x+y; < --- breakpoint is moved here during run time
或者
random line of code < --- breakpoint set here
random line of code
return someValue; < --- breakpoint is moved here during run time
它似乎在代码中的随机位置执行此操作。有时我在这里做错了吗?我在使用 Express 版本时从未遇到过这样的问题。
I originally used Visual Studio C++ Express, i've switched to ultimate and im currently confused as to why the debugger is moving my breakpoints, for example:
if(x > y) {
int z = x/y; < --- breakpoint set here
}
int h = x+y; < --- breakpoint is moved here during run time
or
random line of code < --- breakpoint set here
random line of code
return someValue; < --- breakpoint is moved here during run time
It seems to do this at random locations in the code. Is there sometime i'm doing wrong here? I've never had an issue with the express version like this happening.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在发布模式下进行调试。
通常调试器在二进制代码中设置挂钩。如果没有对
int z = x/y
执行二进制代码,则无法在那里设置断点。以下是通过在发布模式下编译生成的:
要测试它,您可以执行以下简单的更改:
You are debugging in release mode.
Usually debuggers set hooks inside binary code. If no binary code is executed for
int z = x/y
, you can't set a breakpoint there.The following is generated by compiling this in release mode:
To test this, you can perform this simple change: