summaryrefslogtreecommitdiff
path: root/main/openvpn/src/openvpn/breakpad.cpp
blob: cfcc10a899e65cb477b9de0e48417e37cfea48e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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();
}