gdb 尝试使用观察点访问地址后 Snow Leopard 崩溃
我正在使用通过 MacPorts for Snow Leopard 编译的 GDB 7.1 调试二进制文件(仅限程序集)。我对使用 find
gdb 命令找到的特定地址感兴趣。因此,它确实是一个有效的地址:
(gdb) printf "%s\n", 0x00196f34
bruno
(gdb)
问题是每当我为它设置一个观察点(watch *0x00196f34
)并且它被访问时,系统就会立即崩溃并重新启动。
我注意到硬件观察点已启用,希望得到不太严重的结果,我使用set can-use-hw-watchpoints 0
切换到软件观察点但这并没有解决问题。
我尝试使用 Xcode 附带的 gdb 6.3
版本,并且 watch 工作正常。在为 6.3 和 7.1 设置此类监视时,我注意到有一个区别:
对于 gdb 6.3
(gdb) watch *0x00196f34
Watchpoint 1: *0x00196f34
(gdb) info breakpoints
Num Type Disp Enb Address What
1 watchpoint keep y *0x00196f34
对于 gdb 7.1
(gdb) watch *0x00196f34
Hardware watchpoint 1: *1666868
(gdb) info breakpoints
Num Type Disp Enb Address What
1 hw watchpoint keep y *1666868
为什么旧的 gdb(可以工作)以十六进制打印,而新的将地址转换为十进制数?我仍然想使用 gdb 7,所以知道这里发生了什么吗?
布鲁诺·贝拉斯科
I am debugging a binary (assembly only) using GDB 7.1 compiled via MacPorts for Snow Leopard. I am interested in a specific address that I found using find
gdb command. So that, it is a valid address indeed:
(gdb) printf "%s\n", 0x00196f34
bruno
(gdb)
The problem is whenever I set a watchpoint for it (watch *0x00196f34
) AND it gets accessed, the system crashes and reboots right away.
I noticed hardware watchpoint is enabled then, expecting a less severe result, I switched to software watchpoint using set can-use-hw-watchpoints 0
but this didn't fix the problem.
I tried to use gdb 6.3
version that comes with Xcode and watch works fine. There is a difference I noticed when setting such watch for both 6.3 and 7.1:
for gdb 6.3
(gdb) watch *0x00196f34
Watchpoint 1: *0x00196f34
(gdb) info breakpoints
Num Type Disp Enb Address What
1 watchpoint keep y *0x00196f34
for gdb 7.1
(gdb) watch *0x00196f34
Hardware watchpoint 1: *1666868
(gdb) info breakpoints
Num Type Disp Enb Address What
1 hw watchpoint keep y *1666868
Why does the older gdb, which works, print in hex while the new one translates the address into decimal number? I still want to work with gdb 7, so any clue what is it going on here?
Bruno Velasco
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论