Marcus Kida's Blog

Hey! πŸ‘‹ I'm Marcus, a Freelance Senior iOS Developer πŸ“± CTO-as-a-Service and CEO @Bearologics. I'm solving problems through code. Want to hire me? πŸ‘‰ Let's talk!

Every selector called during an iOS App’s lifecycle is being dispatched by objc_msgSend, sometimes it may be helpful to debug those calls.

For this it’s neccessary to add a symbolic Breakpoint with objc_msgSend as it’s Symbol.

If you’re on a arm-based system (e.g. the iOS Device) you should use this Debugger Command action to be executed

expr β€” (void)printf(β€œ[%s %s]\n”,(char *) object_getClassName(*(long*)($r0)), (char *)($r1))

on the x86_64 (e.g. iOS Simulator) please use this one

expr β€” (void)printf(β€œ[%s %s]\n”,(char *) object_getClassName(*(long*)($rdi)), (char *)($rsi))

As you can see, the difference originates in the different registers (rdi vs r0, rsi vs r1) being used by the different architectures.

Tagged with: