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

Function setup_crash_handler

tests/crash_handler_libunwind.h:79–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79inline void setup_crash_handler() {
80 // Check if crash handler should be disabled (for debugger attachment)
81 const char* disable_handler = getenv("FASTLED_DISABLE_CRASH_HANDLER");
82 if (disable_handler && (strcmp(disable_handler, "1") == 0 || strcmp(disable_handler, "true") == 0)) {
83 printf("Crash handler disabled (FASTLED_DISABLE_CRASH_HANDLER set)\n");
84 printf("This allows external debuggers to attach for deadlock detection.\n");
85 return;
86 }
87
88 // Set up POSIX signal handlers
89 signal(SIGABRT, crash_handler);
90 signal(SIGFPE, crash_handler);
91 signal(SIGILL, crash_handler);
92 signal(SIGINT, crash_handler);
93 signal(SIGSEGV, crash_handler);
94 signal(SIGTERM, crash_handler);
95
96 // libunwind is ready to use
97}
98
99inline void print_stacktrace() {
100 print_stacktrace_libunwind();

Callers

nothing calls this directly

Calls 3

getenvFunction · 0.85
strcmpFunction · 0.85
printfFunction · 0.85

Tested by

no test coverage detected