1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-25 12:15:32 +03:00
aports/testing/dfl-applications/no-execinfo.patch
2023-02-17 04:13:46 +00:00

65 lines
1.8 KiB
Diff

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 <execinfo.h> // for backtrace
#include <dlfcn.h> // for dladdr
#include <cxxabi.h> // 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();
}