MCPcopy Create free account
hub / github.com/defold/defold / Handler

Function Handler

engine/crash/src/backtrace_libunwind_ndk.cpp:99–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 }
98
99 static void Handler(const int signo, siginfo_t* const si, void *const sc)
100 {
101 bool first_signal_handler = BeginSignalHandler();
102
103 // The default behavior is restored for the signal.
104 // Unless this is done first thing in the signal handler we'll
105 // be stuck in a signal-handler loop forever.
106 ResetToDefaultSignalHandler(signo);
107
108 if (g_CrashDumpEnabled && first_signal_handler)
109 {
110 AppState* state = GetAppState();
111
112 state->m_Signum = signo;
113 state->m_PtrCount = 0;
114
115 unwind_data unwindData;
116 unwindData.offset_extra = 0;
117 unwindData.stack_index = 0;
118 _Unwind_Backtrace(OnFrameEnter, &unwindData);
119
120 if (g_CrashExtraInfoCallback)
121 {
122 int extra_len = strlen(state->m_Extra);
123 g_CrashExtraInfoCallback(g_CrashExtraInfoCallbackCtx, state->m_Extra + extra_len, dmCrash::AppState::EXTRA_MAX - extra_len - 1);
124 }
125
126 WriteCrash(GetFilePath(), state);
127
128 bool is_debug_mode = dLib::IsDebugMode();
129 dLib::SetDebugMode(true);
130 dmLogError("CALL STACK:\n\n%s\n", state->m_Extra);
131 dLib::SetDebugMode(is_debug_mode);
132 }
133
134 if (first_signal_handler)
135 {
136 ChainSignalOrRaiseDefault(signo, si, sc, g_PreviousSignalActions, Handler);
137 EndSignalHandler();
138 }
139 }
140
141 void WriteDump()
142 {

Callers 1

WriteDumpFunction · 0.70

Calls 9

BeginSignalHandlerFunction · 0.85
IsDebugModeFunction · 0.85
SetDebugModeFunction · 0.85
EndSignalHandlerFunction · 0.85
GetAppStateFunction · 0.70
WriteCrashFunction · 0.70
GetFilePathFunction · 0.70

Tested by

no test coverage detected