Changeset 2221
- Timestamp:
- 06/08/2008 19:28:10 (5 months ago)
- Files:
-
- 1 modified
-
box/trunk/lib/common/Utils.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/common/Utils.cpp
r2187 r2221 69 69 void DumpStackBacktrace() 70 70 { 71 void *array[10]; 72 size_t size; 73 char **strings; 74 size_t i; 75 76 size = backtrace (array, 10); 77 strings = backtrace_symbols (array, size); 71 void *array[10]; 72 size_t size = backtrace (array, 10); 73 char **strings = backtrace_symbols (array, size); 78 74 79 75 BOX_TRACE("Obtained " << size << " stack frames."); 80 76 81 size_t output_len = 256; 82 char* output_buf = new char [output_len]; 83 84 for(i = 0; i < size; i++) 77 for(size_t i = 0; i < size; i++) 85 78 { 86 79 // Demangling code copied from … … 98 91 int status; 99 92 93 #include "MemLeakFindOff.h" 100 94 char* result = abi::__cxa_demangle(mangled_func.c_str(), 101 output_buf, &output_len, &status); 95 NULL, NULL, &status); 96 #include "MemLeakFindOn.h" 102 97 103 98 if (result == NULL) … … 138 133 else 139 134 { 140 output_buf = result;141 135 output_frame = mangled_frame.substr(0, start + 1) + 142 // std::string(output_buf.get()) +143 136 result + mangled_frame.substr(end); 137 #include "MemLeakFindOff.h" 138 std::free(result); 139 #include "MemLeakFindOn.h" 144 140 } 145 141 #endif // HAVE_CXXABI_H … … 148 144 } 149 145 150 delete [] output_buf;151 152 146 #include "MemLeakFindOff.h" 153 free (strings);147 std::free (strings); 154 148 #include "MemLeakFindOn.h" 155 149 }
