ADTF
exceptionhandler.h
Go to the documentation of this file.
1 
7 #ifndef EXCEPTION_HANDLER
8 #define EXCEPTION_HANDLER
9 
10 namespace A_UTILS_NS
11 {
12 
21 {
22  public:
24  typedef tVoid (*fnAdditionalAction)(const tChar* strBaseName, tBool bAskUser);
25 
26  public:
34  static tBool RegisterExceptionHandler(const tChar* strApplicationName, const tChar* strSupportContact, tBool bDontAsk = tFalse);
35 
42 
48 
55  static tBool GetCallStack(cString& strCallStack, tInt nDepth = 10);
56 
64  static tCallStack GetCallStack(tInt nDepth = 10, tVoid* pBuffer = nullptr);
65 
72  static tVoid FreeCallStack(tCallStack& sStack);
73 
79  static tCallStack CopyCallStack(const tCallStack& sStack);
80 
85  {
86  public:
98  virtual tResult HandleFrame(tVoid* pAddress,
99  const tChar* strModule,
100  const tChar* strFunction,
101  const tChar* strFile,
102  tInt nLine) = 0;
103  };
104 
113  static tResult ResolveCallStack(IStackResolveCallback* pCallback, const tCallStack& sStack);
114 };
115 
116 }
117 
118 #endif
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
void tVoid
The tVoid is always the definition for the void (non-type).
int tInt
type definition for signed integer value (platform and compiler dependent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
virtual tResult HandleFrame(tVoid *pAddress, const tChar *strModule, const tChar *strFunction, const tChar *strFile, tInt nLine)=0
This will be called for each stack frame.
The cExceptionHandler class provides static methods for registration and unregistration of a exceptio...
static tBool RegisterExceptionHandler(const tChar *strApplicationName, const tChar *strSupportContact, tBool bDontAsk=tFalse)
Registers the exception handler.
static tVoid FreeCallStack(tCallStack &sStack)
Releases resources obtained through a cExceptionHandler::GetCallStack call.
static fnAdditionalAction SetAdditionalAction(fnAdditionalAction pAction)
Registers an additional handler that is called when a crash occurs.
static tBool UnregisterExceptionHandler()
Unregisters the exception handler;.
static tCallStack GetCallStack(tInt nDepth=10, tVoid *pBuffer=nullptr)
Retrieve the current call stack trace.
tVoid(* fnAdditionalAction)(const tChar *strBaseName, tBool bAskUser)
Type for additional actions when an exception occurs.
static tResult ResolveCallStack(IStackResolveCallback *pCallback, const tCallStack &sStack)
This will resolve symbol information from a stack trace.
static tCallStack CopyCallStack(const tCallStack &sStack)
Copies the call stack.
static tBool GetCallStack(cString &strCallStack, tInt nDepth=10)
Returns the call stack.
#define tFalse
Value for tBool.
Definition: constants.h:60
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
Definition: d_ptr.h:11
Respresentation for a Call stack trace.