gdb:寄存器值为 0xffaa 时的断点 [英] gdb: breakpoint when register will have value 0xffaa

查看:14
本文介绍了gdb:寄存器值为 0xffaa 时的断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在 gdb 中为寄存器值设置断点/观察点/smth 吗?

Can I set the breakpoint/watchpoint/smth else in gdb for register value?

我想在 $eax 的值为 0x0000ffaa 时中断.

I want to break when $eax will have value 0x0000ffaa.

是否可以使用 gdb 或 dbx 或任何其他 unix 调试器?

Is it possible with gdb or dbx or any other unix debugger?

推荐答案

是的,在 gdb 中你可以像这样设置观察点:

Yes in gdb you would set a watchpoint like so:

watch $eax == 0x0000ffaa

但它依赖于目标可用的观察点支持.您应该注意,这可能会显着减慢执行速度.

But it is dependent on watchpoint support being available for the target. You should note that this may slow down execution significantly.

如果您想在某个位置中断,可以通过设置条件断点来实现:

If you would like to break in a certain location you can do so, by setting a conditional breakpoint:

break test.c:120 if $eax == 0x0000ffaa

这篇关于gdb:寄存器值为 0xffaa 时的断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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