From 0642a0910ca0fb8e392636254684b91637a7b542 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 3 Jan 2020 21:58:20 +0200 Subject: PKGBUILD: add install stage for debug symbols - make toggling breakpad work properly --- src/crashhandler.h | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'src/crashhandler.h') diff --git a/src/crashhandler.h b/src/crashhandler.h index e7f7fa1..9b79ecc 100644 --- a/src/crashhandler.h +++ b/src/crashhandler.h @@ -9,26 +9,28 @@ #ifndef SMOLBOTE_CRASHHANDLER_H #define SMOLBOTE_CRASHHANDLER_H -#ifdef BREAKPAD -//#ifdef Q_OS_LINUX -#include -#endif +#include -class CrashHandler +namespace CrashHandler { - -public: - struct BreakpadContext { - char *handler = nullptr; - }; - - // bool filter_callback (void*) - // --> true: continue processing and write a minidump - -#ifdef BREAKPAD - static bool dumpCallback(const google_breakpad::MinidumpDescriptor &descriptor, void *context, bool succeeded); +struct Context { + const std::string dumppath; + const std::string handler; + + explicit Context(const std::string &path, const std::string &crashhandler) + : dumppath(path) + , handler(crashhandler) + { + } +}; + +bool install_handler(Context &ctx) +#ifndef HAVE_BREAKPAD +{ + return false; +} #endif - -}; // CrashHandler +; +}; #endif // SMOLBOTE_CRASHHANDLER_H -- cgit v1.2.1