summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/gdb/gdbengine.cpp
diff options
context:
space:
mode:
authorMarcus Tillmanns <marcus.tillmanns@qt.io>2022-07-12 11:34:34 +0200
committerMarcus Tillmanns <marcus.tillmanns@qt.io>2022-07-12 10:43:43 +0000
commit78e7c7b2a640fda7534721c303141243598b04bc (patch)
tree03c3324b56ec627447b78e8a50a50c03c56ce6d6 /src/plugins/debugger/gdb/gdbengine.cpp
parent226abd4de75dfa9542af5be043cda74a5ebdc4af (diff)
downloadqt-creator-78e7c7b2a640fda7534721c303141243598b04bc.tar.gz
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 <hjk@qt.io>
Diffstat (limited to 'src/plugins/debugger/gdb/gdbengine.cpp')
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp5
1 files changed, 3 insertions, 2 deletions
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