From 78e7c7b2a640fda7534721c303141243598b04bc Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 12 Jul 2022 11:34:34 +0200 Subject: docker: Fix run environment setup When starting a debug session the systemEnvironment() was used as the basis for the debugger process. If the docker device did not have the same shell installed as the host, this would break gdb as the SHELL= env variable might point to a non-existing shell binary. Change-Id: I7253ad3c4995eed857279146f1b258febe1ca710 Reviewed-by: hjk --- src/plugins/debugger/gdb/gdbengine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/debugger/gdb/gdbengine.cpp') diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 6dc3cb9d80..9da5a188f3 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3854,6 +3854,7 @@ void GdbEngine::setupEngine() if (!debuggerSettings()->loadGdbInit.value()) gdbCommand.addArg("-n"); + // This is filled in DebuggerKitAspect::runnable Environment gdbEnv = rp.debugger.environment; gdbEnv.setupEnglishOutput(); if (rp.runAsRoot) @@ -4046,9 +4047,9 @@ void GdbEngine::setEnvironmentVariables() && str.compare("path", Qt::CaseInsensitive) == 0; }; - Environment sysEnv = Environment::systemEnvironment(); + Environment baseEnv = runParameters().debugger.environment; Environment runEnv = runParameters().inferior.environment; - const NameValueItems items = sysEnv.diff(runEnv); + const NameValueItems items = baseEnv.diff(runEnv); for (const EnvironmentItem &item : items) { // imitate the weird windows gdb behavior of setting the case of the path environment // variable name to an all uppercase PATH -- cgit v1.2.1