Lldb objc_msgSend trace on OS X

I am tracking an OS X application, I hope that in iOS you can find a way like this:

lldb Xcode: error: 'printf' is not a valid command

Is there any way to do this? I tried

expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) )

I think OS X uses 64-bit registers. So this command cannot work (indeed, it does not work). How do I write this command? Or is there an easy way to do the same? Just tracking the class and method called

+1
source share
1 answer

, , iOS Simulator, i386 Mac. $esp+4 , $esp+8 , i386 ABI. x86_64 $arg1, $arg2.

p (void)printf("[%s, %s]\n", (char*)object_getClassName($arg1), $arg2)

arm/x86_64. (, p expr -- - , .)

+7

All Articles