在OS X上打开程序开始?

时间:2011-08-09 14:54:56

标签: macos gdb

如果没有调试符号,我怎么能在OS X(10.6)的程序开始时中断?

我正在调试我的机器挂起但无法做某些事情的问题(至少涉及网络的任何事情)。我可以用来尝试识别挂起的程序也会在启动时挂起,所以我想启动一个程序,但实际上并没有运行它直到发生挂起,希望程序运行或它挂起的地方帮助我诊断问题。

我尝试在回溯中显示的地址设置断点,但执行没有停止。

Breakpoint 2, 0x000000010005cc78 in write$NOCANCEL ()
(gdb) bt
#0  0x000000010005cc78 in write$NOCANCEL ()
#1  0x000000010005cc74 in __swrite ()
#2  0x000000010005cbfd in _swrite ()
#3  0x000000010005cb42 in __sflush ()
#4  0x0000000100061361 in __swbuf ()
#5  0x0000000100093474 in putchar ()
#6  0x0000000100003ce7 in ?? ()
#7  0x000000010000090c in ?? ()
(gdb) b *0x000000010000090c
Breakpoint 3 at 0x10000090c
(gdb) b *0x0000000100003ce7
Breakpoint 4 at 0x100003ce7
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: [...]

Breakpoint 2, 0x000000010005cc78 in write$NOCANCEL ()
(gdb) bt
#0  0x000000010005cc78 in write$NOCANCEL ()
#1  0x000000010005cc74 in __swrite ()
#2  0x000000010005cbfd in _swrite ()
#3  0x000000010005cb42 in __sflush ()
#4  0x0000000100061361 in __swbuf ()
#5  0x0000000100093474 in putchar ()
#6  0x0000000100003ce7 in ?? ()
#7  0x000000010000090c in ?? ()

1 个答案:

答案 0 :(得分:1)

b __dyld__dyld_start有效。 (感谢@kongtomorrow。)