我正在阅读关于在android的本机代码中执行打印堆栈跟踪的代码,我发现了以下代码:
ssize_t unwind_backtrace(backtrace_frame_t* backtrace, size_t ignore_depth, size_t max_depth) {
ALOGV("Unwinding current thread %d.", gettid());
map_info_t* milist = acquire_my_map_info_list();
backtrace_state_t state;
state.backtrace = backtrace;
state.ignore_depth = ignore_depth;
state.max_depth = max_depth;
state.ignored_frames = 0;
state.returned_frames = 0;
init_memory(&state.memory, milist);
_Unwind_Reason_Code rc = _Unwind_Backtrace(unwind_backtrace_callback, &state);
release_my_map_info_list(milist);
if (state.returned_frames) {
return state.returned_frames;
}
return rc == _URC_END_OF_STACK ? 0 : -1;
}
但是我找不到_Unwind_Backtrace
中http://androidxref.com/4.4.2_r2/的实现,有什么机构知道吗? _Unwind_Backtrace
的实施在哪里?
对于android 4.4,unwind_backtrace
在/system/core/libcorkscrew/backtrace.c