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

Function JSWriteDump

engine/crash/src/backtrace_web.cpp:79–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79extern "C" void JSWriteDump(char* json_stacktrace) {
80 if (!g_CrashDumpEnabled)
81 return;
82
83 dmCrash::AppState* state = dmCrash::GetAppState();
84
85 state->m_PtrCount = 0;
86 state->m_Signum = 0xDEAD;
87 int length = strlen(json_stacktrace);
88 uint32_t len = dmMath::Min((dmCrash::AppState::EXTRA_MAX - 1), (uint32_t)length);
89 strncpy(state->m_Extra, json_stacktrace, len);
90 if (g_CrashExtraInfoCallback)
91 {
92 int extra_len = strlen(state->m_Extra);
93 g_CrashExtraInfoCallback(g_CrashExtraInfoCallbackCtx, state->m_Extra + extra_len, dmCrash::AppState::EXTRA_MAX - extra_len - 1);
94 }
95 dmCrash::WriteCrash(dmCrash::GetFilePath(), state);
96
97 // It's more convenient to get message as one error for web, so we don't use dmCrash::LogCallstack()
98 bool is_debug_mode = dLib::IsDebugMode();
99 dLib::SetDebugMode(true);
100 dmLogError("CALL STACK:\n%s\nCALL STACK END", state->m_Extra);
101 dLib::SetDebugMode(is_debug_mode);
102}

Callers 1

WriteDumpMethod · 0.70

Calls 6

MinFunction · 0.85
IsDebugModeFunction · 0.85
SetDebugModeFunction · 0.85
GetAppStateFunction · 0.70
WriteCrashFunction · 0.70
GetFilePathFunction · 0.70

Tested by

no test coverage detected