Determining the name of a method's caller
Determining the name of a method's caller
- Subject: Determining the name of a method's caller
- From: Stuart Malin <email@hidden>
- Date: Thu, 4 Feb 2010 12:52:53 -0500
I have tried to search for a technique to do this, but perhaps my searching skills are deficient. What I want to do is be able to write an NSLog() call in a method that emits information about the method that invoked the present method. This would serve me in debugging without needing to run gdb and put a break on the target method. I have run across content on the Web that suggests that the Google Toolbox for Mac has some such capability in GTMStackTrace, but while I did find GTMStackTrace.h, I didn't locate the implementation (.m) file.
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?_______________________________________________
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