build-artifacts/win/product/include/gfcpp/SignalHandler.hpp

Go to the documentation of this file.
00001 #ifndef _GEMFIRE_SIGNALHANDLER_HPP_
00002 #define _GEMFIRE_SIGNALHANDLER_HPP_
00003 /*=========================================================================
00004  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.  
00005  * This product is protected by U.S. and international copyright
00006  * and intellectual property laws. Pivotal products are covered by
00007  * more patents listed at http://www.pivotal.io/patents.
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 

GemFire C++ Cache API Documentation