forked from qt-creator/qt-creator
Analyzer: Remove explicit environment and runMode
Instead, use the one in its (Standard)Runnable. Change-Id: I14dbe91c50d083d11e18d514ec391875c64e3851 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -55,7 +55,6 @@ ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core:
|
|||||||
m_isStopping(false)
|
m_isStopping(false)
|
||||||
{
|
{
|
||||||
m_isCustomStart = false;
|
m_isCustomStart = false;
|
||||||
m_localRunMode = ApplicationLauncher::Gui;
|
|
||||||
|
|
||||||
if (runConfiguration)
|
if (runConfiguration)
|
||||||
if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS))
|
if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS))
|
||||||
@@ -83,17 +82,12 @@ bool ValgrindRunControl::startEngine()
|
|||||||
emit outputReceived(tr("Command line arguments: %1").arg(runnable().debuggeeArgs), DebugFormat);
|
emit outputReceived(tr("Command line arguments: %1").arg(runnable().debuggeeArgs), DebugFormat);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
StandardRunnable debuggee = runnable();
|
|
||||||
// FIXME: Consolidate:
|
|
||||||
debuggee.environment = m_environment;
|
|
||||||
debuggee.runMode = m_localRunMode;
|
|
||||||
|
|
||||||
ValgrindRunner *run = runner();
|
ValgrindRunner *run = runner();
|
||||||
run->setValgrindExecutable(m_settings->valgrindExecutable());
|
run->setValgrindExecutable(m_settings->valgrindExecutable());
|
||||||
run->setValgrindArguments(genericToolArguments() + toolArguments());
|
run->setValgrindArguments(genericToolArguments() + toolArguments());
|
||||||
run->setConnectionParameters(connection().connParams);
|
run->setConnectionParameters(connection().connParams);
|
||||||
run->setUseStartupProject(!m_isCustomStart);
|
run->setUseStartupProject(!m_isCustomStart);
|
||||||
run->setDebuggee(debuggee);
|
run->setDebuggee(runnable());
|
||||||
|
|
||||||
connect(run, &ValgrindRunner::processOutputReceived,
|
connect(run, &ValgrindRunner::processOutputReceived,
|
||||||
this, &ValgrindRunControl::receiveProcessOutput);
|
this, &ValgrindRunControl::receiveProcessOutput);
|
||||||
@@ -120,16 +114,6 @@ QString ValgrindRunControl::executable() const
|
|||||||
return runnable().executable;
|
return runnable().executable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ValgrindRunControl::setEnvironment(const Utils::Environment &environment)
|
|
||||||
{
|
|
||||||
m_environment = environment;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ValgrindRunControl::setLocalRunMode(ApplicationLauncher::Mode localRunMode)
|
|
||||||
{
|
|
||||||
m_localRunMode = localRunMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList ValgrindRunControl::genericToolArguments() const
|
QStringList ValgrindRunControl::genericToolArguments() const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_settings, return QStringList());
|
QTC_ASSERT(m_settings, return QStringList());
|
||||||
|
@@ -52,8 +52,6 @@ public:
|
|||||||
QString executable() const;
|
QString executable() const;
|
||||||
|
|
||||||
void setCustomStart() { m_isCustomStart = true; }
|
void setCustomStart() { m_isCustomStart = true; }
|
||||||
void setEnvironment(const Utils::Environment &environment);
|
|
||||||
void setLocalRunMode(ProjectExplorer::ApplicationLauncher::Mode localRunMode);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QString progressTitle() const = 0;
|
virtual QString progressTitle() const = 0;
|
||||||
@@ -63,8 +61,6 @@ protected:
|
|||||||
ValgrindBaseSettings *m_settings;
|
ValgrindBaseSettings *m_settings;
|
||||||
QFutureInterface<void> m_progress;
|
QFutureInterface<void> m_progress;
|
||||||
bool m_isCustomStart;
|
bool m_isCustomStart;
|
||||||
Utils::Environment m_environment;
|
|
||||||
ProjectExplorer::ApplicationLauncher::Mode m_localRunMode;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void handleProgressCanceled();
|
void handleProgressCanceled();
|
||||||
|
@@ -70,21 +70,12 @@ bool ValgrindRunControlFactory::canRun(RunConfiguration *runConfiguration, Core:
|
|||||||
RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage)
|
RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Q_UNUSED(errorMessage);
|
Q_UNUSED(errorMessage);
|
||||||
auto runControl = qobject_cast<ValgrindRunControl *>(AnalyzerManager::createRunControl(runConfiguration, mode));
|
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(runConfiguration, mode);
|
||||||
QTC_ASSERT(runControl, return 0);
|
QTC_ASSERT(runControl, return 0);
|
||||||
|
|
||||||
ApplicationLauncher::Mode localRunMode = ApplicationLauncher::Gui;
|
|
||||||
IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit());
|
IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit());
|
||||||
Utils::Environment environment;
|
|
||||||
StandardRunnable runnable;
|
|
||||||
AnalyzerConnection connection;
|
AnalyzerConnection connection;
|
||||||
Runnable rcRunnable = runConfiguration->runnable();
|
|
||||||
QTC_ASSERT(rcRunnable.is<StandardRunnable>(), return 0);
|
|
||||||
auto stdRunnable = runConfiguration->runnable().as<StandardRunnable>();
|
|
||||||
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
||||||
environment = stdRunnable.environment;
|
|
||||||
runnable.executable = stdRunnable.executable;
|
|
||||||
runnable.commandLineArguments = stdRunnable.commandLineArguments;
|
|
||||||
QTcpServer server;
|
QTcpServer server;
|
||||||
if (!server.listen(QHostAddress::LocalHost) && !server.listen(QHostAddress::LocalHostIPv6)) {
|
if (!server.listen(QHostAddress::LocalHost) && !server.listen(QHostAddress::LocalHostIPv6)) {
|
||||||
qWarning() << "Cannot open port on host for profiling.";
|
qWarning() << "Cannot open port on host for profiling.";
|
||||||
@@ -92,21 +83,15 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
|
|||||||
}
|
}
|
||||||
connection.connParams.host = server.serverAddress().toString();
|
connection.connParams.host = server.serverAddress().toString();
|
||||||
connection.connParams.port = server.serverPort();
|
connection.connParams.port = server.serverPort();
|
||||||
localRunMode = stdRunnable.runMode;
|
|
||||||
} else {
|
} else {
|
||||||
runnable.executable = stdRunnable.executable;
|
|
||||||
runnable.commandLineArguments = stdRunnable.commandLineArguments;
|
|
||||||
connection.connParams = device->sshParameters();
|
connection.connParams = device->sshParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
runControl->setRunnable(runnable);
|
runControl->setRunnable(runConfiguration->runnable());
|
||||||
runControl->setConnection(connection);
|
runControl->setConnection(connection);
|
||||||
runControl->setLocalRunMode(localRunMode);
|
|
||||||
runControl->setEnvironment(environment);
|
|
||||||
return runControl;
|
return runControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class ValgrindRunConfigurationAspect : public IRunConfigurationAspect
|
class ValgrindRunConfigurationAspect : public IRunConfigurationAspect
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user