最近,我的应用程序发生了崩溃并且发出错误:
libc++abi.dylib: terminate_handler unexpectedly threw an exception
(lldb) bt
* thread #1: tid = 0x2e8eb, 0x38cf1dfc libsystem_kernel.dylib`__pthread_kill + 8, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x38cf1dfc libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x38d6fd36 libsystem_pthread.dylib`pthread_kill + 62
frame #2: 0x38c91908 libsystem_c.dylib`abort + 76
frame #3: 0x37fce9c8 libc++abi.dylib`abort_message + 88
frame #4: 0x37fe5e28 libc++abi.dylib`std::__terminate(void (*)()) + 148
frame #5: 0x37fe58ae libc++abi.dylib`__cxa_rethrow + 102
frame #6: 0x386abdd2 libobjc.A.dylib`objc_exception_rethrow + 42
frame #7: 0x2ae0745c CoreFoundation`CFRunLoopRunSpecific + 632
frame #8: 0x2ae071d2 CoreFoundation`CFRunLoopRunInMode + 106
frame #9: 0x322050a8 GraphicsServices`GSEventRunModal + 136
frame #10: 0x2e416fa0 UIKit`UIApplicationMain + 1440
* frame #11: 0x0016c250 hatchpic`top_level_code + 72 at AppDelegate.swift:44
frame #12: 0x0016c3a4 hatchpic`main + 48 at AppDelegate.swift:0
并且没有告诉我错误发生在哪里。
我最终做的是通过跟踪我采取的操作并手动追溯错误来解决问题。
这是一项非常令人沮丧的工作。那么如何使用lldb
,或者除了手动方法之外的其他方法来找到错误发生的位置呢?