From b619f24396ab5d446f39d2d53904829254c19a80 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 3 Mar 2023 18:13:30 +0100 Subject: crashpad: change chrashpad dumps location to user directory on macOS This is necessary to not pollute the signed and notarized .app bundle. Task-number: QDS-9113 Change-Id: I74e0bced5679faac94b27d2a31ea10a7949fb21f Reviewed-by: Tim Jenssen --- src/app/main.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/app/main.cpp') diff --git a/src/app/main.cpp b/src/app/main.cpp index 74d1ccec9e..d1cfc7136a 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -425,13 +425,26 @@ QStringList lastSessionArgument() return hasProjectExplorer ? QStringList({"-lastsession"}) : QStringList(); } +// should be in sync with src/plugins/coreplugin/icore.cpp -> FilePath ICore::crashReportsPath() +// and src\tools\qml2puppet\qml2puppet\qmlpuppet.cpp -> QString crashReportsPath() +QString crashReportsPath() +{ + std::unique_ptr settings(createUserSettings()); + QFileInfo(settings->fileName()).path() + "/crashpad_reports"; + if (Utils::HostOsInfo::isMacHost()) + return QFileInfo(createUserSettings()->fileName()).path() + "/crashpad_reports"; + else + return QCoreApplication::applicationDirPath() + + '/' + RELATIVE_LIBEXEC_PATH + "crashpad_reports"; +} + #ifdef ENABLE_CRASHPAD bool startCrashpad(const QString &libexecPath, bool crashReportingEnabled) { using namespace crashpad; // Cache directory that will store crashpad information and minidumps - QString databasePath = QDir::cleanPath(libexecPath + "/crashpad_reports"); + QString databasePath = QDir::cleanPath(crashReportsPath()); QString handlerPath = QDir::cleanPath(libexecPath + "/crashpad_handler"); #ifdef Q_OS_WIN handlerPath += ".exe"; -- cgit v1.2.3