Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 15, 2010, 6:14:37 PM (14 years ago)
Author:
landauf
Message:

added special implementation of abort() and _assert() for mingw which contain a break point.
also added displacement to the callstack

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/util/SignalHandler.h

    r7452 r7455  
    4343#include "SpecialConfig.h"
    4444
    45 namespace orxonox
    46 {
    47     typedef int (*SignalCallback)( void * someData );
    48 }
    49 
    5045#if defined(ORXONOX_PLATFORM_LINUX)
    5146
     
    5550namespace orxonox
    5651{
     52    typedef int (*SignalCallback)( void * someData );
     53
    5754    struct SignalRec
    5855    {
     
    109106    {
    110107        friend class Singleton<SignalHandler>;
    111     public:
    112         SignalHandler();
    113         ~SignalHandler();
    114108
    115         void doCatch( const std::string & appName, const std::string & filename );
     109        public:
     110            SignalHandler();
     111            ~SignalHandler();
    116112
    117         static std::string getStackTrace(PEXCEPTION_POINTERS pExceptionInfo = NULL);
    118         static std::string getExceptionType(PEXCEPTION_POINTERS pExceptionInfo);
     113            void doCatch(const std::string& appName, const std::string& filename);
    119114
    120     private:
    121         static LONG WINAPI exceptionFilter(PEXCEPTION_POINTERS pExceptionInfo);
     115            static std::string getStackTrace(PEXCEPTION_POINTERS pExceptionInfo = NULL);
     116            static std::string getExceptionType(PEXCEPTION_POINTERS pExceptionInfo);
    122117
    123         static std::string getModuleName(const std::string& path);
    124         static DWORD getModuleBase(DWORD dwAddress);
     118        private:
     119            static LONG WINAPI exceptionFilter(PEXCEPTION_POINTERS pExceptionInfo);
    125120
    126         template <typename T>
    127         static std::string pointerToString(T pointer);
    128         template <typename T>
    129         static std::string pointerToString(T* pointer);
     121            static std::string getModuleName(const std::string& path);
     122            static DWORD getModuleBase(DWORD dwAddress);
    130123
    131         static SignalHandler* singletonPtr_s;
     124            template <typename T>
     125            static std::string pointerToString(T pointer, bool bFillZeros = true);
     126            template <typename T>
     127            static std::string pointerToString(T* pointer);
    132128
    133         std::string filename_;
    134         LPTOP_LEVEL_EXCEPTION_FILTER prevExceptionFilter_;
     129            static SignalHandler* singletonPtr_s;
     130
     131            std::string filename_;
     132            LPTOP_LEVEL_EXCEPTION_FILTER prevExceptionFilter_;
    135133    };
    136134}
     
    144142    {
    145143        friend class Singleton<SignalHandler>;
    146     public:
    147         void doCatch( const std::string & appName, const std::string & filename ) {}
    148144
    149     private:
    150         static SignalHandler* singletonPtr_s;
     145        public:
     146            void doCatch(const std::string& appName, const std::string& filename) {}
     147
     148        private:
     149            static SignalHandler* singletonPtr_s;
    151150    };
    152151}
Note: See TracChangeset for help on using the changeset viewer.