summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2019-11-04 10:42:06 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-04-21 17:17:54 +0200
commitc9408eceb0274c6c3bc6d726433af990bf34995b (patch)
treeeb169452ec2dbee9bf177e6a2ee40c8e2010e9c9 /include
parent984a240975b87eff10ccda394de9e7ea0078ed30 (diff)
tdf#127711 - A runtime-switch for the MiniCrashDump and associated changes
- add CrashDumpEnable to soffice.ini - also check env var CRASH_DUMP_ENABLE (overrides soffice.ini) - make sure _all_ binaries are added to symstore This is a squash of: https://gerrit.libreoffice.org/79273 https://gerrit.libreoffice.org/81989 https://gerrit.libreoffice.org/c/core/+/87260 https://gerrit.libreoffice.org/c/core/+/87261 https://gerrit.libreoffice.org/79272 https://gerrit.libreoffice.org/83171 https://gerrit.libreoffice.org/82751 https://gerrit.libreoffice.org/83066 https://gerrit.libreoffice.org/83726 https://gerrit.libreoffice.org/c/core/+/86465
Diffstat (limited to 'include')
-rw-r--r--include/desktop/crashreport.hxx59
-rw-r--r--include/desktop/minidump.hxx13
2 files changed, 48 insertions, 24 deletions
diff --git a/include/desktop/crashreport.hxx b/include/desktop/crashreport.hxx
index 6056adbe1d28..585c0af5e1a9 100644
--- a/include/desktop/crashreport.hxx
+++ b/include/desktop/crashreport.hxx
@@ -17,7 +17,8 @@
#include <config_features.h>
-#include <map>
+// vector not sort the entries
+#include <vector>
#include <string>
namespace google_breakpad
@@ -41,40 +42,52 @@ CRASHREPORT_DLLPUBLIC
/*class*/ CrashReporter
{
public:
- static void AddKeyValue(const OUString& rKey, const OUString& rValue);
+ typedef enum {AddItem, Write, Create} tAddKeyHandling;
+#if HAVE_FEATURE_BREAKPAD
+ static void addKeyValue(const OUString& rKey, const OUString& rValue, tAddKeyHandling AddKeyHandling);
- static std::string getIniFileName();
+ static void storeExceptionHandler(google_breakpad::ExceptionHandler* pExceptionHandler);
- static void writeCommonInfo();
+ static bool crashReportInfoExists();
- static void storeExceptionHandler(google_breakpad::ExceptionHandler* pExceptionHandler);
+ static bool readSendConfig(std::string& response);
- // when we create the ExceptionHandler we have no access to the user
- // profile yet, so update when we have access
- static void updateMinidumpLocation();
+ static bool IsDumpEnable();
private:
-
static osl::Mutex maMutex;
-
static bool mbInit;
-
- static std::map<OUString, OUString> maKeyValues; // used to temporarily save entries before the old info has been uploaded
+ typedef struct _mpair
+ {
+ OUString first;
+ OUString second;
+ _mpair(const OUString& First, const OUString& Second)
+ {
+ first = First;
+ second = Second;
+ };
+ } mpair;
+
+ typedef std::vector<mpair> vmaKeyValues;
+ static vmaKeyValues maKeyValues; // used to temporarily save entries before the old info has been uploaded
static google_breakpad::ExceptionHandler* mpExceptionHandler;
-};
-// Add dummy methods for the non-breakpad case. That allows us to use
-// the code without linking to the lib and without adding HAVE_FEATURE_BREAKPAD
-// everywhere we want to log something to the crash report system.
-#if HAVE_FEATURE_BREAKPAD
-#else
-inline void CrashReporter::AddKeyValue(SAL_UNUSED_PARAMETER const OUString& /*rKey*/, SAL_UNUSED_PARAMETER const OUString& /*rValue*/)
-{
-}
-#endif
+ static std::string getIniFileName();
+ static void writeCommonInfo();
+ static void writeToFile(std::ios_base::openmode Openmode);
+ // when we create the ExceptionHandler we have no access to the user
+ // profile yet, so update when we have access
+ static void updateMinidumpLocation();
+#else
+ // Add dummy methods for the non-breakpad case. That allows us to use
+ // // the code without linking to the lib and without adding HAVE_FEATURE_BREAKPAD
+ // // everywhere we want to log something to the crash report system.
+ inline static void addKeyValue(SAL_UNUSED_PARAMETER const OUString& /*rKey*/, SAL_UNUSED_PARAMETER const OUString& /*rValue*/, SAL_UNUSED_PARAMETER tAddKeyHandling /*AddKeyHandling*/) {};
+#endif // HAVE_FEATURE_BREAKPAD
+};
-#endif
+#endif // INCLUDED_DESKTOP_CRASHREPORT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/desktop/minidump.hxx b/include/desktop/minidump.hxx
index 63336cae5595..6ed0e18277f8 100644
--- a/include/desktop/minidump.hxx
+++ b/include/desktop/minidump.hxx
@@ -16,7 +16,18 @@
namespace crashreport {
-CRASHREPORT_DLLPUBLIC bool readConfig(const std::string& iniPath, std::string& response);
+// when response = nullptr only make test
+/** Read+Send, Test and send info from the Dump.ini .
+
+ @param [in] iniPath Path-file to the read/test ini-file
+ @param [in] response=nullptr in this case made the Test only
+ @param [in] response!=nullptr in this case made the Read+Send
+
+ @retval true Read+Send, Test was okay
+ @retval false Read+Send, Test is a error
+*/
+
+CRASHREPORT_DLLPUBLIC bool readConfig(const std::string& iniPath, std::string * response);
}