Re: [Pyobjc-dev] instrumentObjcMessageSends
Brought to you by:
ronaldoussoren
|
From: Michael M. <mic...@gm...> - 2008-01-07 23:09:15
|
On Jan 6, 2008 11:10 PM, Ronald Oussoren <ron...@ma...> wrote: > > On 6 Jan, 2008, at 21:21, Jon Christopher wrote: > > > Many apologies if this is the wrong place to ask this question, but I > > couldn't find anywhere else. > > > > I'd like to call the instrumentObjcMessageSends(YES) function which > > is part of the objc runtime so that I can log all objc-messages, but I > > can't figure out how to access it from python. > > This function has the same effect as NSObjCMessageLoggingEnabled=TRUE > > (see http://developer.apple.com/technotes/tn2004/tn2124.html) > > > > I can create and call objc classes, but instrumentObjcMessageSends is > > a free function. I'd appreciate any pointers as to how to call this > > function, or runtime free functions in general, for that matter. > > You cannot easily call runtime functions. Because > instrumentObjcMessageSends isn't a public API I won't add it to PyObjC. > > It should be possible to call it using objc.loadBundleFunctions, but I > don't have time to look into that right now. > Wouldn't it be possible to just wrap that function with a C extension module? Or if you really want every message send, just add it to your main.m? -mike (PS, sorry Ronald for the accidental double-reply.) -- Michael McCracken UCSD CSE PhD Candidate research: http://www.cse.ucsd.edu/~mmccrack/ misc: http://michael-mccracken.net/wp/ |