MCPcopy Create free account
hub / github.com/FastLED/FastLED / setup_crash_handler

Function setup_crash_handler

tests/crash_handler_execinfo.h:71–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71inline void setup_crash_handler() {
72 // Check if crash handler should be disabled (for debugger attachment)
73 const char* disable_handler = getenv("FASTLED_DISABLE_CRASH_HANDLER");
74 if (disable_handler && (strcmp(disable_handler, "1") == 0 || strcmp(disable_handler, "true") == 0)) {
75 printf("Crash handler disabled (FASTLED_DISABLE_CRASH_HANDLER set)\n");
76 printf("This allows external debuggers to attach for deadlock detection.\n");
77 return;
78 }
79
80 // Set up POSIX signal handlers
81 signal(SIGABRT, crash_handler);
82 signal(SIGFPE, crash_handler);
83 signal(SIGILL, crash_handler);
84 signal(SIGINT, crash_handler);
85 signal(SIGSEGV, crash_handler);
86 signal(SIGTERM, crash_handler);
87
88 // execinfo.h backtrace is ready to use
89}
90
91inline void print_stacktrace() {
92 print_stacktrace_execinfo();

Callers

nothing calls this directly

Calls 3

getenvFunction · 0.85
strcmpFunction · 0.85
printfFunction · 0.85

Tested by

no test coverage detected