am e0e6409c: Merge "Add simple implementation _Unwind_GetIP() for clang compiles."

* commit 'e0e6409c12d21cf1f0390c435fd76e74b5c4580d':
  Add simple implementation _Unwind_GetIP() for clang compiles.
This commit is contained in:
Stephen Hines 2013-10-02 09:31:55 -07:00 committed by Android Git Automerger
commit dcffa9998e

View File

@ -80,6 +80,18 @@ struct stack_crawl_state_t {
} }
}; };
#if defined(__arm__) && !defined(_Unwind_GetIP)
// Older versions of Clang don't provide a definition of _Unwind_GetIP(), so
// we include an appropriate version of our own. Once we have updated to
// Clang 3.4, this code can be removed.
static __inline__
uintptr_t _Unwind_GetIP(struct _Unwind_Context *__context) {
uintptr_t __ip = 0;
_Unwind_VRS_Get(__context, _UVRSC_CORE, 15, _UVRSD_UINT32, &__ip);
return __ip & ~0x1;
}
#endif
static _Unwind_Reason_Code trace_function(__unwind_context* context, void* arg) { static _Unwind_Reason_Code trace_function(__unwind_context* context, void* arg) {
stack_crawl_state_t* state = static_cast<stack_crawl_state_t*>(arg); stack_crawl_state_t* state = static_cast<stack_crawl_state_t*>(arg);