Merge remote-tracking branch 'origin/4.5'

Conflicts:
	src/plugins/cpptools/clangcompileroptionsbuilder.cpp
	src/plugins/cpptools/clangcompileroptionsbuilder.h
	src/plugins/cpptools/compileroptionsbuilder.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.h
	src/plugins/qmlprofiler/qmlprofilertraceclient.cpp
	src/plugins/qmlprofiler/qmlprofilertraceclient.h
	src/shared/qbs

Change-Id: I364ababc5d41046d17e999096c4a7187c4e4e010
This commit is contained in:
Eike Ziller
2018-01-09 13:07:57 +01:00
19 changed files with 85 additions and 110 deletions

View File

@@ -3949,14 +3949,22 @@ void GdbEngine::loadInitScript()
void GdbEngine::setEnvironmentVariables()
{
auto isWindowsPath = [this](const QString &str){
return HostOsInfo::isWindowsHost()
&& !isRemoteEngine()
&& str.compare("path", Qt::CaseInsensitive) == 0;
};
Environment sysEnv = Environment::systemEnvironment();
Environment runEnv = runParameters().inferior.environment;
foreach (const EnvironmentItem &item, sysEnv.diff(runEnv)) {
// imitate the weird windows gdb behavior of setting the case of the path environment
// variable name to an all uppercase PATH
const QString name = isWindowsPath(item.name) ? "PATH" : item.name;
if (item.operation == EnvironmentItem::Unset)
runCommand({"unset environment " + item.name});
runCommand({"unset environment " + name});
else
runCommand({"-gdb-set environment " + item.name + '='
+ item.value});
runCommand({"-gdb-set environment " + name + '=' + item.value});
}
}