• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Tool for inserting hooks into Obj-C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Tool for inserting hooks into Obj-C? (From: Jonathan del Strother <email@hidden>)

  • Prev by Date: Re: Saving extra data using Core Data
  • Next by Date: Re: Converting HIPoints to CGPoints/NSPoints in global space?
  • Previous by thread: Tool for inserting hooks into Obj-C?
  • Next by thread: is it a bug in NSNetService?
  • Index(es):
    • Date
    • Thread