diff --git a/ApplicationImpl.cpp b/ApplicationImpl.cpp index d0e2fd5..8422720 100644 --- a/ApplicationImpl.cpp +++ b/ApplicationImpl.cpp @@ -11,7 +11,6 @@ * This function can be modified/removed at anytime. **/ -#include // for backtrace #include // for dladdr #include // for __cxa_demangle @@ -25,51 +24,7 @@ // A C++ function that will produce a stack trace with demangled function and method names. QString getBacktrace() { - void *callstack[ 128 ]; - const int nMaxFrames = sizeof(callstack) / sizeof(callstack[ 0 ]); - char buf[ 1024 ]; - int nFrames = backtrace( callstack, nMaxFrames ); - - std::ostringstream trace_buf; - - for ( int i = 1; i < nFrames; i++ ) { - Dl_info info; - - if ( dladdr( callstack[ i ], &info ) ) { - char *demangled = NULL; - int status; - demangled = abi::__cxa_demangle( info.dli_sname, NULL, 0, &status ); - snprintf( - buf, - sizeof(buf), - "%-3d %*p %s + %zd\n", - i, - ( int )(2 + sizeof(void *) * 2), - callstack[ i ], - status == 0 ? demangled : info.dli_sname, - (char *)callstack[ i ] - (char *)info.dli_saddr - ); - free( demangled ); - } - else { - snprintf( - buf, - sizeof(buf), - "%-3d %*p\n", - i, - ( int )(2 + sizeof(void *) * 2), - callstack[ i ] - ); - } - - trace_buf << buf; - } - - if ( nFrames == nMaxFrames ) { - trace_buf << " [truncated]\n"; - } - - return QString( trace_buf.str().c_str() ); + return QString(); }