00001 #ifndef _GEMFIRE_SIGNALHANDLER_HPP_
00002 #define _GEMFIRE_SIGNALHANDLER_HPP_
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "gfcpp_globals.hpp"
00012 #include "Exception.hpp"
00013
00017 #ifdef _WIN32
00018 struct _EXCEPTION_POINTERS;
00019 typedef _EXCEPTION_POINTERS EXCEPTION_POINTERS;
00020 #endif
00021
00022 namespace gemfire
00023 {
00024
00025 class DistributedSystem;
00026
00031 class CPPCACHE_EXPORT SignalHandler
00032 {
00033 private:
00034 static int s_waitSeconds;
00035
00036 static void init(bool crashDumpEnabled, const char* crashDumpLocation,
00037 const char* crashDumpPrefix);
00038
00039 friend class DistributedSystem;
00040
00041 public:
00046 static void installBacktraceHandler();
00047
00052 static void removeBacktraceHandler();
00056 static bool getCrashDumpEnabled();
00060 static const char* getCrashDumpLocation();
00064 static const char* getCrashDumpPrefix();
00065
00070 static void dumpStack(char* dumpFile, size_t maxLen);
00071
00072 #ifdef _WIN32
00073
00078 static void dumpStack(unsigned int expCode, EXCEPTION_POINTERS* pExp,
00079 char* dumpFile, size_t maxLen);
00080
00081 static void * s_pOldHandler;
00082
00083 #endif
00084
00087 static void waitForDebugger();
00088 };
00089
00090 }
00091
00092 #endif
00093