diff options
Diffstat (limited to 'lib/common/Utils.cpp')
-rw-r--r-- | lib/common/Utils.cpp | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/lib/common/Utils.cpp b/lib/common/Utils.cpp index 3137d980..decc80e8 100644 --- a/lib/common/Utils.cpp +++ b/lib/common/Utils.cpp @@ -24,11 +24,6 @@ #include <cxxabi.h> #endif -<<<<<<< HEAD -#include "Utils.h" -#include "CommonException.h" -#include "Logging.h" -======= #ifdef HAVE_DLFCN_H #include <dlfcn.h> #endif @@ -40,7 +35,6 @@ #include "CommonException.h" #include "Logging.h" #include "Utils.h" ->>>>>>> 0.12 #include "MemLeakFindOn.h" @@ -87,14 +81,6 @@ void SplitString(const std::string &String, char SplitOn, std::vector<std::strin } #ifdef SHOW_BACKTRACE_ON_EXCEPTION -<<<<<<< HEAD -void DumpStackBacktrace() -{ - void *array[10]; - size_t size = backtrace (array, 10); - char **strings = backtrace_symbols (array, size); - -======= static std::string demangle(const std::string& mangled_name) { #ifdef HAVE_CXXABI_H @@ -159,85 +145,10 @@ void DumpStackBacktrace() { void *array[10]; size_t size = backtrace(array, 10); ->>>>>>> 0.12 BOX_TRACE("Obtained " << size << " stack frames."); for(size_t i = 0; i < size; i++) { -<<<<<<< HEAD - // Demangling code copied from - // cctbx_sources/boost_adaptbx/meta_ext.cpp, BSD license - - std::string mangled_frame = strings[i]; - std::string output_frame = strings[i]; // default - - #ifdef HAVE_CXXABI_H - int start = mangled_frame.find('('); - int end = mangled_frame.find('+', start); - std::string mangled_func = mangled_frame.substr(start + 1, - end - start - 1); - - int status; - -#include "MemLeakFindOff.h" - char* result = abi::__cxa_demangle(mangled_func.c_str(), - NULL, NULL, &status); -#include "MemLeakFindOn.h" - - if (result == NULL) - { - if (status == 0) - { - BOX_WARNING("Demangle failed but no error: " << - mangled_func); - } - else if (status == -1) - { - BOX_WARNING("Demangle failed with " - "memory allocation error: " << - mangled_func); - } - else if (status == -2) - { - // Probably non-C++ name, don't demangle - /* - BOX_WARNING("Demangle failed with " - "with invalid name: " << - mangled_func); - */ - } - else if (status == -3) - { - BOX_WARNING("Demangle failed with " - "with invalid argument: " << - mangled_func); - } - else - { - BOX_WARNING("Demangle failed with " - "with unknown error " << status << - ": " << mangled_func); - } - } - else - { - output_frame = mangled_frame.substr(0, start + 1) + - result + mangled_frame.substr(end); -#include "MemLeakFindOff.h" - std::free(result); -#include "MemLeakFindOn.h" - } - #endif // HAVE_CXXABI_H - - BOX_TRACE("Stack frame " << i << ": " << output_frame); - } - -#include "MemLeakFindOff.h" - std::free (strings); -#include "MemLeakFindOn.h" -} -#endif -======= std::ostringstream output; output << "Stack frame " << i << ": "; @@ -270,7 +181,6 @@ void DumpStackBacktrace() } } #endif // SHOW_BACKTRACE_ON_EXCEPTION ->>>>>>> 0.12 @@ -429,8 +339,6 @@ std::string FormatUsageLineStart(const std::string& rName, return result.str(); } -<<<<<<< HEAD -======= std::string BoxGetTemporaryDirectoryName() { @@ -459,4 +367,3 @@ std::string BoxGetTemporaryDirectoryName() } ->>>>>>> 0.12 |