Checkpoint
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user