iosxcodelldbcrash-log

LLDB How to load crashlog


I'm studying iOS crash analysis. Now, I need to import crashlog files into LLDB. As WWDC18 Session 414 said, I now have a copy of myApp, dSYM, xxx.crash. Run the following command in iTerm2.app:

$ lldb
(lldb) command script import lldb.macosx.crashlog
(lldb) crashlog /path/xxxx.crash

However, the stack trace file is not available and there is only a lot of error like:

error: unable to locate any executables from the crash log

Did I use it wrong? What is the correct method of use?


Solution

  • I've recently had the same issue. Unfortunately, in it's current state the crashlog script appears to expect the original binary to be around, but we can "trick" it by either:

    1. Copying the binary from inside the .dSYM/Contents/Resources/DWARF/ into the path it is expecting it (found on the .crash file, something like /private/var/containers/Bundle/Application/SOME-UUID/MyApp.app/MyApp)

    2. Editing the paths (not just the initial one) in the .crash file before symbolicating to the path of the binary (e.g. ~/MyFolder/MyApp.app/...).

    Hope this helps! 🙏