summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorGopi Krishna Menon <gopi.menon@collabora.com>2021-06-16 10:02:23 +0000
committerTor Lillqvist <tml@collabora.com>2021-06-18 09:05:36 +0200
commita3d89265e0be3f9ee8ae813e4aeaa90af1714348 (patch)
tree2ed46f464fd48f9ee145e4af9fa19e81d0e6995f /desktop
parent07e269f2596756bf841bbc380929bcffc3ca6bc6 (diff)
Add Active Sfx Object Name To CrashReport Dump
Adds Active-SfxObject field in CrashReport to assist in investigating the crashes Change-Id: I08637a66ae95977e7afe4f5dce634b46c928a423 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117318 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/crashreport.cxx20
1 files changed, 11 insertions, 9 deletions
diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx
index b6d8b14d8beb..7d3fc8e036b6 100644
--- a/desktop/source/app/crashreport.cxx
+++ b/desktop/source/app/crashreport.cxx
@@ -43,16 +43,17 @@
#endif
osl::Mutex CrashReporter::maMutex;
-osl::Mutex CrashReporter::maActiveNameMutex;
+osl::Mutex CrashReporter::maActiveSfxObjectNameMutex;
std::unique_ptr<google_breakpad::ExceptionHandler> CrashReporter::mpExceptionHandler;
bool CrashReporter::mbInit = false;
CrashReporter::vmaKeyValues CrashReporter::maKeyValues;
-OUString CrashReporter::mActiveApp;
+OUString CrashReporter::msActiveSfxObjectName;
+
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* /*context*/, bool succeeded)
{
- CrashReporter::addKeyValue("Active-App",CrashReporter::currentActiveApp(),CrashReporter::AddItem);
+ CrashReporter::addKeyValue("Active-SfxObject",CrashReporter::getActiveSfxObjectName(),CrashReporter::AddItem);
CrashReporter::addKeyValue("DumpFile", OStringToOUString(descriptor.path(), RTL_TEXTENCODING_UTF8), CrashReporter::Write);
SAL_WARN("desktop", "minidump generated: " << descriptor.path());
@@ -70,7 +71,7 @@ static bool dumpCallback(const wchar_t* path, const wchar_t* id,
#endif
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv1;
std::string aPath = conv1.to_bytes(std::wstring(path)) + conv1.to_bytes(std::wstring(id)) + ".dmp";
- CrashReporter::addKeyValue("Active-App",CrashReporter::currentActiveApp(),CrashReporter::AddItem);
+ CrashReporter::addKeyValue("Active-SfxObject",CrashReporter::getActiveSfxObjectName(),CrashReporter::AddItem);
CrashReporter::addKeyValue("DumpFile", OStringToOUString(aPath.c_str(), RTL_TEXTENCODING_UTF8), CrashReporter::AddItem);
CrashReporter::addKeyValue("GDIHandles", OUString::number(::GetGuiResources(::GetCurrentProcess(), GR_GDIOBJECTS)), CrashReporter::Write);
SAL_WARN("desktop", "minidump generated: " << aPath);
@@ -162,15 +163,16 @@ void CrashReporter::writeCommonInfo()
updateMinidumpLocation();
}
-void CrashReporter::setActiveApp(const OUString& rActiveApp)
+void CrashReporter::setActiveSfxObjectName(const OUString& rActiveSfxObjectName)
{
- osl::MutexGuard aGuard(maActiveNameMutex);
- mActiveApp=rActiveApp;
+ osl::MutexGuard aGuard(maActiveSfxObjectNameMutex);
+ msActiveSfxObjectName = rActiveSfxObjectName;
}
-OUString CrashReporter::currentActiveApp()
+OUString CrashReporter::getActiveSfxObjectName()
{
- return mActiveApp;
+ osl::MutexGuard aGuard(maActiveSfxObjectNameMutex);
+ return msActiveSfxObjectName;
}
namespace {