views:

23

answers:

1

I'm trying to figure out when [NSView setNeedsDisplay] is called for a particular object. I want to set a breakpoint on it that fires only when the self pointer refers to the object I care about. The method is called probably hundreds of times around the time it's called for my object, so something like a breakpoint condition is necessary.

As far as I can see the "self" pointer isn't consistently in any particular register at the entry point of a function. Can this be done?

+1  A: 

This depends on the architecture. The receiver (self) is the first argument to the objc_msgSend function (and gets passed to the method without modification). On x86_64 that's in $rdi, on i386 in *(id*)($ebp + 8).

Nikolai Ruhe