Checkpoint

This commit is contained in:
Robin E. R. Davies
2025-08-01 18:24:54 -04:00
parent af5b1542b1
commit aa13301b84
16 changed files with 415 additions and 388 deletions
+25
View File
@@ -106,6 +106,27 @@ static bool isJackServiceRunning()
// }
#endif
#define ENABLE_SEGV_DEBUG 0
#if ENABLE_SEGV_DEBUG
void debug_segvHandler(int sig)
{
// Print out all the frames to stderr
const char *message = "Error: SEGV signal received.\n";
auto _ = write(STDERR_FILENO, message, strlen(message));
_exit(EXIT_FAILURE);
}
static void EnableDebugSevHandler()
{
signal(SIGSEGV, debug_segvHandler);
signal(SIGILL, debug_segvHandler);
signal(SIGKILL, debug_segvHandler);
}
#endif
static bool TryGetLogLevel(const std::string &strLogLevel, LogLevel *result)
{
if (strLogLevel == "debug")
@@ -331,9 +352,13 @@ int main(int argc, char *argv[])
while (sigtimedwait(&sigSet, NULL, &timeout) > 0) {
// Consume any pending signals
}
#if ENABLE_SEGV_DEBUG
EnableDebugSevHandler();
#endif
PiPedalModel model;
model.SetNetworkChangedListener(
[&server]() mutable
{