Re: Runtime messages
Re: Runtime messages
- Subject: Re: Runtime messages
- From: OS X AIBO <email@hidden>
- Date: Sat, 26 Oct 2002 13:49:04 -0700 (PDT)
Yeah, that's the ticket!
Since you won't want all of the autoreleased NSStrings, you'll want to
use the objc runtime funcs, but whatever. The following works well,
albeit slowly.
break objc_msgSend
commands
silent
printf "%s %s\n", (char *)object_getClassName($r3), (char
*)sel_getName($r4)
continue
end
--- David Remahl <email@hidden> wrote:
>
> 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.
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/
_______________________________________________
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.