summaryrefslogtreecommitdiff
path: root/openvpn/src/openvpn/breakpad.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'openvpn/src/openvpn/breakpad.cpp')
-rw-r--r--openvpn/src/openvpn/breakpad.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/openvpn/src/openvpn/breakpad.cpp b/openvpn/src/openvpn/breakpad.cpp
new file mode 100644
index 00000000..cfcc10a8
--- /dev/null
+++ b/openvpn/src/openvpn/breakpad.cpp
@@ -0,0 +1,29 @@
+
+#include "breakpad.h"
+#include "client/linux/handler/exception_handler.h"
+
+
+static
+bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
+ void* context,
+ bool succeeded) {
+ printf("Dump path: %s\n", descriptor.path());
+ fflush(stdout);
+ fflush(stderr);
+ return succeeded;
+}
+
+static google_breakpad::MinidumpDescriptor* desc;
+static google_breakpad::ExceptionHandler* eh;
+
+void breakpad_setup(void)
+{
+ printf("Initializing Google Breakpad!\n");
+ desc = new google_breakpad::MinidumpDescriptor("/data/data/de.blinkt.openvpn/cache");
+ eh = new google_breakpad::ExceptionHandler(*desc, NULL, DumpCallback, NULL, true,-1);
+}
+
+void breakpad_dodump(void)
+{
+ eh->WriteMinidump();
+}