MCPcopy Create free account
hub / github.com/beefytech/Beef / Crashed

Function Crashed

BeefySysLib/platform/posix/PosixCommon.cpp:482–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480}
481
482static void Crashed()
483{
484 //
485 {
486 AutoCrit autoCrit(BfpGetGlobalData()->mSysCritSect);
487
488 String debugDump;
489
490 debugDump += "**** FATAL APPLICATION ERROR ****\n";
491
492 for (auto func : BfpGetGlobalData()->mCrashInfoFuncs)
493 func();
494
495 if (!BfpGetGlobalData()->mCrashInfo.IsEmpty())
496 {
497 debugDump += BfpGetGlobalData()->mCrashInfo;
498 debugDump += "\n";
499 }
500
501 BFP_ERRPRINTF("%s", debugDump.c_str());
502 }
503
504 if (!FancyBacktrace())
505 {
506#ifdef BFP_HAS_EXECINFO
507 void* array[64];
508 size_t size;
509 char** strings;
510 size_t i;
511
512 size = backtrace(array, 64);
513 strings = backtrace_symbols(array, size);
514
515 for (i = 0; i < size; i++)
516 BFP_ERRPRINTF("%s\n", strings[i]);
517
518 free(strings);
519#endif
520 }
521
522 exit(1);
523}
524
525static void SigHandler(int sig)
526{

Callers 2

SigHandlerFunction · 0.85
BfpSystem_FatalErrorFunction · 0.85

Calls 5

BfpGetGlobalDataFunction · 0.85
FancyBacktraceFunction · 0.85
freeFunction · 0.50
IsEmptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected