MCPcopy Create free account
hub / github.com/Snapchat/Valdi / unwindCallback

Function unwindCallback

third-party/yoga/src/android/lyra/lyra.cpp:48–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46};
47
48_Unwind_Reason_Code unwindCallback(struct _Unwind_Context* context, void* arg) {
49 BacktraceState* state = reinterpret_cast<BacktraceState*>(arg);
50 auto absoluteProgramCounter =
51 reinterpret_cast<InstructionPointer>(_Unwind_GetIP(context));
52
53 if (state->skip > 0) {
54 --state->skip;
55 return _URC_NO_REASON;
56 }
57
58 if (state->stackTrace.size() == state->stackTrace.capacity()) {
59 return _URC_END_OF_STACK;
60 }
61
62 state->stackTrace.push_back(absoluteProgramCounter);
63
64 return _URC_NO_REASON;
65}
66
67void captureBacktrace(size_t skip, vector<InstructionPointer>& stackTrace) {
68 // Beware of a bug on some platforms, which makes the trace loop until the

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
capacityMethod · 0.45

Tested by

no test coverage detected