diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-20 15:11:14 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-15 16:14:19 +0200 |
commit | b3bb1fb9800b2d0b4d44892f4ff853e5060d975a (patch) | |
tree | d183c27f83b9320b441698a69ebbb3334d9f1fc9 | |
parent | a3dd197299fc9315af809b11a0428a40d1e59203 (diff) | |
download | sink-b3bb1fb9800b2d0b4d44892f4ff853e5060d975a.tar.gz sink-b3bb1fb9800b2d0b4d44892f4ff853e5060d975a.zip |
Sleep on crash so we have time to attach a debugger.
-rw-r--r-- | synchronizer/main.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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 @@ | |||
29 | #include <dlfcn.h> | 29 | #include <dlfcn.h> |
30 | #include <ostream> | 30 | #include <ostream> |
31 | #include <sstream> | 31 | #include <sstream> |
32 | #include <thread> | ||
33 | #include <chrono> | ||
34 | #include <unistd.h> | ||
32 | 35 | ||
33 | #include "listener.h" | 36 | #include "listener.h" |
34 | #include "log.h" | 37 | #include "log.h" |
@@ -100,6 +103,9 @@ void crashHandler(int signal) | |||
100 | //Get the word out that we're going down | 103 | //Get the word out that we're going down |
101 | listener->emergencyAbortAllConnections(); | 104 | listener->emergencyAbortAllConnections(); |
102 | 105 | ||
106 | std::cout << "Sleeping for 10s to attach a debugger: gdb attach " << getpid(); | ||
107 | std::this_thread::sleep_for(std::chrono::seconds(10)); | ||
108 | |||
103 | // std::system("exec gdb -p \"$PPID\" -ex \"thread apply all bt\""); | 109 | // std::system("exec gdb -p \"$PPID\" -ex \"thread apply all bt\""); |
104 | // This only works if we actually have xterm and X11 available | 110 | // This only works if we actually have xterm and X11 available |
105 | // std::system("exec xterm -e gdb -p \"$PPID\""); | 111 | // std::system("exec xterm -e gdb -p \"$PPID\""); |