diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index 40f05c9f746..aa3676ea2f0 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -124,8 +125,10 @@ void CMakeRunConfiguration::setRunMode(RunMode runMode) QString CMakeRunConfiguration::workingDirectory() const { - return QDir::cleanPath(environment().expandVariables( - Utils::expandMacros(baseWorkingDirectory(), macroExpander()))); + ProjectExplorer::EnvironmentAspect *aspect = extraAspect(); + QTC_ASSERT(aspect, return QString()); + return QDir::cleanPath(aspect->environment().expandVariables( + Utils::expandMacros(baseWorkingDirectory(), macroExpander()))); } QString CMakeRunConfiguration::baseWorkingDirectory() const @@ -321,6 +324,12 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration * m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory); m_workingDirectoryEdit->setBaseDirectory(m_cmakeRunConfiguration->target()->project()->projectDirectory()); m_workingDirectoryEdit->setPath(m_cmakeRunConfiguration->baseWorkingDirectory()); + ProjectExplorer::EnvironmentAspect *aspect + = m_cmakeRunConfiguration->extraAspect(); + if (aspect) { + connect(aspect, SIGNAL(environmentChanged()), this, SLOT(environmentWasChanged())); + environmentWasChanged(); + } m_workingDirectoryEdit->setPromptDialogTitle(tr("Select Working Directory")); QToolButton *resetButton = new QToolButton(); @@ -431,6 +440,14 @@ void CMakeRunConfigurationWidget::runInTerminalToggled(bool toggled) : ProjectExplorer::LocalApplicationRunConfiguration::Gui); } +void CMakeRunConfigurationWidget::environmentWasChanged() +{ + ProjectExplorer::EnvironmentAspect *aspect + = m_cmakeRunConfiguration->extraAspect(); + QTC_ASSERT(aspect, return); + m_workingDirectoryEdit->setEnvironment(aspect->environment()); +} + void CMakeRunConfigurationWidget::userChangesChanged() { m_cmakeRunConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges()); diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h index 5694e9ccfa4..d6b73ad5579 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h @@ -139,6 +139,7 @@ private slots: void setWorkingDirectory(); void resetWorkingDirectory(); void runInTerminalToggled(bool toggled); + void environmentWasChanged(); void baseEnvironmentComboBoxChanged(int index); void workingDirectoryChanged(const QString &workingDirectory); diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 88f0efd5467..5788164dc97 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -47,6 +47,7 @@ #endif #include // For LocalApplication* +#include // For the environment #include #include #include @@ -337,6 +338,8 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu LocalApplicationRunConfiguration *rc = qobject_cast(runConfiguration); QTC_ASSERT(rc, return sp); + EnvironmentAspect *environment = rc->extraAspect(); + QTC_ASSERT(environment, return sp); if (!rc->ensureConfigured(errorMessage)) return sp; @@ -344,7 +347,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu Kit *kit = target ? target->kit() : KitManager::instance()->defaultKit(); if (!fillParameters(&sp, kit, errorMessage)) return sp; - sp.environment = rc->environment(); + sp.environment = environment->environment(); sp.workingDirectory = rc->workingDirectory(); #if defined(Q_OS_WIN) @@ -370,14 +373,14 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu } } - DebuggerRunConfigurationAspect *aspect + DebuggerRunConfigurationAspect *debugger = runConfiguration->extraAspect(); - sp.multiProcess = aspect->useMultiProcess(); + sp.multiProcess = debugger->useMultiProcess(); - if (aspect->useCppDebugger()) + if (debugger->useCppDebugger()) sp.languages |= CppLanguage; - if (aspect->useQmlDebugger()) { + if (debugger->useQmlDebugger()) { const ProjectExplorer::IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit()); sp.qmlServerAddress = _("127.0.0.1"); diff --git a/src/plugins/madde/maemorunconfiguration.cpp b/src/plugins/madde/maemorunconfiguration.cpp index 11293a3a8cc..b0464285234 100644 --- a/src/plugins/madde/maemorunconfiguration.cpp +++ b/src/plugins/madde/maemorunconfiguration.cpp @@ -41,7 +41,9 @@ #include #include #include +#include #include +#include #include #include @@ -123,7 +125,9 @@ QString MaemoRunConfiguration::commandPrefix() const const QString prefix = environmentPreparationCommand() + QLatin1Char(';'); - return QString::fromLatin1("%1 %2").arg(prefix, userEnvironmentChangesAsString()); + RemoteLinuxEnvironmentAspect *aspect = extraAspect(); + QTC_ASSERT(aspect, return QString()); + return QString::fromLatin1("%1 %2").arg(prefix, aspect->userEnvironmentChangesAsString()); } Utils::PortList MaemoRunConfiguration::freePorts() const diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp index 3fc1626fad0..429649df6c1 100644 --- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp +++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp @@ -30,6 +30,7 @@ #include "localapplicationruncontrol.h" #include "localapplicationrunconfiguration.h" +#include #include #include @@ -72,7 +73,10 @@ RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfi LocalApplicationRunControl::LocalApplicationRunControl(LocalApplicationRunConfiguration *rc, RunMode mode) : RunControl(rc, mode), m_running(false) { - Utils::Environment env = rc->environment(); + EnvironmentAspect *environment = rc->extraAspect(); + Utils::Environment env; + if (environment) + env = environment->environment(); QString dir = rc->workingDirectory(); m_applicationLauncher.setEnvironment(env); m_applicationLauncher.setWorkingDirectory(dir); diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index e26e822a86b..b93e1e79160 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -84,8 +85,12 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo AbstractQmlProfilerRunner *runner = 0; if (!runConfiguration) // attaching return 0; - Debugger::DebuggerRunConfigurationAspect *aspect + Debugger::DebuggerRunConfigurationAspect *debugger = runConfiguration->extraAspect(); + QTC_ASSERT(debugger, return 0); + ProjectExplorer::EnvironmentAspect *environment + = runConfiguration->extraAspect(); + QTC_ASSERT(environment, return 0); if (QmlProjectManager::QmlProjectRunConfiguration *rc1 = qobject_cast(runConfiguration)) { // This is a "plain" .qmlproject. @@ -93,8 +98,8 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo conf.executable = rc1->observerPath(); conf.executableArguments = rc1->viewerArguments(); conf.workingDirectory = rc1->workingDirectory(); - conf.environment = rc1->environment(); - conf.port = aspect->qmlDebugServerPort(); + conf.environment = environment->environment(); + conf.port = debugger->qmlDebugServerPort(); runner = new LocalQmlProfilerRunner(conf, parent); } else if (LocalApplicationRunConfiguration *rc2 = qobject_cast(runConfiguration)) { @@ -103,8 +108,8 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo conf.executable = rc2->executable(); conf.executableArguments = rc2->commandLineArguments(); conf.workingDirectory = rc2->workingDirectory(); - conf.environment = rc2->environment(); - conf.port = aspect->qmlDebugServerPort(); + conf.environment = environment->environment(); + conf.port = debugger->qmlDebugServerPort(); runner = new LocalQmlProfilerRunner(conf, parent); } else if (RemoteLinux::RemoteLinuxRunConfiguration *rmConfig = qobject_cast(runConfiguration)) { diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 7d88bf06b08..5eda4328344 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -299,31 +300,35 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration Q_UNUSED(mode); AnalyzerStartParameters sp; - sp.startMode = StartQml; // FIXME: The parameter struct is not needed/not used. - - Debugger::DebuggerRunConfigurationAspect *aspect + ProjectExplorer::EnvironmentAspect *environment + = runConfiguration->extraAspect(); + Debugger::DebuggerRunConfigurationAspect *debugger = runConfiguration->extraAspect(); + QTC_ASSERT(debugger, return sp); + sp.startMode = StartQml; // FIXME: The parameter struct is not needed/not used. // FIXME: This is only used to communicate the connParams settings. if (QmlProjectRunConfiguration *rc1 = qobject_cast(runConfiguration)) { // This is a "plain" .qmlproject. - sp.environment = rc1->environment(); + if (environment) + sp.environment = environment->environment(); sp.workingDirectory = rc1->workingDirectory(); sp.debuggee = rc1->observerPath(); sp.debuggeeArgs = rc1->viewerArguments(); sp.displayName = rc1->displayName(); sp.connParams.host = QLatin1String("localhost"); - sp.connParams.port = aspect->qmlDebugServerPort(); + sp.connParams.port = debugger->qmlDebugServerPort(); } else if (LocalApplicationRunConfiguration *rc2 = qobject_cast(runConfiguration)) { - sp.environment = rc2->environment(); + if (environment) + sp.environment = environment->environment(); sp.workingDirectory = rc2->workingDirectory(); sp.debuggee = rc2->executable(); sp.debuggeeArgs = rc2->commandLineArguments(); sp.displayName = rc2->displayName(); sp.connParams.host = QLatin1String("localhost"); - sp.connParams.port = aspect->qmlDebugServerPort(); + sp.connParams.port = debugger->qmlDebugServerPort(); } else if (RemoteLinux::RemoteLinuxRunConfiguration *rc3 = qobject_cast(runConfiguration)) { sp.debuggee = rc3->remoteExecutableFilePath(); diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp index fce0757d4fb..51480d0dd6e 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp @@ -30,6 +30,8 @@ #include "qmlprojectruncontrol.h" #include "qmlprojectrunconfiguration.h" #include +#include +#include #include #include #include @@ -54,7 +56,9 @@ namespace Internal { QmlProjectRunControl::QmlProjectRunControl(QmlProjectRunConfiguration *runConfiguration, RunMode mode) : RunControl(runConfiguration, mode) { - m_applicationLauncher.setEnvironment(runConfiguration->environment()); + EnvironmentAspect *environment = runConfiguration->extraAspect(); + if (environment) + m_applicationLauncher.setEnvironment(environment->environment()); m_applicationLauncher.setWorkingDirectory(runConfiguration->workingDirectory()); if (mode == NormalRunMode) @@ -195,17 +199,22 @@ QString QmlProjectRunControlFactory::displayName() const RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConfiguration *runConfig, QString *errorMessage) { Debugger::DebuggerStartParameters params; - Debugger::DebuggerRunConfigurationAspect *aspect + + Debugger::DebuggerRunConfigurationAspect *debugger = runConfig->extraAspect(); + QTC_ASSERT(debugger, return 0); + EnvironmentAspect *environment = runConfig->extraAspect(); + params.startMode = Debugger::StartInternal; params.executable = runConfig->observerPath(); params.processArgs = runConfig->viewerArguments(); params.workingDirectory = runConfig->workingDirectory(); - params.environment = runConfig->environment(); + if (environment) + params.environment = environment->environment(); params.displayName = runConfig->displayName(); params.projectSourceDirectory = runConfig->target()->project()->projectDirectory(); params.projectSourceFiles = runConfig->target()->project()->files(Project::ExcludeGeneratedFiles); - if (aspect->useQmlDebugger()) { + if (debugger->useQmlDebugger()) { const ProjectExplorer::IDevice::ConstPtr device = DeviceKitInformation::device(runConfig->target()->kit()); params.qmlServerAddress = QLatin1String("127.0.0.1"); @@ -233,7 +242,7 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf QString::fromLatin1("-qmljsdebugger=port:%1,block").arg( params.qmlServerPort)); } - if (aspect->useCppDebugger()) + if (debugger->useCppDebugger()) params.languages |= Debugger::CppLanguage; if (params.executable.isEmpty()) { diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp index e316f635286..0d04991d3a8 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp @@ -34,6 +34,7 @@ #include "../qt4buildconfiguration.h" #include +#include #include #include #include @@ -134,11 +135,15 @@ QString Qt4RunConfiguration::disabledReason() const void Qt4RunConfiguration::proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress) { + ProjectExplorer::LocalEnvironmentAspect *aspect + = extraAspect(); + QTC_ASSERT(aspect, return); + if (m_proFilePath != pro->path()) { if (!parseInProgress) { // We depend on all .pro files for the LD_LIBRARY_PATH so we emit a signal for all .pro files // This can be optimized by checking whether LD_LIBRARY_PATH changed - emit baseEnvironmentChanged(); + aspect->buildEnvironmentHasChanged(); } return; } @@ -152,7 +157,7 @@ void Qt4RunConfiguration::proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, if (!parseInProgress) { emit effectiveTargetInformationChanged(); - emit baseEnvironmentChanged(); + aspect->buildEnvironmentHasChanged(); } } @@ -225,7 +230,12 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory); m_workingDirectoryEdit->setPath(m_qt4RunConfiguration->baseWorkingDirectory()); m_workingDirectoryEdit->setBaseDirectory(m_qt4RunConfiguration->target()->project()->projectDirectory()); - m_workingDirectoryEdit->setEnvironment(m_qt4RunConfiguration->environment()); + ProjectExplorer::EnvironmentAspect *aspect + = qt4RunConfiguration->extraAspect(); + if (aspect) { + connect(aspect, SIGNAL(environmentChanged()), this, SLOT(environmenWasChanged())); + environmentWasChanged(); + } m_workingDirectoryEdit->setPromptDialogTitle(tr("Select Working Directory")); QToolButton *resetButton = new QToolButton(this); @@ -369,6 +379,14 @@ void Qt4RunConfigurationWidget::userChangesEdited() m_ignoreChange = false; } +void Qt4RunConfigurationWidget::environmentWasChanged() +{ + ProjectExplorer::EnvironmentAspect *aspect + = m_qt4RunConfiguration->extraAspect(); + QTC_ASSERT(aspect, return); + m_workingDirectoryEdit->setEnvironment(aspect->environment()); +} + void Qt4RunConfigurationWidget::runConfigurationEnabledChange() { bool enabled = m_qt4RunConfiguration->isEnabled(); @@ -546,7 +564,10 @@ void Qt4RunConfiguration::setUsingDyldImageSuffix(bool state) QString Qt4RunConfiguration::workingDirectory() const { - return QDir::cleanPath(environment().expandVariables( + ProjectExplorer::EnvironmentAspect *aspect + = extraAspect(); + QTC_ASSERT(aspect, baseWorkingDirectory()); + return QDir::cleanPath(aspect->environment().expandVariables( Utils::expandMacros(baseWorkingDirectory(), macroExpander()))); } diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h index 62c3d78d6f7..801782239f0 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h @@ -174,6 +174,7 @@ private slots: void workingDirectoryReseted(); void argumentsEdited(const QString &arguments); void userChangesEdited(); + void environmentWasChanged(); void workingDirectoryChanged(const QString &workingDirectory); void commandLineArgumentsChanged(const QString &args); diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp index a8ac601424c..c5e7f4806ab 100644 --- a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp +++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp @@ -30,6 +30,7 @@ #include "customexecutableconfigurationwidget.h" #include "customexecutablerunconfiguration.h" +#include #include #include #include @@ -56,7 +57,6 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE m_executableChooser = new Utils::PathChooser(this); m_executableChooser->setExpectedKind(Utils::PathChooser::Command); - m_executableChooser->setEnvironment(rc->environment()); layout->addRow(tr("Command:"), m_executableChooser); m_commandLineArgumentsLineEdit = new QLineEdit(this); @@ -66,7 +66,7 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE m_workingDirectory = new Utils::PathChooser(this); m_workingDirectory->setExpectedKind(Utils::PathChooser::Directory); m_workingDirectory->setBaseDirectory(rc->target()->project()->projectDirectory()); - m_workingDirectory->setEnvironment(rc->environment()); + layout->addRow(tr("Working directory:"), m_workingDirectory); m_useTerminalCheck = new QCheckBox(tr("Run in &terminal"), this); @@ -124,6 +124,12 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE connect(m_useTerminalCheck, SIGNAL(toggled(bool)), this, SLOT(termToggled(bool))); + ProjectExplorer::EnvironmentAspect *aspect = rc->extraAspect(); + if (aspect) { + connect(aspect, SIGNAL(environmentChanged()), this, SLOT(environmentWasChanged())); + environmentWasChanged(); + } + connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed())); connect(m_environmentWidget, SIGNAL(userChangesChanged()), @@ -150,6 +156,15 @@ void CustomExecutableConfigurationWidget::baseEnvironmentSelected(int index) m_ignoreChange = false; } +void CustomExecutableConfigurationWidget::environmentWasChanged() +{ + ProjectExplorer::EnvironmentAspect *aspect + = m_runConfiguration->extraAspect(); + QTC_ASSERT(aspect, return); + m_workingDirectory->setEnvironment(aspect->environment()); + m_executableChooser->setEnvironment(aspect->environment()); +} + void CustomExecutableConfigurationWidget::baseEnvironmentChanged() { if (m_ignoreChange) diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.h b/src/plugins/qtsupport/customexecutableconfigurationwidget.h index efbc01ac5ae..adcf6ed7856 100644 --- a/src/plugins/qtsupport/customexecutableconfigurationwidget.h +++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.h @@ -70,6 +70,7 @@ private slots: void baseEnvironmentChanged(); void userEnvironmentChangesChanged(); void baseEnvironmentSelected(int index); + void environmentWasChanged(); private: bool m_ignoreChange; diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp index b13863ca6d0..921497dfd32 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp @@ -32,6 +32,7 @@ #include "qtkitinformation.h" #include +#include #include #include #include @@ -179,7 +180,10 @@ bool CustomExecutableRunConfiguration::validateExecutable(QString *executable, Q *errorMessage = tr("No executable."); return false; } - const Utils::Environment env = environment(); + Utils::Environment env; + ProjectExplorer::EnvironmentAspect *aspect = extraAspect(); + if (aspect) + env = aspect->environment(); const QString exec = env.searchInPath(Utils::expandMacros(m_executable, macroExpander()), QStringList(workingDirectory())); if (exec.isEmpty()) { @@ -217,7 +221,9 @@ ProjectExplorer::LocalApplicationRunConfiguration::RunMode CustomExecutableRunCo QString CustomExecutableRunConfiguration::workingDirectory() const { - return QDir::cleanPath(environment().expandVariables( + ProjectExplorer::EnvironmentAspect *aspect = extraAspect(); + QTC_ASSERT(aspect, return baseWorkingDirectory()); + return QDir::cleanPath(aspect->environment().expandVariables( Utils::expandMacros(baseWorkingDirectory(), macroExpander()))); } diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 3904d3121b5..4673839dc0d 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -221,8 +221,10 @@ QString RemoteLinuxRunConfiguration::environmentPreparationCommand() const QString RemoteLinuxRunConfiguration::commandPrefix() const { + RemoteLinuxEnvironmentAspect *aspect = extraAspect(); + QTC_ASSERT(aspect, return QString()); return QString::fromLatin1("%1; DISPLAY=:0.0 %2") - .arg(environmentPreparationCommand(), userEnvironmentChangesAsString()); + .arg(environmentPreparationCommand(), aspect->userEnvironmentChangesAsString()); } QString RemoteLinuxRunConfiguration::localExecutableFilePath() const diff --git a/src/plugins/valgrind/valgrindtool.cpp b/src/plugins/valgrind/valgrindtool.cpp index 8eac104cb48..035e2cd6d61 100644 --- a/src/plugins/valgrind/valgrindtool.cpp +++ b/src/plugins/valgrind/valgrindtool.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -62,8 +63,11 @@ Analyzer::AnalyzerStartParameters ValgrindTool::createStartParameters( sp.displayName = runConfiguration->displayName(); if (LocalApplicationRunConfiguration *rc1 = qobject_cast(runConfiguration)) { + ProjectExplorer::EnvironmentAspect *aspect + = runConfiguration->extraAspect(); sp.startMode = Analyzer::StartLocal; - sp.environment = rc1->environment(); + if (aspect) + sp.environment = aspect->environment(); sp.workingDirectory = rc1->workingDirectory(); sp.debuggee = rc1->executable(); sp.debuggeeArgs = rc1->commandLineArguments();