MCPcopy Create free account
hub / github.com/RicardoJiang/android-performance / unwind_callback

Function unwind_callback

memory-hook/src/main/cpp/MemoryHook.cpp:24–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22};
23
24static _Unwind_Reason_Code unwind_callback(struct _Unwind_Context *context, void *data) {
25 auto *state = (struct backtrace_stack *) (data);
26 uintptr_t pc = _Unwind_GetIP(context); // 获取 pc 值,即绝对地址
27 if (pc) {
28 if (state->current == state->end) {
29 return _URC_END_OF_STACK;
30 } else {
31 *state->current++ = (void *) (pc);
32 }
33 }
34 return _URC_NO_REASON;
35}
36
37static size_t fill_backtraces_buffer(void **buffer, int max) {
38 struct backtrace_stack stack = {buffer, buffer + max};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected