Perpendiculous Programming, Personal Finance, and Personal musings

2008.06.19

Even more ObjC-jutsu

Filed under: Programming — cwright @ 12:39 am

From time to time I accumulate cute little hacks that help debug/reverse engineer stuff in Objective-C. Typically, these are gdb macros that help introspect data from within a live program, though sometimes it’s a blob of ObjC code that does something fun when injected into the runtime. Today, I’ve discovered something extraordinarily helpful that falls into neither of those categories.

Today, I discovered instrumentObjcMessageSends(YES);. That’s right. Instrumented – ObjC Message Sends. (!!!)

For the better part of a year, I’ve wanted to be able to find out what goes on behind the scenes of certain method calls, particularly for expensive operations (so I can optimize away the cruft, and get faster code). And this will do just that. It logs messages to /tmp/msgSends-[pid]. There’s even more customization that you can do with more hackery, but for now, this will suffice.

Original information on this can be found here: http://www.dribin.org/dave/blog/archives/2006/04/22/tracing_objc/

1 Comment »

  1. […] public links >> objc Even more ObjC-jutsu First saved by winx0938 | 3 days […]

    Pingback by Recent Faves Tagged With "objc" : MyNetFaves — 2008.08.20 @ 11:00 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress  •  Hosted by Kosada