Re: Determining the name of a method's caller
Re: Determining the name of a method's caller
- Subject: Re: Determining the name of a method's caller
- From: "Stephen J. Butler" <email@hidden>
- Date: Thu, 4 Feb 2010 12:14:19 -0600
On Thu, Feb 4, 2010 at 11:52 AM, Stuart Malin <email@hidden> wrote:
> I'm wondering if this will be hard to do because of the need to access registers and the stack. If so, perhaps there is some C (or even assembler?) code that I can use as guidance on effecting this. Or have I in my mind overcomplicated this task?_______________________________________________
10.5 added the backtrace family of calls (man backtrace). No idea what
they return from inside Obj-C code, but since Obj-C methods are C
functions I assume you'll get something legible.
Personally, I'd work around this in my code. Maybe a macro that looks
at _cmd? Or add a parameter to your function call to pass in the _cmd
of the caller. I imagine backtrace in every log call might have a high
overhead.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden