From b3bb1fb9800b2d0b4d44892f4ff853e5060d975a Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 20 Jul 2016 15:11:14 +0200 Subject: Sleep on crash so we have time to attach a debugger. --- synchronizer/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp index 110e59c..dc23a51 100644 --- a/synchronizer/main.cpp +++ b/synchronizer/main.cpp @@ -29,6 +29,9 @@ #include #include #include +#include +#include +#include #include "listener.h" #include "log.h" @@ -100,6 +103,9 @@ void crashHandler(int signal) //Get the word out that we're going down listener->emergencyAbortAllConnections(); + std::cout << "Sleeping for 10s to attach a debugger: gdb attach " << getpid(); + std::this_thread::sleep_for(std::chrono::seconds(10)); + // std::system("exec gdb -p \"$PPID\" -ex \"thread apply all bt\""); // This only works if we actually have xterm and X11 available // std::system("exec xterm -e gdb -p \"$PPID\""); -- cgit v1.2.3