diff --git a/arangod/Utils/Exception.cpp b/arangod/Utils/Exception.cpp index 921343da4d..7de9fc6f82 100644 --- a/arangod/Utils/Exception.cpp +++ b/arangod/Utils/Exception.cpp @@ -44,6 +44,11 @@ Exception::Exception (int code, _file(file), _line(line), _code(code) { +#ifdef TRI_ENABLE_MAINTAINER_MODE +#if HAVE_BACKTRACE + _backtrace(); +#endif +#endif } //////////////////////////////////////////////////////////////////////////////// @@ -59,6 +64,11 @@ Exception::Exception (int code, _file(file), _line(line), _code(code) { +#ifdef TRI_ENABLE_MAINTAINER_MODE +#if HAVE_BACKTRACE + _backtrace(); +#endif +#endif } //////////////////////////////////////////////////////////////////////////////// diff --git a/lib/BasicsC/common.h b/lib/BasicsC/common.h index 8f3440b70b..2556c06519 100644 --- a/lib/BasicsC/common.h +++ b/lib/BasicsC/common.h @@ -246,7 +246,7 @@ static inline void _backtrace(void) int status = 0; char * demangled_name = abi::__cxa_demangle(mangled_name, 0, 0, &status); if (status == 0) { - fprintf(stderr, "%s %s\n", strings[i], demangled_name); + fprintf(stderr, "%s() [%p] %s\n", strings[i], stack_frames[i], demangled_name); } else { fprintf(stderr, "%s\n", strings[i]); @@ -260,7 +260,7 @@ static inline void _backtrace(void) } } else - fprintf(stderr, "%p\n", stack_frames[i]); + fprintf(stderr, "[%p]\n", stack_frames[i]); } free(strings); #endif