< Back

# Debugging objc_msgSend in iOS Projects

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.

Impressum • Mastodon