11 #error *****IsisDebug.h MUST be included before any system header files!*****
14 void startMonitoringMemory();
15 void stopMonitoringMemory();
16 void SegmentationFault(
int);
18 void InterruptSignal(
int);
25 #include <libcwd/sys.h>
26 #include <libcwd/debug.h>
40 #include "Constants.h"
45 #define ASSERT_PTR(x) \
46 if (libcwd::test_delete(x)) \
48 std::cerr << ">> " << __FILE__ << ":" << __LINE__ << \
49 " error: ASSERT POINTER " << #x << " FAILED\n"; \
52 class MyMutex :
public QMutex {
76 static void GetStackTrace(std::vector<std::string> *stackTraceResult) {
77 stackTraceResult->clear();
78 const int MAX_STACK_DEPTH = 1024;
80 void *stackTrace[MAX_STACK_DEPTH];
81 int stackSize = backtrace(stackTrace, MAX_STACK_DEPTH);
83 for(
int stackEl = 2; stackEl < stackSize; stackEl ++) {
84 std::string currElement;
85 void *addr = stackTrace[stackEl];
87 libcwd::location_ct addrInfo(addr);
88 std::string demangled_name;
89 libcwd::demangle_symbol(addrInfo.mangled_function_name(), demangled_name);
93 if(addrInfo.is_known()) {
95 std::string(addrInfo.file()) +
98 std::string(
" --- ") +
102 currElement +=
"?????:0 --- " + demangled_name;
105 stackTraceResult->push_back(currElement);
111 #define ASSERT_PTR(x)
121 static void GetStackTrace(
const void *) {}
130 std::cerr << ">> " << __FILE__ << ":" << __LINE__ << \
131 " error: ASSERT " << #x << " FAILED\n"; \