Xcode/LLDB: How to get information about an exception that was just thrown?

后端 未结 4 2065
陌清茗
陌清茗 2020-11-29 15:08

OK, so imagine that my breakpoint in objc_exception_throw has just triggered. I\'m sitting at the debugger prompt, and I want to get some more information abou

4条回答
  •  天命终不由人
    2020-11-29 15:33

    At the time of this writing, this post is my top Google hit for: lldb print exception. Thus, I am adding this answer to account for lldb and x86_64.

    My attempts to find the exception using po $eax failed with error: Couldn't materialize struct: Couldn't read eax (materialize). Other attempts described in linked documents from earlier answers also failed.

    The key was I had to first click on the objc_exception_throw frame in my main thread. lldb does not start off in that frame.

    In all my searching and following examples, this blog entry was the first to explain things in a way that worked for me. It is more modern, being posted in Aug 2012.

提交回复
热议问题