[SLP] Migrate away from PointerUnion::get
[llvm-project.git] / lldb / unittests / Process / minidump / Inputs / linux-x86_64.cpp
blob830b090ed808eb90a9b79e58dfcc2eafd6a33655
1 // Example source from breakpad's linux tutorial
2 // https://chromium.googlesource.com/breakpad/breakpad/+/main/docs/linux_starter_guide.md
4 #include <stdio.h>
5 #include <sys/types.h>
6 #include <unistd.h>
8 #include "client/linux/handler/exception_handler.h"
10 static bool dumpCallback(const google_breakpad::MinidumpDescriptor &descriptor,
11 void *context, bool succeeded) {
12 printf("Dump path: %s\n", descriptor.path());
13 return succeeded;
16 void crash() {
17 volatile int *a = (int *)(NULL);
18 *a = 1;
21 int main(int argc, char *argv[]) {
22 google_breakpad::MinidumpDescriptor descriptor("/tmp");
23 google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, NULL,
24 true, -1);
25 printf("pid: %d\n", getpid());
26 crash();
27 return 0;