调试之设置数据断点 (zz.IS2120)
2012-09-11 09:39
344 查看
How to: Set a Data Breakpoint (Native Only)
//z 2012-09-11 09:43:48 IS2120@CSDN.T3678804781[T31,L404,R7,V204]Data breakpoints break execution when a value that is stored at a specified memory location is written. If the value is read but not written, execution does not break.
Data breakpoints do not work under these conditions: if a process that is not being debugged writes to the memory location, or if the memory location is shared between two or more processes.
Data breakpoints do not work if the memory location is updated within the kernel. For example, if memory is passed to the 32-bit Windows ReadFile function, the memory will be updated from kernel mode and the debugger does not break on the memory write.
To set data breakpoints, the debugger must be in break mode only.
Addresses of variables change from one debugging session to the next. For this reason, data breakpoints are automatically disabled at the end of each debugging session.
If you set a data breakpoint on a local variable, the data breakpoint remains enabled when the function ends. However, the memory address it is set on no longer has the same meaning. Therefore, the results of such a breakpoint are unpredictable. If you set
a data breakpoint on a local variable, the best practice is to remove or disable the breakpoint before the function ends.
Visual Studio supports a maximum of four data breakpoints per solution.
Note The dialog boxes and menu commands you see might differ from those described in Help, depending on your active settings or edition. To change your settings, choose
Import and Export Settings on the
Tools menu.
To set a memory change breakpoint
//z 2012-09-11 09:43:48 IS2120@CSDN.T3678804781[T31,L404,R7,V204]On the Debug menu, choose New Breakpoint, and then click
New Data Breakpoint.
-or-
In the Breakpoints window menu, click
New, and then choose New Data Breakpoint.
The New Breakpoint dialog box appears.
In the Address box, type a memory address or expression that evaluates to a memory address.
For example, type &avar to break when the contents of variable
avar change.
In the Byte Count box, type the number of bytes you want the debugger to watch.
For example, if you type 4, the debugger will watch the four bytes starting at
&myFunction and break if any of those bytes change value.
Click OK.
调试 断点 观察 变量 变化 内存 变化
//z 2012-09-11 09:43:48 IS2120@CSDN.T3678804781[T31,L404,R7,V204]
相关文章推荐
- [zt]调试的时候,无法设置数据断点(为灰色)
- 转Xcode 调试技巧 XCode调试技巧–设置全局断点快速定位问题代码所在行[zz]
- vxworks在shell下设置断点调试
- vs2008支持脚本设置断点调试,设置步骤如下:
- ASP.NET 在App_Code里的类调试没有反应,设置断点位置是关键
- windbg 调试断点设置
- Chrome 中的 JavaScript 断点设置和调试技巧
- Chrome 中的 JavaScript 断点设置和调试技巧
- IOS 调试技巧四:在系统抛出异常处设置断点
- myeclipse如何设置或关闭断点调试自动跳入debug模式
- eclipse调试时设置断点不起作用问题。
- C#.NET常见问题(FAQ)-程序如何单步调试和设置断点
- VS 2005 VS2008 VS2010 设置断点,在调试时产生断点错位怎么解决
- VS局域网断点调试设置
- note : OD操作整理-API断点的设置;寄存器的修改;数据的查看
- 使用Ant构建项目调试代码时无法设置断点
- MFC源码不能设置断点调试
- ssis package 在调试状态中设置断点,程序 不进入断点 的解决方案
- XCode调试技巧–设置全局断点快速定位问题代码所在行
- Keil的调试命令、在线汇编与断点设置等调试方法介绍