Commit 249a36b5 authored by hjk's avatar hjk

Analyzer: Remove AnalyzerRunControl::runnable() and .connection()

These re-implementations are conceptually "too specific". Rather let
the indiviual tools handle there expectations themselves.

Change-Id: I0bbea407b2241816a40d19eb1dbb0a7589cbda7b
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent b2c6ea47
......@@ -28,7 +28,6 @@
#include "analyzerruncontrol.h"
#include "ianalyzertool.h"
#include "analyzermanager.h"
#include "analyzerstartparameters.h"
#include <projectexplorer/project.h>
#include <projectexplorer/runconfigurationaspects.h>
......@@ -58,16 +57,6 @@ AnalyzerRunControl::AnalyzerRunControl(RunConfiguration *runConfiguration, Core:
this, &AnalyzerRunControl::stopIt);
}
const StandardRunnable &AnalyzerRunControl::runnable() const
{
return RunControl::runnable().as<StandardRunnable>();
}
const AnalyzerConnection &AnalyzerRunControl::connection() const
{
return RunControl::connection().as<AnalyzerConnection>();
}
void AnalyzerRunControl::stopIt()
{
if (stop() == RunControl::StoppedSynchronously)
......
......@@ -27,10 +27,9 @@
#ifndef ANALYZERRUNCONTROL_H
#define ANALYZERRUNCONTROL_H
#include "analyzerstartparameters.h"
#include "analyzerbase_global.h"
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/runnables.h>
#include <utils/outputformat.h>
......@@ -59,9 +58,6 @@ public:
virtual void pause() {}
virtual void unpause() {}
const ProjectExplorer::StandardRunnable &runnable() const;
const AnalyzerConnection &connection() const;
virtual void notifyRemoteSetupDone(quint16) {}
virtual void notifyRemoteFinished() {}
......
......@@ -31,6 +31,7 @@
#include <analyzerbase/ianalyzertool.h>
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <projectexplorer/target.h>
#include <projectexplorer/project.h>
......
......@@ -34,6 +34,8 @@
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectexplorer.h>
......
......@@ -29,6 +29,8 @@
#include "qmlprofilertool.h"
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
#include <coreplugin/helpmanager.h>
......@@ -109,9 +111,12 @@ bool QmlProfilerRunControl::startEngine()
d->m_tool->finalizeRunControl(this);
QTC_ASSERT(d->m_profilerState, return false);
if (connection().analyzerPort != 0)
emit processRunning(connection().analyzerPort);
else if (connection().analyzerSocket.isEmpty())
QTC_ASSERT(connection().is<AnalyzerConnection>(), return false);
auto conn = connection().as<AnalyzerConnection>();
if (conn.analyzerPort != 0)
emit processRunning(conn.analyzerPort);
else if (conn.analyzerSocket.isEmpty())
d->m_noDebugOutputTimer.start();
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppRunning);
......@@ -233,7 +238,7 @@ void QmlProfilerRunControl::processIsRunning(quint16 port)
d->m_noDebugOutputTimer.stop();
if (port == 0)
port = connection().analyzerPort;
port = connection().as<AnalyzerConnection>().analyzerPort;
if (port != 0)
emit processRunning(port);
}
......
......@@ -30,6 +30,7 @@
#include <analyzerbase/ianalyzertool.h>
#include <analyzerbase/analyzerruncontrol.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <analyzerbase/analyzermanager.h>
#include <debugger/debuggerrunconfigurationaspect.h>
......
......@@ -39,6 +39,7 @@
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <utils/fancymainwindow.h>
#include <utils/fileinprojectfinder.h>
......@@ -222,7 +223,7 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunControl *runControl)
runControl->registerProfilerStateManager(d->m_profilerState);
// FIXME: Check that there's something sensible in sp.connParams
auto &connection = runControl->connection();
auto connection = runControl->connection().as<AnalyzerConnection>();
if (!connection.analyzerSocket.isEmpty())
d->m_profilerConnections->setLocalSocket(connection.analyzerSocket);
else
......
......@@ -33,6 +33,7 @@
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <analyzerbase/ianalyzertool.h>
#include <debugger/debuggerruncontrol.h>
......
......@@ -151,7 +151,7 @@ void MemcheckWithGdbRunControl::startDebugger()
const qint64 valgrindPid = runner()->valgrindProcess()->pid();
Debugger::DebuggerStartParameters sp;
sp.inferior.executable = runnable().executable;
sp.inferior = runnable().as<StandardRunnable>();
sp.startMode = Debugger::AttachToRemoteServer;
sp.displayName = QString::fromLatin1("VGdb %1").arg(valgrindPid);
sp.remoteChannel = QString::fromLatin1("| vgdb --pid=%1").arg(valgrindPid);
......
......@@ -28,13 +28,15 @@
#include "valgrindsettings.h"
#include "valgrindplugin.h"
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <coreplugin/icore.h>
#include <coreplugin/ioutputpane.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/progressmanager/futureprogress.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/runconfiguration.h>
#include <analyzerbase/analyzermanager.h>
#include <QApplication>
#include <QMainWindow>
......@@ -85,9 +87,9 @@ bool ValgrindRunControl::startEngine()
ValgrindRunner *run = runner();
run->setValgrindExecutable(m_settings->valgrindExecutable());
run->setValgrindArguments(genericToolArguments() + toolArguments());
run->setConnectionParameters(connection().connParams);
run->setConnectionParameters(connection().as<AnalyzerConnection>().connParams);
run->setUseStartupProject(!m_isCustomStart);
run->setDebuggee(runnable());
run->setDebuggee(runnable().as<StandardRunnable>());
connect(run, &ValgrindRunner::processOutputReceived,
this, &ValgrindRunControl::receiveProcessOutput);
......@@ -111,7 +113,7 @@ void ValgrindRunControl::stopEngine()
QString ValgrindRunControl::executable() const
{
return runnable().executable;
return runnable().as<StandardRunnable>().executable;
}
QStringList ValgrindRunControl::genericToolArguments() const
......
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