Wednesday, February 6, 2013

Block Debugging

Damien DeVille:

We are mostly interested about the first method argument (the third argument of the objc_msgSend function) which happens to be a stack block. Now, obviously we know exactly what the arguments, return value and body of this block are since we wrote it, but think if you were stepping through framework code and you find such an instance, you would have no idea. And from experience, the actual interesting bits often happen to be in that very block. Well, this is unfortunately where most people would stop investigating but it is also exactly where any debugging aficionado starts to have some fun!

Update (2013-02-07): Ole Begemann notes that in this case much of the introspection could have been done using CTBlockDescription. I agree that in most cases it’s better to put reusable functionality like this in code, rather than typing it into the debugger.

Comments RSS · Twitter

Leave a Comment