Commit 835ef950 authored by hjk's avatar hjk

Analyzer: Use the run mode stored in the parameters instead of a copy

Change-Id: I045622efa22bfcb26f9161556ccbbfb3df08599d
Reviewed-by: default avatarAurindam Jana <aurindam.jana@digia.com>
parent 84b47922
...@@ -754,12 +754,10 @@ void AnalyzerManager::handleToolFinished() ...@@ -754,12 +754,10 @@ void AnalyzerManager::handleToolFinished()
} }
AnalyzerRunControl *AnalyzerManager::createRunControl( AnalyzerRunControl *AnalyzerManager::createRunControl(
const AnalyzerStartParameters &sp, const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode runMode)
{ {
foreach (IAnalyzerTool *tool, m_instance->d->m_tools) foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
if (tool->runMode() == runMode) if (tool->runMode() == sp.runMode)
return tool->createRunControl(sp, runConfiguration); return tool->createRunControl(sp, runConfiguration);
QTC_CHECK(false); QTC_CHECK(false);
return 0; return 0;
......
...@@ -93,7 +93,7 @@ public: ...@@ -93,7 +93,7 @@ public:
static QAction *stopAction(); static QAction *stopAction();
static AnalyzerRunControl *createRunControl(const AnalyzerStartParameters &sp, static AnalyzerRunControl *createRunControl(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode runMode); ProjectExplorer::RunConfiguration *runConfiguration);
private: private:
friend class AnalyzerManagerPrivate; friend class AnalyzerManagerPrivate;
......
...@@ -51,7 +51,7 @@ namespace Android { ...@@ -51,7 +51,7 @@ namespace Android {
namespace Internal { namespace Internal {
RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfiguration *runConfig, RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfiguration *runConfig,
RunMode runMode, QString *errorMessage) RunMode runMode)
{ {
Target *target = runConfig->target(); Target *target = runConfig->target();
AnalyzerStartParameters params; AnalyzerStartParameters params;
...@@ -68,8 +68,7 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati ...@@ -68,8 +68,7 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
params.startMode = StartQmlRemote; params.startMode = StartQmlRemote;
} }
AnalyzerRunControl *analyzerRunControl = AnalyzerRunControl *analyzerRunControl = AnalyzerManager::createRunControl(params, runConfig);
AnalyzerManager::createRunControl(params, runConfig, runMode);
(void) new AndroidAnalyzeSupport(runConfig, analyzerRunControl); (void) new AndroidAnalyzeSupport(runConfig, analyzerRunControl);
return analyzerRunControl; return analyzerRunControl;
} }
......
...@@ -48,7 +48,7 @@ class AndroidAnalyzeSupport : public AndroidRunSupport ...@@ -48,7 +48,7 @@ class AndroidAnalyzeSupport : public AndroidRunSupport
public: public:
static ProjectExplorer::RunControl *createAnalyzeRunControl(AndroidRunConfiguration *runConfig, static ProjectExplorer::RunControl *createAnalyzeRunControl(AndroidRunConfiguration *runConfig,
ProjectExplorer::RunMode runMode, QString *errorMessage); ProjectExplorer::RunMode runMode);
AndroidAnalyzeSupport(AndroidRunConfiguration *runConfig, AndroidAnalyzeSupport(AndroidRunConfiguration *runConfig,
Analyzer::AnalyzerRunControl *runControl); Analyzer::AnalyzerRunControl *runControl);
......
...@@ -168,7 +168,7 @@ RunControl *AndroidRunControlFactory::create(RunConfiguration *runConfig, ...@@ -168,7 +168,7 @@ RunControl *AndroidRunControlFactory::create(RunConfiguration *runConfig,
case DebugRunMode: case DebugRunMode:
return AndroidDebugSupport::createDebugRunControl(rc, errorMessage); return AndroidDebugSupport::createDebugRunControl(rc, errorMessage);
case QmlProfilerRunMode: case QmlProfilerRunMode:
return AndroidAnalyzeSupport::createAnalyzeRunControl(rc, mode, errorMessage); return AndroidAnalyzeSupport::createAnalyzeRunControl(rc, mode);
case NoRunMode: case NoRunMode:
case DebugRunModeWithBreakOnMain: case DebugRunModeWithBreakOnMain:
case CallgrindRunMode: case CallgrindRunMode:
......
...@@ -123,7 +123,7 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat ...@@ -123,7 +123,7 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat
const IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit()); const IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit());
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0); QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
AnalyzerRunControl *rc = AnalyzerManager::createRunControl(sp, runConfiguration, mode); AnalyzerRunControl *rc = AnalyzerManager::createRunControl(sp, runConfiguration);
QmlProfilerRunControl *engine = qobject_cast<QmlProfilerRunControl *>(rc); QmlProfilerRunControl *engine = qobject_cast<QmlProfilerRunControl *>(rc);
if (!engine) { if (!engine) {
delete rc; delete rc;
......
...@@ -63,7 +63,7 @@ using namespace ProjectExplorer; ...@@ -63,7 +63,7 @@ using namespace ProjectExplorer;
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
DebuggerStartParameters createStartParameters(const QnxRunConfiguration *runConfig) static DebuggerStartParameters createDebuggerStartParameters(const QnxRunConfiguration *runConfig)
{ {
DebuggerStartParameters params; DebuggerStartParameters params;
Target *target = runConfig->target(); Target *target = runConfig->target();
...@@ -114,7 +114,7 @@ DebuggerStartParameters createStartParameters(const QnxRunConfiguration *runConf ...@@ -114,7 +114,7 @@ DebuggerStartParameters createStartParameters(const QnxRunConfiguration *runConf
return params; return params;
} }
AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfiguration *runConfig, RunMode mode) static AnalyzerStartParameters createAnalyzerStartParameters(const QnxRunConfiguration *runConfig, RunMode mode)
{ {
AnalyzerStartParameters params; AnalyzerStartParameters params;
Target *target = runConfig->target(); Target *target = runConfig->target();
...@@ -178,7 +178,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mo ...@@ -178,7 +178,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mo
case NormalRunMode: case NormalRunMode:
return new QnxRunControl(rc); return new QnxRunControl(rc);
case DebugRunMode: { case DebugRunMode: {
const DebuggerStartParameters params = createStartParameters(rc); const DebuggerStartParameters params = createDebuggerStartParameters(rc);
DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage); DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage);
if (!runControl) if (!runControl)
return 0; return 0;
...@@ -190,7 +190,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mo ...@@ -190,7 +190,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mo
} }
case QmlProfilerRunMode: { case QmlProfilerRunMode: {
const AnalyzerStartParameters params = createAnalyzerStartParameters(rc, mode); const AnalyzerStartParameters params = createAnalyzerStartParameters(rc, mode);
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode); AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig);
QnxAnalyzeSupport * const analyzeSupport = new QnxAnalyzeSupport(rc, runControl); QnxAnalyzeSupport * const analyzeSupport = new QnxAnalyzeSupport(rc, runControl);
connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished())); connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
return runControl; return runControl;
......
...@@ -108,7 +108,7 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru ...@@ -108,7 +108,7 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
} }
case QmlProfilerRunMode: { case QmlProfilerRunMode: {
AnalyzerStartParameters params = RemoteLinuxAnalyzeSupport::startParameters(rc, mode); AnalyzerStartParameters params = RemoteLinuxAnalyzeSupport::startParameters(rc, mode);
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode); AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig);
RemoteLinuxAnalyzeSupport * const analyzeSupport = RemoteLinuxAnalyzeSupport * const analyzeSupport =
new RemoteLinuxAnalyzeSupport(rc, runControl, mode); new RemoteLinuxAnalyzeSupport(rc, runControl, mode);
connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished())); connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
......
...@@ -71,6 +71,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration ...@@ -71,6 +71,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
AnalyzerStartParameters sp; AnalyzerStartParameters sp;
sp.displayName = runConfiguration->displayName(); sp.displayName = runConfiguration->displayName();
sp.runMode = mode;
if (LocalApplicationRunConfiguration *rc1 = if (LocalApplicationRunConfiguration *rc1 =
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) { qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
EnvironmentAspect *aspect = runConfiguration->extraAspect<EnvironmentAspect>(); EnvironmentAspect *aspect = runConfiguration->extraAspect<EnvironmentAspect>();
...@@ -102,7 +103,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration ...@@ -102,7 +103,7 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
QTC_ASSERT(false, return 0); QTC_ASSERT(false, return 0);
} }
return AnalyzerManager::createRunControl(sp, runConfiguration, mode); return AnalyzerManager::createRunControl(sp, runConfiguration);
} }
IRunConfigurationAspect *ValgrindRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc) IRunConfigurationAspect *ValgrindRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment