| 56 | }; |
| 57 | |
| 58 | static _Unwind_Reason_Code unwindCallback(struct _Unwind_Context* context, void* arg) { |
| 59 | BacktraceState* state = static_cast<BacktraceState*>(arg); |
| 60 | uintptr_t pc = _Unwind_GetIP(context); |
| 61 | if (pc) { |
| 62 | if (state->current == state->end) { |
| 63 | return _URC_END_OF_STACK; |
| 64 | } else { |
| 65 | *state->current++ = reinterpret_cast<void*>(pc); |
| 66 | } |
| 67 | } |
| 68 | return _URC_NO_REASON; |
| 69 | } |
| 70 | |
| 71 | static int backtrace(void** buffer, size_t max) { |
| 72 | BacktraceState state = {buffer, buffer + max}; |
nothing calls this directly
no outgoing calls
no test coverage detected