Re: Tool for inserting hooks into Obj-C?
Re: Tool for inserting hooks into Obj-C?
- Subject: Re: Tool for inserting hooks into Obj-C?
- From: Damien Bobillot <email@hidden>
- Date: Sun, 12 Feb 2006 22:07:16 +0100
Jonathan del Strother wrote :
A few months ago, I noticed a debugging tool that (IIRC) could
insert arbitrary code into Obj-C applications - for example,
logging at the start of every single message.
Of course, I didn't bookmark it, and now I have no idea what it was
called - anyone know what I'm talking about?
You may add a symbolic breakpoint on objc_msgSend with a condition on
the selector (something like "$r4 == 0xXXXXXXXX" where 0xXXXXXXXX is
the result of the gdb command "p/x sel_getUid
("aSelectorWithParam:")"). I've never used it, but it should work
(perhaps with some changes).
You may also create a subclass S of the class C you want to monitor,
override somes methods to add some debugging stuff, and replace C by
S at the beginning of your main() function (see -[NSOject
poseAsClass:] and http://www.cocoadev.com/index.pl?ClassPosing).
--
Damien Bobillot
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden