开发者

Snow Leopard crashes after gdb attempts to access an address using watchpoints

开发者 https://www.devze.com 2023-02-03 16:38 出处:网络
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

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 *0x001开发者_开发问答96f34
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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号