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>
This commit is contained in:
Christian Kandeler
2020-08-26 14:59:45 +02:00
parent ce19b108d1
commit 4f2a21541e

View File

@@ -3801,11 +3801,13 @@ 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});
}
}
}
void GdbEngine::reloadDebuggingHelpers()