[Libreoffice-commits] core.git: desktop/source

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Feb 22 20:52:18 UTC 2016


 desktop/source/app/sofficemain.cxx |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 0c15cf444bc80992c67b3d7eae8c71526d9a078d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Nov 23 17:48:16 2015 +0100

    upload crashes correctly to server for linux
    
    Change-Id: I75778dc572a2888b3966cb5731f7e59209c7a942
    Reviewed-on: https://gerrit.libreoffice.org/22551
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index b14df2f..3c93c68 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -19,6 +19,7 @@
 
 #include <sal/config.h>
 #include <config_features.h>
+#include <config_folders.h>
 
 #include "desktopdllapi.h"
 
@@ -61,27 +62,40 @@
 
 #if HAVE_FEATURE_BREAKPAD
 
+OString getLibDir()
+{
+    OUString aOriginal = "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER;
+    rtl::Bootstrap::expandMacros(aOriginal);
+
+    return rtl::OUStringToOString(aOriginal, RTL_TEXTENCODING_UTF8);
+}
+
 #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());
+    SAL_WARN("crashreport", "minidump generated: " << descriptor.path());
+    OString aCommand = getLibDir().copy(7) + "/minidump_upload -p LibreOffice -v \"5.1.0.0\" ";
+    aCommand = aCommand + descriptor.path() + " " + "http://libreofficecrash.org/submit";
+    int retVal = std::system(aCommand.getStr());
+    SAL_WARN_IF(retVal != 0, "crashreport", "Failed to upload minidump. Error Code: " << retVal);
     return succeeded;
 }
 #endif
 
 #endif
-
 extern "C" int DESKTOP_DLLPUBLIC soffice_main()
 {
 #if HAVE_FEATURE_BREAKPAD
+    //limit the amount of code that needs to be executed before the crash reporting
 
 #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
+#else
 
 #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


More information about the Libreoffice-commits mailing list