From d8b76ef7f105df873c978d17d5dc8660c73d2d5b Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 28 Jul 2020 14:56:55 +0000 Subject: [PATCH] Drop backtrace generation. This has been completely broken since 2018 (commit a93283df), and no one noticed, so it probably wasn't useful. Instead of fixing it, just drop the feature and a bunch of odd nonportable code. --- src/CMakeLists.txt | 5 ----- src/config.h.in | 4 ---- src/platform/guinone.cpp | 20 -------------------- 3 files changed, 29 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 16d6e36..fbebccf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,11 +6,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -set(HAVE_BACKTRACE ${Backtrace_FOUND}) -if(HAVE_BACKTRACE) - set(BACKTRACE_HEADER <${Backtrace_HEADER}>) -endif() - set(HAVE_SPACEWARE ${SPACEWARE_FOUND}) if(NOT WIN32 OR APPLE) diff --git a/src/config.h.in b/src/config.h.in index 475b973..144c46d 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -12,10 +12,6 @@ /* What OpenGL version do we use? */ #define HAVE_OPENGL @OPENGL@ -/* Do we have backtrace() function, and if yes, in which library? */ -#cmakedefine HAVE_BACKTRACE -#define BACKTRACE_HEADER @BACKTRACE_HEADER@ - /* If we use GTK, can we use the native file chooser? */ #cmakedefine HAVE_GTK_FILECHOOSERNATIVE diff --git a/src/platform/guinone.cpp b/src/platform/guinone.cpp index ef3c6f3..4641b98 100644 --- a/src/platform/guinone.cpp +++ b/src/platform/guinone.cpp @@ -24,26 +24,6 @@ namespace Platform { void FatalError(const std::string &message) { fprintf(stderr, "%s", message.c_str()); - -#if !defined(LIBRARY) && defined(HAVE_BACKTRACE) - static void *ptrs[1024] = {}; - size_t nptrs = backtrace(ptrs, sizeof(ptrs) / sizeof(ptrs[0])); - char **syms = backtrace_symbols(ptrs, nptrs); - - fprintf(stderr, "Backtrace:\n"); - if(syms != NULL) { - for(size_t i = 0; i < nptrs; i++) { - fprintf(stderr, "%2zu: %s\n", i, syms[i]); - } - } else { - for(size_t i = 0; i < nptrs; i++) { - fprintf(stderr, "%2zu: %p\n", i, ptrs[i]); - } - } -#else - fprintf(stderr, "Backtrace support not compiled in.\n"); -#endif - abort(); }