cruxports/xournalpp/no-execinfo.patch
John McQuah 55d987ab31 xournalpp: 1.2.2 -> 1.2.3
add patch for musl systems; remove dependency gtksourceview (incompatible version in ports)
2024-08-30 13:12:32 +00:00

73 lines
1.8 KiB
Diff

--- a/src/core/control/CrashHandlerUnix.h
+++ b/src/core/control/CrashHandlerUnix.h
@@ -13,7 +13,6 @@
#include <bitset>
#include <fstream> // std::ofstream
-#include <execinfo.h>
#include <gtk/gtk.h>
#include "util/PathUtil.h"
@@ -112,11 +111,8 @@
void* array[100];
char** messages;
- size_t size;
+ size_t size = 0;
- // get void*'s for all entries on the stack
- size = backtrace(array, 100);
-
time_t curtime = time(0);
char stime[128];
strftime(stime, sizeof(stime), "%Y%m%d-%H%M%S", localtime(&curtime));
@@ -140,15 +136,6 @@
fp << "Gtk version " << gtk_get_major_version() << "." << gtk_get_minor_version() << "." << gtk_get_micro_version()
<< std::endl
<< std::endl;
-
- 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 stacktrace...\n";
--- a/src/util/Stacktrace.cpp
+++ b/src/util/Stacktrace.cpp
@@ -14,7 +14,6 @@
#else
#include <dlfcn.h> // for dladdr
-#include <execinfo.h> // for backtrace, backtrace_symbols
#include <unistd.h> // for readlink, ssize_t
#ifdef __APPLE__
@@ -91,13 +90,10 @@
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;
// skip first stack frame (points here)
for (unsigned int i = 1; i < trace_size; ++i) {
- stream << "[bt] #" << i - 1 << " " << messages[i] << endl;
-
Dl_info info; // NOLINT(cppcoreguidelines-init-variables)
dladdr(trace[i], &info);
@@ -115,7 +111,6 @@
pclose(fProc);
}
- free(messages);
}
#endif