lldb objc_msgSend tracing on OS X

后端 未结 1 1167
我在风中等你
我在风中等你 2020-12-20 05:40

I\'m tracing a OS X application, I hope can find a way like this way on iOS:

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

Is there a way to do like t

相关标签:
1条回答
  • 2020-12-20 05:51

    The command you quote above is only correct for iOS Simulator apps which run as i386 processes on the Mac. $esp+4 means the first argument, $esp+8 means the second argument passed in the i386 ABI. On x86_64 and arm, the first few arguments are passed in registers with the $arg1, $arg2 convenience names. So try

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

    for arm/x86_64 architectures. (of course, p is an alias for expr -- here - same thing, just less typing.)

    0 讨论(0)
提交回复
热议问题