From a46ef637d5f37962f826969cb2d7eb4cb9ba81c6 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sun, 15 Nov 2015 04:39:24 +0100 Subject: include breakpad into the build Change-Id: I1bfd107502332fc86ae5e96bbc1f475b8d669c6c Reviewed-on: https://gerrit.libreoffice.org/22547 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- desktop/source/app/sofficemain.cxx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'desktop/source/app/sofficemain.cxx') diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index c94d5f146553..b14df2f30a15 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -18,6 +18,7 @@ */ #include +#include #include "desktopdllapi.h" @@ -40,6 +41,14 @@ #include #include +#if HAVE_FEATURE_BREAKPAD + +#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID +#include +#endif + +#endif + #ifdef ANDROID # include @@ -50,8 +59,30 @@ # define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOGTAG, __VA_ARGS__)) #endif +#if HAVE_FEATURE_BREAKPAD + +#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID +static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* /*context*/, bool succeeded) +{ + // send the minidump to the server (not yet implemented) + SAL_WARN("sofficemain", "minidump generated: " << descriptor.path()); + return succeeded; +} +#endif + +#endif + extern "C" int DESKTOP_DLLPUBLIC soffice_main() { +#if HAVE_FEATURE_BREAKPAD + +#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID + google_breakpad::MinidumpDescriptor descriptor("/tmp"); + google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, NULL, true, -1); +#endif + +#endif + #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) /* Run test for OpenGL support in own process to avoid crash with broken * OpenGL drivers. Start process as early as possible. -- cgit