aboutsummaryrefslogtreecommitdiff
path: root/src/crashhandler.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-01-03 21:58:20 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-01-03 23:28:39 +0200
commit0642a0910ca0fb8e392636254684b91637a7b542 (patch)
tree4fa4328fcdf205b80103d5255ea1570439b46cce /src/crashhandler.h
parentMerge some QoL improvements from staging branch (diff)
downloadsmolbote-0642a0910ca0fb8e392636254684b91637a7b542.tar.xz
PKGBUILD: add install stage for debug symbols
- make toggling breakpad work properly
Diffstat (limited to 'src/crashhandler.h')
-rw-r--r--src/crashhandler.h38
1 files changed, 20 insertions, 18 deletions
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 <client/linux/handler/exception_handler.h>
-#endif
+#include <string>
-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