VS2008单步调试时出错,原来的断点处显示一个空心圆加一个右下角的警告图标,调试无效,会直接跳过该断点。鼠标放在该断点上有如下提示:
The breakpoint will not currently be hit. The source code is different from the original version
网上搜了一下原因,有人写:
昨天对dnn跟踪调试的时,设了断点后运行到断点处总提示“The breakpoint will not currently be hit. The source code is different from the original version”,搜了一下,原因是:
The problem you're running into is caused by a new feature in the compilers and debugger to keep track of checksums for source files. Using this mechanism we can tell if the source file we're displaying in the debugger matches the original file used to build the application.
When you change a source file while debugging, and Edit and Continue is unavailable or disabled, you'll see warnings about the source not matching. Since Beta 2 we've improved the error message (no longer a Yes/No dialog, just a warning with an OK button). We've also changed the behavior so your breakpoints will no longer show this message when a source file does not match.
To clarify what the message is asking you to do: right-click on the breakpoint in question, and you should see a Location item. On the resulting dialog you should see an override checkbox which will get rid of the message you're seeing when you hover over your breakpoints. Or you could go to Tools->Options->Debugging->General and uncheck the "Require source to exactly match..." option, which will turn off all checksum functionality in the debugger.
偶的英语不太好,大致上看明白了,从菜单栏的 Tools->Options->Debugging->General
取消 "Require source to exactly match..." 项的选择。
还有两个可能是
1. 打开项目属性,选择调试选项卡,将“启用非托管代码调试”一项钩上。
2. 由于Terminal Services 这个服务被禁用了,将这个服务设为自动,将这个服务启动。
我试了一下,确实就好了。
最后我还是想办法解决了这个问题,方法是先取消“Require source files to exactly match the original version”选项,然后修改一下程序,再在该文件设断点调试一下,然后重新选定“Require source files to exactly……”选项,这样就好了。
最后我想,断点调试失效的原因应该是我当时调试中间的时候顺便改写了程序,导致Visual Studio 2008对此进行了记录,而后面好像又强行关掉了Visual Studio 2008,导致记录没有被清除,后面就老是通不过源文件和debbuger编译时文件的同步检测。而后面我重新设断点调试和重新选中同步测试选项相当于把错误记录又清除掉了,所以就修复啦。
分享到:
相关推荐
### 解决安装IE8后VS2005无法调试的问题 在进行软件开发的过程中,我们经常会遇到各种各样的问题,特别是在使用旧版本的工具时。本文将详细介绍如何解决安装IE8浏览器之后,Visual Studio 2005(简称VS2005)中的...
然而,有时候在使用VS2008进行调试时,尤其是尝试附加到进程以调试Web网页时,可能会遇到无法一步步跟踪代码的问题。这个问题让开发者难以定位和解决程序中的问题,极大地影响了开发效率。 针对这个问题,微软发布...
在VS2008中调试时,如果设置的断点总是无效且提示“当前不会命中断点。源代码与原始版本不同”,可以尝试以下两种方法之一: 1. **禁用源代码完全匹配检查**: - 打开“工具” > “选项” > “调试”。 - 取消...
在VS2010中尝试运行项目时出错,无法启动调试两个解决方法:1) 打开项目属性,选择调试选项卡,将“启用非托管代码调试”一项钩上。2) 打开项目属性,选择调试选项卡,将“启用 Visual Studio 宿主进程“一项钩掉。 ...
- **问题**:直接使用mex命令编译包含OpenCV调用的C++文件可能会遇到问题,原因在于mex编译时可能无法正确识别或定位到OpenCV库。 #### 六、总结 通过上述步骤,我们可以成功地实现C++与Matlab的混合编程,不仅可以...
自2008年起,全国计算机等级考试开始全面采用VC6.0作为C语言上机考试的环境,因此了解如何在VC6.0中编写和调试C语言程序变得尤为重要。 #### 三、在VC6.0中运行C程序 ##### 1. 启动VC6.0 - **步骤**:在Windows...
- 调整编译参数或使用调试功能查找具体原因。 - **调试过程中遇到死锁现象**: - 分析程序逻辑,找出可能导致死锁的条件。 - 使用HEW V.4.04提供的调试工具,观察程序状态变化。 - 增加日志输出,记录关键信息...
- **调试过程**:包括识别问题所在、分析原因、修改代码并重新测试等步骤。 - **调试方案设计**:根据程序的具体情况制定合适的调试策略。 - **优秀程序员应具备的素质**:丰富的想象力帮助解决问题,严谨的思维确保...
- **DbgPrint**:Windows内核模式下的调试函数,用于输出调试信息。 - **解决办法**:确保驱动程序正确调用了DbgPrint,并且DebugView正确配置以捕获输出。 #### 10. SamplePingPacketDecode - **...