Wednesday, April 1, 2015

Printing Objective-C Invocations in LLDB

Ari Grant:

A while ago Facebook open-sourced Chisel, a collection of commands and functions to assist in debugging iOS apps in LLDB.

[…]

There is one command that I find particularly fun and interesting yet haven’t had the chance to write about, until this post.

The command is pinvocation (for print invocation) which is most useful for debugging Objective-C methods in Apple’s code (or anything where you don’t have access to the source and thus symbols). pinvocation finds the values for self and _cmd, packages them up into an NSInvocation and then prints it all out for you, including the arguments.

It sounds like a wonderful idea, but I tried it with several applications and was not able to get it to work. I kept getting errors like:

error: error: 0 errors parsing expression
error: The expression could not be prepared to run in the target

Currently, only 32-bit x86 (Mac and iOS simulator) is supported.

Comments RSS · Twitter

Leave a Comment