Re: Runtime messages
Re: Runtime messages
- Subject: Re: Runtime messages
- From: David Remahl <email@hidden>
- Date: Sat, 26 Oct 2002 20:09:02 +0200
>
But when you apply this same technique to obj_msgSend(), this doesn't
>
work in general because of the obfuscated way these functions can pass
>
their parameters. (You shouldn't think of this obfuscation as
>
necessarily bad--it makes these functions efficient which we all really
>
really want!) Put simply, fixed integer offsets don't always point to
>
the desired parameters for all functions/methods.
>
>
There was another approach we considered which could succeed where the
>
gdb approach fails. (Also, it is unproven, and is considerably more
>
work).
>
>
Starting with Darwin's objc runtime project, write your own version of
>
objc runtime which harvests the info you seek, and load this dylib
>
before the default ObjC runtime by specifying its path at the front of
>
your DYLD_LIBRARY_PATH.
When objc_msgSend(id,sel) is called, the object is in $r3 and the selector
is in $r4, as Ondra already pointed out. You can assign a command to run
when a breakpoint is hit in gdb. Assign one to objc_msgSend, and make it:
po NSStringFromSelector($r4)
po $r3
The amount of messages generated, however, is _massive_ and you probably
don't want this.
/ rgds, David
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.