Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Why no execinfo.h?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why no execinfo.h?



On Apr 20, 2006, at 9:42 PM, Rush Manbert wrote:

This is addressed to the Apple Gods of Xcode (AGX) who read this list.

I see that we can use __builtin_return_address() and __builtin_frame_address(), but I would also like to use backtrace() and backtrace_symbols().

When I try, the compiler tells me that it can't find the file execinfo.h. Is there a reason that this (and presumably the functions I want) is excluded from the system?

Alternatively, if I have a return address, is there a runtime lookup mechanism to resolve it to a symbol + offset?

backtrace and backtrace_symbols are Linux-specific APIs (more properly, they're glibc-specific). So they're not so much "excluded" as not part of Mac OS X (or FreeBSD, Solaris, etc.) to begin with. dladdr might give you want on Mac OS X and so might the NSModule man page, but we don't currently provide a generic backtracing or backtrace+symbols API on the system.


Hope this helps,
Eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Why no execinfo.h? (From: Rush Manbert <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.