forked from qt-creator/qt-creator
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:
@@ -3801,10 +3801,12 @@ void GdbEngine::setEnvironmentVariables()
|
|||||||
// imitate the weird windows gdb behavior of setting the case of the path environment
|
// imitate the weird windows gdb behavior of setting the case of the path environment
|
||||||
// variable name to an all uppercase PATH
|
// variable name to an all uppercase PATH
|
||||||
const QString name = isWindowsPath(item.name) ? "PATH" : item.name;
|
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});
|
runCommand({"unset environment " + name});
|
||||||
else
|
} else {
|
||||||
runCommand({"-gdb-set environment " + name + '=' + item.value});
|
runCommand({"-gdb-set environment " + name + '=' + item.value});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user