From 4f2a21541e67934512cc9b34d59824bc17c43013 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 26 Aug 2020 14:59:45 +0200 Subject: [PATCH] Debugger: Fix environment passed to inferior by gdb We must not set variables that the user disabled. Change-Id: I2f559aefd6aaa43298dd9c4889a614a5130622c0 Reviewed-by: hjk --- src/plugins/debugger/gdb/gdbengine.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 8ec83467b6c..8a073727ee1 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}); + } } }