Crashdump: Make crash directory configurable
Change-Id: I8106ec674080ede7072581dab2e6700040de5828 Reviewed-on: https://gerrit.libreoffice.org/33032 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
@@ -90,15 +90,17 @@ void CrashReporter::writeCommonInfo()
|
||||
|
||||
namespace {
|
||||
|
||||
OUString getCrashUserProfileDirectory()
|
||||
OUString getCrashDirectory()
|
||||
{
|
||||
OUString url("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/crash/");
|
||||
rtl::Bootstrap::expandMacros(url);
|
||||
osl::Directory::create(url);
|
||||
OUString aCrashURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("crashreport") ":CrashDirectory}/");
|
||||
rtl::Bootstrap::expandMacros(aCrashURL);
|
||||
// Need to convert to URL in case of user-defined path
|
||||
osl::FileBase::getFileURLFromSystemPath(aCrashURL, aCrashURL);
|
||||
osl::Directory::create(aCrashURL);
|
||||
|
||||
OUString aProfilePath;
|
||||
osl::FileBase::getSystemPathFromFileURL(url, aProfilePath);
|
||||
return aProfilePath;
|
||||
OUString aCrashPath;
|
||||
osl::FileBase::getSystemPathFromFileURL(aCrashURL, aCrashPath);
|
||||
return aCrashPath;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -106,12 +108,12 @@ OUString getCrashUserProfileDirectory()
|
||||
void CrashReporter::updateMinidumpLocation()
|
||||
{
|
||||
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID
|
||||
OUString aURL = getCrashUserProfileDirectory();
|
||||
OUString aURL = getCrashDirectory();
|
||||
OString aOStringUrl = OUStringToOString(aURL, RTL_TEXTENCODING_UTF8);
|
||||
google_breakpad::MinidumpDescriptor descriptor(aOStringUrl.getStr());
|
||||
mpExceptionHandler->set_minidump_descriptor(descriptor);
|
||||
#elif defined WNT
|
||||
OUString aURL = getCrashUserProfileDirectory();
|
||||
OUString aURL = getCrashDirectory();
|
||||
mpExceptionHandler->set_dump_path(aURL.getStr());
|
||||
#endif
|
||||
}
|
||||
@@ -123,7 +125,7 @@ void CrashReporter::storeExceptionHandler(google_breakpad::ExceptionHandler* pEx
|
||||
|
||||
std::string CrashReporter::getIniFileName()
|
||||
{
|
||||
OUString url = getCrashUserProfileDirectory() + "dump.ini";
|
||||
OUString url = getCrashDirectory() + "dump.ini";
|
||||
OString aUrl = OUStringToOString(url, RTL_TEXTENCODING_UTF8);
|
||||
std::string aRet(aUrl.getStr());
|
||||
return aRet;
|
||||
|
||||
@@ -19,6 +19,7 @@ $(eval $(call gb_CustomTarget_register_targets,instsetoo_native/setup,\
|
||||
$(call gb_Helper_get_rcfile,soffice) \
|
||||
$(call gb_Helper_get_rcfile,uno) \
|
||||
$(call gb_Helper_get_rcfile,version) \
|
||||
$(call gb_Helper_get_rcfile,crashreport) \
|
||||
))
|
||||
|
||||
$(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,bootstrap) \
|
||||
@@ -29,6 +30,7 @@ $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_
|
||||
$(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,soffice) \
|
||||
$(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,uno) \
|
||||
$(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,version) \
|
||||
$(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,crashreport) \
|
||||
: $(SRCDIR)/instsetoo_native/CustomTarget_setup.mk
|
||||
|
||||
$(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,bootstrap) :
|
||||
@@ -143,6 +145,13 @@ $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_
|
||||
&& echo 'UNO_SERVICES=$(if $(filter MACOSX,$(OS)),$${ORIGIN}/../share/misc/,$${ORIGIN}/)services.rdb $${URE_MORE_SERVICES}' \
|
||||
) > $@
|
||||
|
||||
$(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,crashreport) :
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
|
||||
( \
|
||||
echo '[CrashReport]' \
|
||||
&& echo 'CrashDirectory=$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/crash' \
|
||||
) > $@
|
||||
|
||||
.PHONY: $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,version)
|
||||
$(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_rcfile,version) :
|
||||
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1)
|
||||
|
||||
@@ -18,6 +18,7 @@ $(eval $(call gb_Package_add_files,instsetoo_native_setup,$(LIBO_ETC_FOLDER),\
|
||||
$(call gb_Helper_get_rcfile,soffice) \
|
||||
$(call gb_Helper_get_rcfile,louno) \
|
||||
$(call gb_Helper_get_rcfile,version) \
|
||||
$(call gb_Helper_get_rcfile,crashreport) \
|
||||
))
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
||||
|
||||
@@ -634,6 +634,12 @@ Profile gid_Brand_Profile_Fundamental_Ini
|
||||
Dir = GID_BRAND_DIR_ETC;
|
||||
End
|
||||
|
||||
Profile gid_Brand_Profile_Crashreport_Ini
|
||||
ModuleID = gid_Module_Root_Brand;
|
||||
Name = PROFILENAME(crashreport);
|
||||
Dir = GID_BRAND_DIR_ETC;
|
||||
End
|
||||
|
||||
#if !defined MACOSX
|
||||
Profile gid_Brand_Profile_Redirect_Ini
|
||||
ModuleID = gid_Module_Root_Brand;
|
||||
@@ -1199,3 +1205,11 @@ ProfileItem gid_Brand_Profileitem_Setup_Install
|
||||
Styles = (INIFILETABLE);
|
||||
End
|
||||
#endif
|
||||
|
||||
ProfileItem gid_Brand_Profileitem_CrashReport_Path
|
||||
ProfileID = gid_Brand_Profile_Crashreport_Ini;
|
||||
ModuleID = gid_Module_Root_Brand;
|
||||
Section = "CrashReport";
|
||||
Key = "CrashDirectory";
|
||||
Value = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" PROFILENAME(bootstrap) ":UserInstallation}/crash";
|
||||
End
|
||||
|
||||
Reference in New Issue
Block a user