summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-04-12 06:27:22 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-05-21 04:16:00 +0200
commitf601e7673423e4c7b87047b4dcebfa58c82862f0 (patch)
tree0aa447a030ed7be5a068802fb5a5c88d7887db63 /desktop
parent238bb82f5975a9f80ddc52bd21b931a0f7f10f2b (diff)
add the breakpad exception handler also for windows
Change-Id: I85a297ff79d9216cf2329b642bf8fe0bfe3e6886
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/sofficemain.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index fec226d2cc6c..40bd1dd7b5cf 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -49,6 +49,8 @@
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
#include <client/linux/handler/exception_handler.h>
+#elif defined WNT
+#include <client/windows/handler/exception_handler.h>
#endif
#endif
@@ -75,6 +77,19 @@ static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
SAL_WARN("desktop", "minidump generated: " << descriptor.path());
return succeeded;
}
+#elif defined WNT
+static bool dumpCallback(const wchar_t* path, const wchar_t* /*id*/,
+ void* /*context*/, EXCEPTION_POINTERS* /*exinfo*/,
+ MDRawAssertionInfo* /*assertion*/,
+ bool succeeded)
+{
+ std::string ini_path = CrashReporter::getIniFileName();
+ std::ofstream minidump_file(ini_path, std::ios_base::app);
+ minidump_file << "DumpFile=" << path << "\n";;
+ minidump_file.close();
+ SAL_WARN("desktop", "minidump generated: " << path);
+ return succeeded;
+}
#endif
#endif
@@ -87,8 +102,10 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
google_breakpad::ExceptionHandler eh(descriptor, nullptr, dumpCallback, nullptr, true, -1);
CrashReporter::storeExceptionHandler(&eh);
-#else
+#elif defined WNT
+ google_breakpad::ExceptionHandler eh(L".", nullptr, dumpCallback, nullptr, google_breakpad::ExceptionHandler::HANDLER_ALL);
+ CrashReporter::storeExceptionHandler(&eh);
#endif
#endif