数据断点是如何创建的? [英] How are data breakpoints created?

查看:27
本文介绍了数据断点是如何创建的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道数据断点(又名观察点)是如何创建的?

I was just wondering how data breakpoints (aka watchpoint) are created?

我知道常见的断点是在 x86 上用一些特殊的 INT3 指令制作的.

I know common breakpoints are made with some special INT3 instruction on x86.

我想你可以通过定期扫描内存来创建软件观察点.

I suppose you can create software watchpoint by scanning the memory regularly.

但是从编写自己的带有硬件断点的调试器的角度来看,我在 Windows 参考 关于此(仅这两个关于 WinDbg 的主题 1 2).我还没看过 Linux.

But from the perspective of writing my own debugger with hardware breakpoints, I can't find anything in the Windows Reference regarding this (only theses two topics on WinDbg 1 2). I didn't look yet on Linux.

有什么想法吗?

谢谢

推荐答案

在 x86 处理器上,您可以使用 处理器上的调试寄存器.调试寄存器 DR0-DR3 存储要观察的地址.这就是 Visual Studio 被限制为四个数据断点的原因.

On an x86 processor, you set up data breakpoints by using the debug registers on the processor. Debug registers DR0-DR3 store the addresses to watch. That's the reason that Visual Studio is limited to four data breakpoints.

这篇关于数据断点是如何创建的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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