On Apr 21, 2009, at 11:27 AM, Alastair Houghton wrote:
On 21 Apr 2009, at 15:59, Michael Ash wrote:
On Tue, Apr 21, 2009 at 2:09 AM, Alex Kac <a...@webis.net> wrote:
I am trying to log some specific error conditions in a fairly dynamic environment (of course Obj-C's forté), and would like to log some sort of
backtrace of method calls that reached a specific method.

What is the best way to get that info? This is using Objective-C 2.0 on the
iPhone.

Type man backtrace for a handy function for this. I'm not sure if it's available on the iPhone, but I would expect so, and it's worth a shot.

If it isn't available, there's always __builtin_return_address(), though you do need to be aware that it's only suitable for debugging purposes.

As are all the other methods discussed here. Backtraces can not be reliably generated from optimized code, no matter how you generate them. By that same token, expecting a symbol to be available and valid for the return address is pretty dubious outside of fully symbol'd debug builds.

-Ed

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to