diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:26:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:26:05 +0000 |
commit | 14f1b3e8826ce43b978db93a62d1166055db5394 (patch) | |
tree | 0a00ad8d3498783fe0193f3b656bca17c4c8697d /unittests/Process/minidump/Inputs/linux-x86_64.cpp | |
parent | 4ee8c119c71a06dcad1e0fecc8c675e480e59337 (diff) | |
download | src-14f1b3e8826ce43b978db93a62d1166055db5394.tar.gz src-14f1b3e8826ce43b978db93a62d1166055db5394.zip |
Vendor import of lldb trunk r290819:vendor/lldb/lldb-trunk-r290819
Notes
Notes:
svn path=/vendor/lldb/dist/; revision=311128
svn path=/vendor/lldb/lldb-trunk-r290819/; revision=311129; tag=vendor/lldb/lldb-trunk-r290819
Diffstat (limited to 'unittests/Process/minidump/Inputs/linux-x86_64.cpp')
-rw-r--r-- | unittests/Process/minidump/Inputs/linux-x86_64.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/unittests/Process/minidump/Inputs/linux-x86_64.cpp b/unittests/Process/minidump/Inputs/linux-x86_64.cpp new file mode 100644 index 000000000000..827fe67b503b --- /dev/null +++ b/unittests/Process/minidump/Inputs/linux-x86_64.cpp @@ -0,0 +1,28 @@ +// Example source from breakpad's linux tutorial +// https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/linux_starter_guide.md + +#include <stdio.h> +#include <sys/types.h> +#include <unistd.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()); + return succeeded; +} + +void crash() { + volatile int *a = (int *)(NULL); + *a = 1; +} + +int main(int argc, char *argv[]) { + google_breakpad::MinidumpDescriptor descriptor("/tmp"); + google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, NULL, + true, -1); + printf("pid: %d\n", getpid()); + crash(); + return 0; +} |