summaryrefslogtreecommitdiff
path: root/jni/icsandroid.cpp
blob: cd63c6fd5bf402a72d2bcdfb596cb4c1a6a73532 (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
30

#include "icsandroid.h"
#include "client/linux/handler/exception_handler.h"

namespace {

bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
                  void* context,
                  bool succeeded) {
  printf("Dump path: %s\n", descriptor.path());
fflush(stdout);
  return succeeded;
}

void Crash() {
  volatile int* a = reinterpret_cast<volatile int*>(NULL);
  *a = 1;
}

}  // namespace

static google_breakpad::MinidumpDescriptor* desc;
static google_breakpad::ExceptionHandler* eh;
void setup_breakpad(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);
}