diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-11-15 04:39:24 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-02-22 18:20:13 +0000 |
commit | a46ef637d5f37962f826969cb2d7eb4cb9ba81c6 (patch) | |
tree | e60a0d3c0e716ace76db0fc71bb343adff0b6f6b /desktop | |
parent | e72cd4053676d826ef9a914e62e89e26247bdd5c (diff) |
include breakpad into the build
Change-Id: I1bfd107502332fc86ae5e96bbc1f475b8d669c6c
Reviewed-on: https://gerrit.libreoffice.org/22547
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/Library_sofficeapp.mk | 4 | ||||
-rw-r--r-- | desktop/source/app/sofficemain.cxx | 31 |
2 files changed, 35 insertions, 0 deletions
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk index d7b6dbac4b2f..13b81153ad6b 100644 --- a/desktop/Library_sofficeapp.mk +++ b/desktop/Library_sofficeapp.mk @@ -117,6 +117,10 @@ $(eval $(call gb_Library_add_libs,sofficeapp,\ endif endif +ifeq ($(ENABLE_BREAKPAD),TRUE) +$(eval $(call gb_Library_use_external,sofficeapp,breakpad)) +endif + # LibreOfficeKit bits ifneq ($(filter $(OS),ANDROID IOS MACOSX WNT),) $(eval $(call gb_Library_add_exception_objects,sofficeapp,\ 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 <sal/config.h> +#include <config_features.h> #include "desktopdllapi.h" @@ -40,6 +41,14 @@ #include <cppuhelper/bootstrap.hxx> #include <unotools/mediadescriptor.hxx> +#if HAVE_FEATURE_BREAKPAD + +#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID +#include <client/linux/handler/exception_handler.h> +#endif + +#endif + #ifdef ANDROID # include <jni.h> @@ -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. |