summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-11-25 16:50:22 +0100
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-12 22:06:17 -0400
commit59a9da5ba16561947fbd443bc5919cde901aecfe (patch)
tree2c48ad95e34a13803da10a40b41c08e372ff07b7 /desktop/source
parentc6f4e6f581d7e1e724cbb3051624acb7a845ebf0 (diff)
add way to add additional information to the crash report
We can add several additional key value pairs during the execution of the program that will be used on the server to show more information. Reviewed-on: https://gerrit.libreoffice.org/22553 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 98a8eafa915b8d57b8bdccab9981e537d77f6f4a) Change-Id: I4102adc15fc821415fa0b997ca7fe0dc4f7abcec
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/crashreport.cxx33
-rw-r--r--desktop/source/app/sofficemain.cxx2
-rw-r--r--desktop/source/app/sofficemain.h2
-rw-r--r--desktop/source/inc/desktopdllapi.h24
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx2
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_main.h2
6 files changed, 37 insertions, 28 deletions
diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx
new file mode 100644
index 000000000000..0bde05979a72
--- /dev/null
+++ b/desktop/source/app/crashreport.cxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <desktop/crashreport.hxx>
+
+#include <string>
+#include <fstream>
+
+osl::Mutex CrashReporter::maMutex;
+
+#if HAVE_FEATURE_BREAKPAD
+void CrashReporter::AddKeyValue(const OUString& rKey, const OUString& rValue)
+{
+ osl::MutexGuard aGuard(maMutex);
+ std::string ini_path = getIniFileName();
+ std::ofstream ini_file(ini_path, std::ios_base::app);
+ ini_file << rtl::OUStringToOString(rKey, RTL_TEXTENCODING_UTF8).getStr() << "=";
+ ini_file << rtl::OUStringToOString(rValue, RTL_TEXTENCODING_UTF8).getStr() << "\n";
+}
+#endif
+
+const char* CrashReporter::getIniFileName()
+{
+ return "/tmp/dump.ini";
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index 28296ee857f0..7e4e7af27df7 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -19,7 +19,7 @@
#include <sal/config.h>
-#include "desktopdllapi.h"
+#include <desktop/dllapi.h>
#include "app.hxx"
#include "cmdlineargs.hxx"
diff --git a/desktop/source/app/sofficemain.h b/desktop/source/app/sofficemain.h
index d0a9988a5c7f..c291df7af295 100644
--- a/desktop/source/app/sofficemain.h
+++ b/desktop/source/app/sofficemain.h
@@ -20,7 +20,7 @@
#ifndef INCLUDED_DESKTOP_SOURCE_APP_SOFFICEMAIN_H
#define INCLUDED_DESKTOP_SOURCE_APP_SOFFICEMAIN_H
-#include "desktopdllapi.h"
+#include <desktop/dllapi.h>
#if defined __cplusplus
extern "C" {
diff --git a/desktop/source/inc/desktopdllapi.h b/desktop/source/inc/desktopdllapi.h
deleted file mode 100644
index ebc75f1214ac..000000000000
--- a/desktop/source/inc/desktopdllapi.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_DESKTOP_SOURCE_INC_DESKTOPDLLAPI_H
-#define INCLUDED_DESKTOP_SOURCE_INC_DESKTOPDLLAPI_H
-
-#include <sal/config.h>
-#include <sal/types.h>
-
-#if defined(DESKTOP_DLLIMPLEMENTATION)
-# define DESKTOP_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
-#else
-# define DESKTOP_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
-#endif
-
-#endif
-
-/* vim: set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index d3afd077f73e..93fa127fbba7 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -18,7 +18,7 @@
*/
-#include "desktopdllapi.h"
+#include <desktop/dllapi.h>
#include "dp_misc.h"
#include "unopkg_main.h"
#include "unopkg_shared.h"
diff --git a/desktop/source/pkgchk/unopkg/unopkg_main.h b/desktop/source/pkgchk/unopkg/unopkg_main.h
index 6cac46a08480..bfd9ee69b376 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_main.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_main.h
@@ -20,7 +20,7 @@
#ifndef INCLUDED_DESKTOP_SOURCE_PKGCHK_UNOPKG_UNOPKG_MAIN_H
#define INCLUDED_DESKTOP_SOURCE_PKGCHK_UNOPKG_UNOPKG_MAIN_H
-#include "desktopdllapi.h"
+#include <desktop/dllapi.h>
#if defined __cplusplus
extern "C" {