From db3c9c8d3b5903b353bca2fa349d3386c1f68096 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 4 Oct 2020 16:48:54 +0300 Subject: Remove Breakpad optdepend --- src/crashhandler.cpp | 56 ---------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/crashhandler.cpp (limited to 'src/crashhandler.cpp') diff --git a/src/crashhandler.cpp b/src/crashhandler.cpp deleted file mode 100644 index ed9298f..0000000 --- a/src/crashhandler.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * This file is part of smolbote. It's copyrighted by the contributors recorded - * in the version control history of the file, available from its original - * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote - * - * SPDX-License-Identifier: GPL-3.0 - */ - -#include "crashhandler.h" -#include "version.h" -#include -#include -#include - -// bool filter_callback (void*) -// --> true: continue processing and write a minidump -static bool minidumpCb(const google_breakpad::MinidumpDescriptor &descriptor, void *context, bool succeeded) -{ - printf("Dump path: %s\n", descriptor.path()); - - auto *ctx = static_cast(context); - if(ctx != nullptr) { - if(!ctx->handler.empty()) { - // fork and run 'handler master:commit path.dmp' - pid_t pid = fork(); - if(pid == 0) { - // pathname program argument ... nullptr - execlp(ctx->handler.c_str(), - ctx->handler.c_str(), "--crashd", ctx->dumppath.c_str(), "-c", descriptor.path(), poi_Version, - (char *)nullptr); - } - } - } - - return succeeded; -} - -bool CrashHandler::install_handler(CrashHandler::Context &ctx) -{ - if(ctx.dumppath.empty()) - return false; - - // Disable Chromium's crash handler so breakpad can capture crashes instead. - // This has to be done before QtWebEngine gets initialized. - const auto chromiumFlags = qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"); - if(!chromiumFlags.contains("disable-in-process-stack-traces")) { - qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromiumFlags + " --disable-in-process-stack-traces"); - } - - google_breakpad::MinidumpDescriptor descriptor(ctx.dumppath.c_str()); - - // minidump descriptor, filter callback, minidump callback, callback_context, install handler, server_fd - new google_breakpad::ExceptionHandler(descriptor, nullptr, minidumpCb, &ctx, true, -1); - - return true; -} -- cgit v1.2.1