summaryrefslogtreecommitdiff
path: root/desktop/source/app/sofficemain.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-11-15 04:39:24 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-02-22 18:20:13 +0000
commita46ef637d5f37962f826969cb2d7eb4cb9ba81c6 (patch)
treee60a0d3c0e716ace76db0fc71bb343adff0b6f6b /desktop/source/app/sofficemain.cxx
parente72cd4053676d826ef9a914e62e89e26247bdd5c (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/source/app/sofficemain.cxx')
-rw-r--r--desktop/source/app/sofficemain.cxx31
1 files changed, 31 insertions, 0 deletions
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.