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 <tim.jenssen@qt.io>
This commit is contained in:
Tim Jenssen
2023-03-03 18:13:30 +01:00
parent 6445db8ca2
commit b619f24396
4 changed files with 48 additions and 7 deletions

View File

@@ -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<QSettings> 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";