Memosa-FVM  0.2
CException Class Reference

#include <CException.h>

Inheritance diagram for CException:
Collaboration diagram for CException:

Public Member Functions

 CException (const string &what)
 
virtual ~CException () throw ()
 

Detailed Description

Definition at line 16 of file CException.h.

Constructor & Destructor Documentation

CException::CException ( const string &  what)

Definition at line 17 of file CException.cpp.

17  :
18  runtime_error(what)
19 {
20 #if 1
21 #ifdef __GNUC__
22  void *traces[100];
23  cout << "Backtrace... " << endl;
24  int traceCount = backtrace(traces,20);
25  char **traceStrings = backtrace_symbols(traces, traceCount);
26 
27  if(traceStrings != NULL)
28  {
29  for(int x = 0; x < traceCount; x++)
30  {
31  if (traceStrings[x] == NULL) { break; }
32  int status;
33  string s(traceStrings[x]);
34  size_t funcNameBegin = s.find("(");
35  size_t funcNameEnd = s.find("+");
36  if (funcNameBegin != string::npos &&
37  funcNameEnd != string::npos)
38  {
39  string funcNameMangled(s.begin()+funcNameBegin+1,
40  s.begin()+funcNameEnd);
41 
42  string fileName(s.begin(),s.begin()+funcNameBegin);
43 
44  string offset(s.begin() + funcNameEnd, s.end());
45 
46  char *realName = abi::__cxa_demangle(funcNameMangled.c_str(), 0, 0, &status);
47 
48  std::cout << x << " : " << realName << endl;
49  free(realName);
50  }
51  else
52  std::cout << x << " : " << s << endl;
53  }
54  }
55  cout << "Backtrace...end " << endl;
56  cout << flush;
57  free(traceStrings);
58 #endif
59 #endif
60 
61 }
virtual CException::~CException ( )
throw (
)
inlinevirtual

Definition at line 20 of file CException.h.

20 {}

The documentation for this class was generated from the following files: