-
-
Save mingsai/6340865 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This produces a list of method names when used with a symbolic breakpoint in Xcode targeting objc_msgSend. I also spotted this on stack overflow and in Apple's iOS debugging magic (TN2239). One should be aware of the need to use other function calls to further refine output.
For example:
objc_msgSend_stret - structs
objc_msgSend_fpret - floating points
objc_msgSendSuper - super
For more on interpreting crash log output see the article by Parker (n.d.) which can assist in analyzing the register's used on different platforms. If you need help translating gdb to lldb check out the GDB to LLDB Command Map.
References
Anonymous. (n.d.). GDB to LLDB Command Map. Retrieved from http://lldb.llvm.org/lldb-gdb.html
Apple. (n.d.). TN2239 - iOS Debugging Magic. Retrieved from https://developer.apple.com/library/ios/technotes/tn2239/_index.html#//apple_ref/doc/uid/DTS40010638-CH1-SUBSECTION11
Parker, G. (n.d.). Hamster Emporium Archive. Retrieved from http://sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_you_crashed_in_objc_msgSend.html