diff options
author | David Schulz <david.schulz@qt.io> | 2018-01-03 10:59:50 +0100 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2018-01-03 12:04:49 +0000 |
commit | ffe120a43ff93e9ba0b37e987496c886c3274ad9 (patch) | |
tree | 1db466ed455c8080e99e29e085f24ed58596234a | |
parent | 359e4c88c929980344180eb07bbb262707b768cb (diff) | |
download | qt-creator-ffe120a43ff93e9ba0b37e987496c886c3274ad9.tar.gz |
Debugger: imitate windows gdb all uppercase PATH env variable name
Task-number: QTCREATORBUG-19547
Change-Id: I57295b7febd7e017408d5d75ebec7020a7cbb32f
Reviewed-by: hjk <hjk@qt.io>
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index d87c33a741..5ec1e38feb 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3955,14 +3955,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}); } } |