For debugging on iOS simulator, I used to be able to read out $eax register and get the error message. However, I don't know if it's the new XCode version 4.6 and iOS 6.1, I can't do that any more.
(lldb) po $eax
error: Couldn't materialize struct: Couldn't read eax (materialize)
Errored out in Execute, couldn't PrepareToExecuteJITExpression
What now? Also eax is not in the real device, what do I do?
While trojanfoe gave a great answer, something that might help others too is that if you're attempting to print $eax as a result of an exception that is not displaying a message, be sure you're in the objc_exception_throw frame in the Debug Navigator (⌘+6) when printing it out. Otherwise you'll get the "couldn't materialize" error above.
According to this LLDB guide, you can use:
register read
To examine the general purpose registers of the current thread
Make sure your current build scheme is on debug mode, because otherwise the compiled app will be optimised by stripping out additional information for debugging.
If you are setting your own build schemes, go to Build Settings -> Code Generation -> Optimization Level, set the value to 'None [-O0]'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With