H:/gfcppsancout/product/include/gfcpp/SignalHandler.hpp

Go to the documentation of this file.
00001 #ifndef _GEMFIRE_SIGNALHANDLER_HPP_
00002 #define _GEMFIRE_SIGNALHANDLER_HPP_
00003 /*=========================================================================
00004  * (c) Copyright 2002-2007, GemStone Systems, Inc. All Rights Reserved.  
00005  * 1260 NW Waterhouse Ave., Suite 200,  Beaverton, OR 97006
00006  *=========================================================================
00007  */
00008 
00009 #include "gfcpp_globals.hpp"
00010 #include "Exception.hpp"
00011 
00015 #ifdef _WIN32
00016 struct _EXCEPTION_POINTERS;
00017 typedef _EXCEPTION_POINTERS EXCEPTION_POINTERS;
00018 #endif
00019 
00020 namespace gemfire
00021 {
00022 
00023   class DistributedSystem;
00024 
00027   class CPPCACHE_EXPORT SignalHandler
00028   {
00029   private:
00030     static int s_waitSeconds;
00031 
00032     static void init(bool crashDumpEnabled, const char* crashDumpLocation,
00033         const char* crashDumpPrefix);
00034 
00035     friend class DistributedSystem;
00036 
00037   public:
00042     static void installBacktraceHandler();
00043 
00048     static void removeBacktraceHandler();
00049 
00050     static bool getCrashDumpEnabled();
00051 
00052     static const char* getCrashDumpLocation();
00053 
00054     static const char* getCrashDumpPrefix();
00055 
00060     static void dumpStack(char* dumpFile, size_t maxLen);
00061 
00062 #ifdef _WIN32
00063 
00068     static void dumpStack(unsigned int expCode, EXCEPTION_POINTERS* pExp,
00069         char* dumpFile, size_t maxLen);
00070 
00071 #endif
00072 
00075     static void waitForDebugger();
00076   };
00077 
00078 }
00079 
00080 #endif
00081 

GemFire C++ Cache API Documentation