我的應用程序崩潰了,它好像被捕獲到異常斷點(這是有道理的),但我無法找到崩潰的原因。如何在Xcode 6的異常斷點處打印異常?
這是我已經試過:
po $eax
po $rax
po $r0
po *(id *)($esp + 4)
對於所有試圖在上面,我發現了以下錯誤:
error: use of undeclared identifier '$<register name>' error: 1 errors parsing expression
我也發現了這個LLDB Command Guide,但沒有發現任何有用的東西(有點混亂它,你不知道你在找什麼)。
如何打印碰撞原因?
我運行iOS 8,LLDB和Xcode的6
編輯
現在我明白爲什麼都沒有發現這些寄存器。下面是我得到的,當我運行register read
:
General Purpose Registers:
x0 = 0x0000000000000001
x1 = 0x0000000000000000
x2 = 0x0000000000000000
x3 = 0x0000000195531a74 libsystem_malloc.dylib`nano_free_definite_size
x4 = 0x0000000000000000
x5 = 0x0000000000000000
x6 = 0x676e697274534643
x7 = 0x0000000000000f80
x8 = 0x00000001569d5a10
x9 = 0x0000000000000000
x10 = 0x000001a574056051
x11 = 0x0000000000000001
x12 = 0x000000000000003d
x13 = 0x0000000000000000
x14 = 0x0000000000000001
x15 = 0x0000000000000052
x16 = 0x0000000194d6e510 libobjc.A.dylib`object_setClass
x17 = 0x0000000000000000
x18 = 0x0000000000000000
x19 = 0x00000001702823f0
x20 = 0x0000000174038eaa
x21 = 0x000000019130a778 "release"
x22 = 0x0000000000000000
x23 = 0x0000000174246d20
x24 = 0x0000000174038ea0
x25 = 0x00000001895d22fa "forwardingTargetForSelector:"
x26 = 0x00000001745186a0
x27 = 0x0000000000000000
x28 = 0x00000000a40008ff
fp = 0x0000000105757720
lr = 0x000000018462a440 CoreFoundation`___forwarding___ + 968
sp = 0x00000001057576c0
pc = 0x000000018462a440 CoreFoundation`___forwarding___ + 968
cpsr = 0x20000000
正如你可以看到這些都是使用不含有任何我以前試過的那些的寄存器。但是,我仍然無法找到例外。
[Xcode/GDB:如何獲得剛纔拋出的異常信息?](http://stackoverflow.com/questions/3327828/xcode-gdb-how-to-get-information-about -an-exception-that-just-thrown) – 2015-06-12 18:38:28