/******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: acserrHandlers.cpp,v 1.13 2012/01/20 22:07:43 tstaig Exp $" * * who when what * -------- ---------- ---------------------------------------------- * bjeram yyyy-mm-dd created */ #include "vltPort.h" #include "acserrHandlers.h" #include #if !defined (MAKE_VXWORKS) && !defined(__CYGWIN__) #include #endif static char *rcsId="@(#) $Id: acserrHandlers.cpp,v 1.13 2012/01/20 22:07:43 tstaig Exp $"; static void *use_rcsId = ((void)&use_rcsId,(void *) &rcsId); #ifndef MAKE_VXWORKS const unsigned int ACSErrmaxBackTraceDepth=255; #endif using namespace acserrHandlersErr; // this class it is used just to inform acserrUncaughtExHandler // from UnspecifiedEhHandler, in other words to hide ACSbaseExImpl // = to prevent that exception is porpagated through the call chain where unspecified exception was thrown class UnspecException { public: UnspecException(acserrHandlersErrExImpl& _ex) : unspecEx(_ex){} acserrHandlersErrExImpl unspecEx; }; /** * helper function that adds back trace info to the exception * and releases the array of strings that contains the back trace */ #if !defined (MAKE_VXWORKS) && !defined(__CYGWIN__) void addBackTrace2Exception(ACSErr::ACSbaseExImpl &ex, char **backTraceString, size_t backTraceSize) { char backTraceLevel[4]; if (backTraceString!=NULL) { for(size_t i=0; isi_errno) << ", code = " << info->si_code << ". Code interpretation = "; if(info->si_code == SEGV_MAPERR) { std::cout << "address not mapped to object"; } else if(info->si_code == SEGV_ACCERR) { std::cout << "invalid permissions for mapped object"; } else { std::cout << "unknown code"; } std::cout << ". Date/Time = " << myTimeStamp << "\n"; } #endif //!MAKE_VXWORKS /*___oOo___*/