MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / initCrashHandler

Function initCrashHandler

src/main.cpp:68–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66#endif
67
68bool initCrashHandler(const char* exePath) {
69#ifndef NO_CRASH_HANDLER
70 QFile crashDmp(STACKTRACE_LOG);
71
72 bool lastSessionCrashed = false;
73 if(crashDmp.exists() && crashDmp.open(QFile::ReadOnly | QFile::Text))
74 {
75 QTextStream in(&crashDmp);
76 auto lastDmp = in.readAll();
77 crashDmp.close();
78
79 if(lastDmp.length() > 10)
80 {
81 lastSessionCrashed = true;
82 crashDmp.copy(STACKTRACE_LOG_OLD);
83 Log::backupLastLog();
84 }
85 }
86
87 EXECUTION_FILENAME = exePath;
88 airbag_init_fd(safe_open_wo_fd("/tmp/jamesdsp/crash.dmp"), onExceptionRaised, EXECUTION_FILENAME);
89 return lastSessionCrashed;
90#else
91 return false;
92#endif
93}
94
95#ifndef HEADLESS
96void initTranslator(const QLocale& locale) {

Callers 1

mainFunction · 0.85

Calls 5

airbag_init_fdFunction · 0.85
safe_open_wo_fdFunction · 0.85
lengthMethod · 0.80
existsMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected