1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 02:35:23 +03:00
aports/community/xournalpp/no-execinfo.patch
2022-11-12 16:00:21 +01:00

87 lines
2.2 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0152f40..8223e41 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,8 +88,6 @@ if (WIN32)
set(xournalpp_LDFLAGS ${xournalpp_LDFLAGS} "-mwindows")
# Need ImageMagick to generate icons on Windows
find_package(ImageMagick REQUIRED COMPONENTS convert)
-else ()
- find_package(Backtrace REQUIRED)
endif ()
# GLIB
diff --git a/src/util/CrashHandlerUnix.h b/src/util/CrashHandlerUnix.h
index ce20ea5..bbbf654 100644
--- a/src/util/CrashHandlerUnix.h
+++ b/src/util/CrashHandlerUnix.h
@@ -11,8 +11,6 @@
#include <fstream> // std::ofstream
-#include <execinfo.h>
-
#include "PathUtil.h"
using std::ofstream;
@@ -62,12 +60,6 @@ static void crashHandler(int sig) {
time_t lt;
void* array[100];
- char** messages;
-
- size_t size;
-
- // get void*'s for all entries on the stack
- size = backtrace(array, 100);
time_t curtime = time(0);
char stime[128];
@@ -84,19 +76,8 @@ static void crashHandler(int sig) {
fp << FORMAT_STR("Error: signal {1}") % sig;
fp << "\n";
- messages = backtrace_symbols(array, size);
-
- for (size_t i = 0; i < size; i++) {
- fp << FORMAT_STR("[bt]: ({1}) {2}") % i % messages[i];
- fp << "\n";
- }
-
- free(messages);
-
fp << "\n\nTry to get a better stracktrace...\n";
- Stacktrace::printStracktrace(fp);
-
if (fp) {
fp.close();
}
diff --git a/src/util/Stacktrace.cpp b/src/util/Stacktrace.cpp
index 7f3da85..a7230d3 100644
--- a/src/util/Stacktrace.cpp
+++ b/src/util/Stacktrace.cpp
@@ -8,7 +8,6 @@
#include <Windows.h>
#else
-#include <execinfo.h>
#include <unistd.h>
#endif
@@ -76,14 +75,12 @@ void Stacktrace::printStracktrace(std::ostream& stream) {
std::array<void*, 32> trace{};
std::array<char, 2048> buff{};
- int trace_size = backtrace(trace.data(), trace.size());
- char** messages = backtrace_symbols(trace.data(), trace_size);
+ int trace_size = 0;
std::string exeName = getExePath();
// skip first stack frame (points here)
for (int i = 1; i < trace_size; ++i) {
- stream << "[bt] #" << i << " " << messages[i] << endl;
std::array<char, 1024> syscom{};