aboutsummaryrefslogtreecommitdiff
path: root/src/crashhandler.h
diff options
context:
space:
mode:
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