gdb 尝试使用观察点访问地址后 Snow Leopard 崩溃

发布于 2024-10-11 19:19:29 字数 1052 浏览 0 评论 0原文

我正在使用通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文