aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-08-26 14:59:45 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-08-27 09:38:23 +0000
commit4f2a21541e67934512cc9b34d59824bc17c43013 (patch)
tree60d2f3423751612ebeede34be73bd618095bce4f
parentce19b108d13c3f5bcace01005e482fa3edcddb0d (diff)
Debugger: Fix environment passed to inferior by gdb
We must not set variables that the user disabled. Change-Id: I2f559aefd6aaa43298dd9c4889a614a5130622c0 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 8ec83467b6..8a073727ee 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -3801,10 +3801,12 @@ void GdbEngine::setEnvironmentVariables()
// 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)
+ if (item.operation == EnvironmentItem::Unset
+ || item.operation == EnvironmentItem::SetDisabled) {
runCommand({"unset environment " + name});
- else
+ } else {
runCommand({"-gdb-set environment " + name + '=' + item.value});
+ }
}
}