forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -47,6 +47,8 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
|
||||
#include <projectexplorer/devicesupport/idevice.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
@@ -486,8 +488,10 @@ void BuildConfiguration::setBuildDirectorySettingsKey(const QString &key)
|
||||
Environment BuildConfiguration::baseEnvironment() const
|
||||
{
|
||||
Environment result;
|
||||
if (useSystemEnvironment())
|
||||
result = Environment::systemEnvironment();
|
||||
if (useSystemEnvironment()) {
|
||||
ProjectExplorer::IDevice::ConstPtr devicePtr = BuildDeviceKitAspect::device(kit());
|
||||
result = devicePtr ? devicePtr->systemEnvironment() : Environment::systemEnvironment();
|
||||
}
|
||||
addToEnvironment(result);
|
||||
kit()->addToBuildEnvironment(result);
|
||||
result.modify(project()->additionalEnvironment());
|
||||
|
||||
Reference in New Issue
Block a user