ProjectExplorer: Merge AnalyzerRunControl into RunControl

The change is "conceptually wrong", the AnalyzerRunControl derived
classes' functionality should be provided by ToolRunners based classes
encapsulating/"being" the current Analyzer*Runner classes.

However, the AnalyzerRunControl is only three (empty even) virtual
functions, but a big obstacle in merging attempt due to a lot of
mechanical followup changes in downstream users.

The current construction mechanism of analyzer run controls is actually
two different mechanisms (locally direct RunControlFactories, and a
"generic" createAnalyzerRunControl wrapper for remote cases). The generic
createAnalyzerRunControl makes it difficult to migrated them one-by-one,
due to the various downstream users.

So instead of merging the per-analyzer two uses directly reduce
the "indirection" distance by removing the AnalyzerRunControl
intermediate layer. After that the createAnalyzerRunControl mechanism
can be dissolved by using normal RunControlFactories also for
the remote cases. After that, porting to ToolRunner, and combining
with ther local equivalent can be done one by one.

Change-Id: I0ddace33fcce210cf3a547ac5bb23b3d85013934
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2017-03-30 11:54:23 +02:00
parent 43fc2ebeb0
commit 112e32228a
33 changed files with 55 additions and 195 deletions

View File

@@ -29,11 +29,12 @@
#include "androidmanager.h" #include "androidmanager.h"
#include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h> #include <debugger/analyzer/analyzerstartparameters.h>
#include <projectexplorer/target.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h>
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
#include <QDir> #include <QDir>
@@ -47,7 +48,7 @@ namespace Internal {
RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(RunConfiguration *runConfig, Core::Id runMode) RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(RunConfiguration *runConfig, Core::Id runMode)
{ {
AnalyzerRunControl *runControl = Debugger::createAnalyzerRunControl(runConfig, runMode); RunControl *runControl = Debugger::createAnalyzerRunControl(runConfig, runMode);
QTC_ASSERT(runControl, return 0); QTC_ASSERT(runControl, return 0);
AnalyzerConnection connection; AnalyzerConnection connection;
if (runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) { if (runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
@@ -66,17 +67,14 @@ AndroidAnalyzeSupport::AndroidAnalyzeSupport(RunControl *runControl)
: ToolRunner(runControl) : ToolRunner(runControl)
{ {
auto runner = new AndroidRunner(this, runControl->runConfiguration(), runControl->runMode()); auto runner = new AndroidRunner(this, runControl->runConfiguration(), runControl->runMode());
auto analyzerRunControl = qobject_cast<AnalyzerRunControl *>(runControl);
connect(runControl, &AnalyzerRunControl::finished, runner, connect(runControl, &RunControl::finished, runner, [runner] { runner->stop(); });
[runner]() { runner->stop(); });
connect(runControl, &AnalyzerRunControl::starting, runner, connect(runControl, &RunControl::starting, runner, [runner] { runner->start(); });
[runner]() { runner->start(); });
connect(&m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort, this, connect(&m_outputParser, &QmlDebug::QmlOutputParser::waitingForConnectionOnPort, this,
[this, analyzerRunControl](Utils::Port) { [this, runControl](Utils::Port) {
analyzerRunControl->notifyRemoteSetupDone(m_qmlPort); runControl->notifyRemoteSetupDone(m_qmlPort);
}); });
connect(runner, &AndroidRunner::remoteProcessStarted, this, connect(runner, &AndroidRunner::remoteProcessStarted, this,
@@ -85,20 +83,20 @@ AndroidAnalyzeSupport::AndroidAnalyzeSupport(RunControl *runControl)
}); });
connect(runner, &AndroidRunner::remoteProcessFinished, this, connect(runner, &AndroidRunner::remoteProcessFinished, this,
[this, runControl, analyzerRunControl](const QString &errorMsg) { [this, runControl](const QString &errorMsg) {
analyzerRunControl->notifyRemoteFinished(); runControl->notifyRemoteFinished();
runControl->appendMessage(errorMsg, Utils::NormalMessageFormat); appendMessage(errorMsg, Utils::NormalMessageFormat);
}); });
connect(runner, &AndroidRunner::remoteErrorOutput, this, connect(runner, &AndroidRunner::remoteErrorOutput, this,
[this, runControl](const QString &msg) { [this, runControl](const QString &msg) {
runControl->appendMessage(msg, Utils::StdErrFormatSameLine); appendMessage(msg, Utils::StdErrFormatSameLine);
m_outputParser.processOutput(msg); m_outputParser.processOutput(msg);
}); });
connect(runner, &AndroidRunner::remoteOutput, this, connect(runner, &AndroidRunner::remoteOutput, this,
[this, runControl](const QString &msg) { [this, runControl](const QString &msg) {
runControl->appendMessage(msg, Utils::StdOutFormatSameLine); appendMessage(msg, Utils::StdOutFormatSameLine);
m_outputParser.processOutput(msg); m_outputParser.processOutput(msg);
}); });
} }

View File

@@ -31,8 +31,6 @@
#include <qmldebug/qmloutputparser.h> #include <qmldebug/qmloutputparser.h>
namespace Debugger { class AnalyzerRunControl; }
namespace Android { namespace Android {
namespace Internal { namespace Internal {

View File

@@ -36,15 +36,17 @@
#include <debugger/debuggerruncontrol.h> #include <debugger/debuggerruncontrol.h>
#include <debugger/debuggerstartparameters.h> #include <debugger/debuggerstartparameters.h>
#include <debugger/debuggerkitinformation.h> #include <debugger/debuggerkitinformation.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/project.h>
#include <projectexplorer/buildconfiguration.h>
#include <debugger/analyzer/analyzerstartparameters.h> #include <debugger/analyzer/analyzerstartparameters.h>
#include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/kitinformation.h> #include <projectexplorer/kitinformation.h>
#include <projectexplorer/project.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <utils/portlist.h> #include <utils/portlist.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>

View File

@@ -25,7 +25,7 @@
#pragma once #pragma once
#include <debugger/analyzer/analyzerruncontrol.h> #include <projectexplorer/runconfiguration.h>
#include <cpptools/projectinfo.h> #include <cpptools/projectinfo.h>
#include <utils/environment.h> #include <utils/environment.h>

View File

@@ -4,7 +4,6 @@ QT += network
# AnalyzerBase files # AnalyzerBase files
SOURCES += \ SOURCES += \
$$PWD/analyzerruncontrol.cpp \
$$PWD/analyzerrunconfigwidget.cpp \ $$PWD/analyzerrunconfigwidget.cpp \
$$PWD/analyzerutils.cpp \ $$PWD/analyzerutils.cpp \
$$PWD/detailederrorview.cpp \ $$PWD/detailederrorview.cpp \
@@ -13,7 +12,6 @@ SOURCES += \
HEADERS += \ HEADERS += \
$$PWD/analyzerconstants.h \ $$PWD/analyzerconstants.h \
$$PWD/analyzerruncontrol.h \
$$PWD/analyzermanager.h \ $$PWD/analyzermanager.h \
$$PWD/analyzerstartparameters.h \ $$PWD/analyzerstartparameters.h \
$$PWD/analyzerrunconfigwidget.h \ $$PWD/analyzerrunconfigwidget.h \

View File

@@ -44,12 +44,8 @@ class QDockWidget;
class QAction; class QAction;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace ProjectExplorer { class RunConfiguration; }
namespace Debugger { namespace Debugger {
class AnalyzerRunControl;
/** /**
* The mode in which this tool should preferably be run * The mode in which this tool should preferably be run
* *
@@ -93,8 +89,8 @@ public:
/// Returns a new engine for the given start parameters. /// Returns a new engine for the given start parameters.
/// Called each time the tool is launched. /// Called each time the tool is launched.
typedef std::function<AnalyzerRunControl *(ProjectExplorer::RunConfiguration *runConfiguration, typedef std::function<ProjectExplorer::RunControl *(ProjectExplorer::RunConfiguration *runConfiguration,
Core::Id runMode)> RunControlCreator; Core::Id runMode)> RunControlCreator;
RunControlCreator runControlCreator() const { return m_runControlCreator; } RunControlCreator runControlCreator() const { return m_runControlCreator; }
void setRunControlCreator(const RunControlCreator &creator) { m_runControlCreator = creator; } void setRunControlCreator(const RunControlCreator &creator) { m_runControlCreator = creator; }
@@ -146,7 +142,7 @@ DEBUGGER_EXPORT void showPermanentStatusMessage(const QString &message);
DEBUGGER_EXPORT QAction *createStartAction(); DEBUGGER_EXPORT QAction *createStartAction();
DEBUGGER_EXPORT QAction *createStopAction(); DEBUGGER_EXPORT QAction *createStopAction();
DEBUGGER_EXPORT AnalyzerRunControl *createAnalyzerRunControl( DEBUGGER_EXPORT ProjectExplorer::RunControl *createAnalyzerRunControl(
ProjectExplorer::RunConfiguration *runConfiguration, Core::Id runMode); ProjectExplorer::RunConfiguration *runConfiguration, Core::Id runMode);
} // namespace Debugger } // namespace Debugger

View File

@@ -1,37 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Author: Andreas Hartmetz, KDAB (andreas.hartmetz@kdab.com)
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "analyzerruncontrol.h"
using namespace ProjectExplorer;
namespace Debugger {
AnalyzerRunControl::AnalyzerRunControl(RunConfiguration *runConfiguration, Core::Id runMode)
: RunControl(runConfiguration, runMode)
{}
} // namespace Debugger

View File

@@ -1,54 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Author: Andreas Hartmetz, KDAB (andreas.hartmetz@kdab.com)
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <debugger/debugger_global.h>
#include <projectexplorer/runconfiguration.h>
#include <utils/port.h>
namespace Debugger {
/**
* An AnalyzerRunControl instance handles the launch of an analyzation tool.
*
* It gets created for each launch and deleted when the launch is stopped or ended.
*/
class DEBUGGER_EXPORT AnalyzerRunControl : public ProjectExplorer::RunControl
{
Q_OBJECT
public:
AnalyzerRunControl(ProjectExplorer::RunConfiguration *runConfiguration, Core::Id runMode);
virtual void notifyRemoteSetupDone(Utils::Port) {}
virtual void notifyRemoteSetupFailed(const QString &) {}
virtual void notifyRemoteFinished() {}
};
} // namespace Debugger

View File

@@ -239,8 +239,6 @@ Project {
"analyzermanager.h", "analyzermanager.h",
"analyzerrunconfigwidget.cpp", "analyzerrunconfigwidget.cpp",
"analyzerrunconfigwidget.h", "analyzerrunconfigwidget.h",
"analyzerruncontrol.cpp",
"analyzerruncontrol.h",
"analyzerstartparameters.h", "analyzerstartparameters.h",
"analyzerutils.cpp", "analyzerutils.cpp",
"analyzerutils.h", "analyzerutils.h",

View File

@@ -66,7 +66,6 @@
#include "analyzer/analyzerconstants.h" #include "analyzer/analyzerconstants.h"
#include "analyzer/analyzermanager.h" #include "analyzer/analyzermanager.h"
#include "analyzer/analyzerruncontrol.h"
#include "analyzer/analyzerstartparameters.h" #include "analyzer/analyzerstartparameters.h"
#include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actioncontainer.h>
@@ -3634,7 +3633,7 @@ void showPermanentStatusMessage(const QString &message)
dd->m_mainWindow->showStatusMessage(message, -1); dd->m_mainWindow->showStatusMessage(message, -1);
} }
AnalyzerRunControl *createAnalyzerRunControl(RunConfiguration *runConfiguration, Id runMode) RunControl *createAnalyzerRunControl(RunConfiguration *runConfiguration, Id runMode)
{ {
foreach (const ActionDescription &action, dd->m_descriptions) { foreach (const ActionDescription &action, dd->m_descriptions) {
if (action.runMode() == runMode) if (action.runMode() == runMode)

View File

@@ -26,9 +26,6 @@
#include "iosanalyzesupport.h" #include "iosanalyzesupport.h"
#include "iosrunner.h" #include "iosrunner.h"
#include <debugger/analyzer/analyzerruncontrol.h>
using namespace Debugger;
using namespace ProjectExplorer; using namespace ProjectExplorer;
namespace Ios { namespace Ios {
@@ -79,7 +76,7 @@ void IosAnalyzeSupport::handleGotInferiorPid(qint64 pid, Utils::Port qmlPort)
void IosAnalyzeSupport::handleRemoteProcessFinished(bool cleanEnd) void IosAnalyzeSupport::handleRemoteProcessFinished(bool cleanEnd)
{ {
if (!cleanEnd) if (!cleanEnd)
runControl()->appendMessage(tr("Run ended with error."), Utils::ErrorMessageFormat); appendMessage(tr("Run ended with error."), Utils::ErrorMessageFormat);
else else
appendMessage(tr("Run ended."), Utils::NormalMessageFormat); appendMessage(tr("Run ended."), Utils::NormalMessageFormat);
runControl()->notifyRemoteFinished(); runControl()->notifyRemoteFinished();
@@ -97,10 +94,5 @@ void IosAnalyzeSupport::handleRemoteErrorOutput(const QString &output)
m_outputParser.processOutput(output); m_outputParser.processOutput(output);
} }
AnalyzerRunControl *IosAnalyzeSupport::runControl()
{
return qobject_cast<AnalyzerRunControl *>(ToolRunner::runControl());
}
} // namespace Internal } // namespace Internal
} // namespace Ios } // namespace Ios

View File

@@ -29,14 +29,9 @@
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <utils/port.h>
namespace Debugger { class AnalyzerRunControl; }
namespace Ios { namespace Ios {
namespace Internal { namespace Internal {
class IosRunConfiguration;
class IosRunner; class IosRunner;
class IosAnalyzeSupport : public ProjectExplorer::ToolRunner class IosAnalyzeSupport : public ProjectExplorer::ToolRunner
@@ -55,7 +50,6 @@ private:
void handleRemoteOutput(const QString &output); void handleRemoteOutput(const QString &output);
void handleRemoteErrorOutput(const QString &output); void handleRemoteErrorOutput(const QString &output);
Debugger::AnalyzerRunControl *runControl();
IosRunner * const m_runner; IosRunner * const m_runner;
QmlDebug::QmlOutputParser m_outputParser; QmlDebug::QmlOutputParser m_outputParser;
Utils::Port m_qmlPort; Utils::Port m_qmlPort;

View File

@@ -33,7 +33,6 @@
#include "iosanalyzesupport.h" #include "iosanalyzesupport.h"
#include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h> #include <debugger/analyzer/analyzerstartparameters.h>
#include <debugger/debuggerconstants.h> #include <debugger/debuggerconstants.h>
@@ -185,7 +184,7 @@ RunControl *IosRunControlFactory::create(RunConfiguration *runConfig,
if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE)
res = new Ios::Internal::IosRunControl(rc); res = new Ios::Internal::IosRunControl(rc);
else if (mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) { else if (mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
AnalyzerRunControl *runControl = Debugger::createAnalyzerRunControl(runConfig, mode); RunControl *runControl = Debugger::createAnalyzerRunControl(runConfig, mode);
QTC_ASSERT(runControl, return 0); QTC_ASSERT(runControl, return 0);
IDevice::ConstPtr device = DeviceKitInformation::device(target->kit()); IDevice::ConstPtr device = DeviceKitInformation::device(target->kit());
if (device.isNull()) if (device.isNull())

View File

@@ -30,6 +30,7 @@
#include "applicationlauncher.h" #include "applicationlauncher.h"
#include "devicesupport/idevice.h" #include "devicesupport/idevice.h"
#include <utils/port.h>
#include <utils/processhandle.h> #include <utils/processhandle.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/icon.h> #include <utils/icon.h>
@@ -407,6 +408,10 @@ public:
virtual void appendMessage(const QString &msg, Utils::OutputFormat format); virtual void appendMessage(const QString &msg, Utils::OutputFormat format);
virtual void bringApplicationToForeground(); virtual void bringApplicationToForeground();
virtual void notifyRemoteSetupDone(Utils::Port) {} // FIXME: Replace by ToolRunner functionality
virtual void notifyRemoteSetupFailed(const QString &) {} // Same.
virtual void notifyRemoteFinished() {} // Same.
signals: signals:
void appendMessageRequested(ProjectExplorer::RunControl *runControl, void appendMessageRequested(ProjectExplorer::RunControl *runControl,
const QString &msg, Utils::OutputFormat format); const QString &msg, Utils::OutputFormat format);

View File

@@ -31,8 +31,8 @@
#include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/kitinformation.h> #include <projectexplorer/kitinformation.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qmldebug/qmldebugcommandlinearguments.h> #include <qmldebug/qmldebugcommandlinearguments.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <utils/temporaryfile.h> #include <utils/temporaryfile.h>
@@ -67,24 +67,24 @@ Utils::Port LocalQmlProfilerRunner::findFreePort(QString &host)
} }
LocalQmlProfilerRunner::LocalQmlProfilerRunner(const Configuration &configuration, LocalQmlProfilerRunner::LocalQmlProfilerRunner(const Configuration &configuration,
Debugger::AnalyzerRunControl *runControl) : RunControl *runControl) :
QObject(runControl), QObject(runControl),
m_configuration(configuration) m_configuration(configuration)
{ {
connect(&m_launcher, &ApplicationLauncher::appendMessage, connect(&m_launcher, &ApplicationLauncher::appendMessage,
this, &LocalQmlProfilerRunner::appendMessage); this, &LocalQmlProfilerRunner::appendMessage);
connect(this, &LocalQmlProfilerRunner::stopped, connect(this, &LocalQmlProfilerRunner::stopped,
runControl, &Debugger::AnalyzerRunControl::notifyRemoteFinished); runControl, &RunControl::notifyRemoteFinished);
connect(this, &LocalQmlProfilerRunner::appendMessage, connect(this, &LocalQmlProfilerRunner::appendMessage,
runControl, &Debugger::AnalyzerRunControl::appendMessage); runControl, &RunControl::appendMessage);
connect(runControl, &Debugger::AnalyzerRunControl::starting, connect(runControl, &RunControl::starting,
this, &LocalQmlProfilerRunner::start); this, &LocalQmlProfilerRunner::start);
connect(runControl, &RunControl::finished, connect(runControl, &RunControl::finished,
this, &LocalQmlProfilerRunner::stop); this, &LocalQmlProfilerRunner::stop);
m_outputParser.setNoOutputText(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput()); m_outputParser.setNoOutputText(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput());
connect(runControl, &Debugger::AnalyzerRunControl::appendMessageRequested, connect(runControl, &RunControl::appendMessageRequested,
this, [this](RunControl *runControl, const QString &msg, Utils::OutputFormat format) { this, [this](RunControl *runControl, const QString &msg, Utils::OutputFormat format) {
Q_UNUSED(runControl); Q_UNUSED(runControl);
Q_UNUSED(format); Q_UNUSED(format);

View File

@@ -32,10 +32,6 @@
#include <projectexplorer/runnables.h> #include <projectexplorer/runnables.h>
#include <qmldebug/qmloutputparser.h> #include <qmldebug/qmloutputparser.h>
namespace Debugger {
class AnalyzerRunControl;
}
namespace QmlProfiler { namespace QmlProfiler {
class QMLPROFILER_EXPORT LocalQmlProfilerRunner : public QObject class QMLPROFILER_EXPORT LocalQmlProfilerRunner : public QObject
@@ -50,7 +46,7 @@ public:
}; };
LocalQmlProfilerRunner(const Configuration &configuration, LocalQmlProfilerRunner(const Configuration &configuration,
Debugger::AnalyzerRunControl *runControl); ProjectExplorer::RunControl *runControl);
static Utils::Port findFreePort(QString &host); static Utils::Port findFreePort(QString &host);
static QString findFreeSocket(); static QString findFreeSocket();

View File

@@ -78,7 +78,7 @@ public:
QmlProfilerRunControl::QmlProfilerRunControl(RunConfiguration *runConfiguration, QmlProfilerRunControl::QmlProfilerRunControl(RunConfiguration *runConfiguration,
Internal::QmlProfilerTool *tool) Internal::QmlProfilerTool *tool)
: AnalyzerRunControl(runConfiguration, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) : RunControl(runConfiguration, ProjectExplorer::Constants::QML_PROFILER_RUN_MODE)
, d(new QmlProfilerRunControlPrivate) , d(new QmlProfilerRunControlPrivate)
{ {
setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR); setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);

View File

@@ -27,14 +27,14 @@
#include "qmlprofilerstatemanager.h" #include "qmlprofilerstatemanager.h"
#include <debugger/analyzer/analyzerruncontrol.h> #include <projectexplorer/runconfiguration.h>
#include <utils/outputformat.h> #include <utils/outputformat.h>
namespace QmlProfiler { namespace QmlProfiler {
namespace Internal { class QmlProfilerTool; } namespace Internal { class QmlProfilerTool; }
class QmlProfilerRunControl : public Debugger::AnalyzerRunControl class QmlProfilerRunControl : public ProjectExplorer::RunControl
{ {
Q_OBJECT Q_OBJECT

View File

@@ -29,7 +29,6 @@
#include "qmlprofilerrunconfigurationaspect.h" #include "qmlprofilerrunconfigurationaspect.h"
#include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h> #include <debugger/analyzer/analyzerstartparameters.h>
#include <debugger/debuggerrunconfigurationaspect.h> #include <debugger/debuggerrunconfigurationaspect.h>

View File

@@ -40,7 +40,6 @@
#include <debugger/debuggericons.h> #include <debugger/debuggericons.h>
#include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h> #include <debugger/analyzer/analyzerstartparameters.h>
#include <utils/fancymainwindow.h> #include <utils/fancymainwindow.h>
@@ -318,7 +317,7 @@ void QmlProfilerTool::updateRunActions()
} }
} }
AnalyzerRunControl *QmlProfilerTool::createRunControl(RunConfiguration *runConfiguration) RunControl *QmlProfilerTool::createRunControl(RunConfiguration *runConfiguration)
{ {
d->m_toolBusy = true; d->m_toolBusy = true;
if (runConfiguration) { if (runConfiguration) {

View File

@@ -30,7 +30,6 @@
#include "qmlprofilereventtypes.h" #include "qmlprofilereventtypes.h"
#include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QMessageBox; class QMessageBox;
@@ -50,7 +49,7 @@ public:
explicit QmlProfilerTool(QObject *parent); explicit QmlProfilerTool(QObject *parent);
~QmlProfilerTool(); ~QmlProfilerTool();
Debugger::AnalyzerRunControl *createRunControl(ProjectExplorer::RunConfiguration *runConfiguration = 0); ProjectExplorer::RunControl *createRunControl(ProjectExplorer::RunConfiguration *runConfiguration = 0);
void finalizeRunControl(QmlProfilerRunControl *runControl); void finalizeRunControl(QmlProfilerRunControl *runControl);
bool prepareTool(); bool prepareTool();

View File

@@ -25,7 +25,6 @@
#include "localqmlprofilerrunner_test.h" #include "localqmlprofilerrunner_test.h"
#include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h> #include <debugger/analyzer/analyzerstartparameters.h>
#include <QtTest> #include <QtTest>
#include <QTcpServer> #include <QTcpServer>

View File

@@ -52,7 +52,7 @@ private:
bool running = false; bool running = false;
int runCount = 0; int runCount = 0;
Debugger::AnalyzerRunControl *rc = nullptr; ProjectExplorer::RunControl *rc = nullptr;
Debugger::AnalyzerConnection connection; Debugger::AnalyzerConnection connection;
LocalQmlProfilerRunner::Configuration configuration; LocalQmlProfilerRunner::Configuration configuration;
}; };

View File

@@ -29,7 +29,6 @@
#include "qnxrunconfiguration.h" #include "qnxrunconfiguration.h"
#include "slog2inforunner.h" #include "slog2inforunner.h"
#include <debugger/analyzer/analyzerruncontrol.h>
#include <projectexplorer/kitinformation.h> #include <projectexplorer/kitinformation.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
@@ -111,11 +110,6 @@ void QnxAnalyzeSupport::startExecution()
appRunner()->start(r, device()); appRunner()->start(r, device());
} }
Debugger::AnalyzerRunControl *QnxAnalyzeSupport::runControl()
{
return qobject_cast<Debugger::AnalyzerRunControl *>(QnxAbstractRunSupport::runControl());
}
void QnxAnalyzeSupport::handleRemoteProcessFinished(bool success) void QnxAnalyzeSupport::handleRemoteProcessFinished(bool success)
{ {
if (!success) if (!success)

View File

@@ -31,8 +31,6 @@
#include <utils/outputformat.h> #include <utils/outputformat.h>
#include <qmldebug/qmloutputparser.h> #include <qmldebug/qmloutputparser.h>
namespace Debugger { class AnalyzerRunControl; }
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
@@ -58,7 +56,6 @@ private:
void remoteIsRunning(); void remoteIsRunning();
void startExecution() override; void startExecution() override;
Debugger::AnalyzerRunControl *runControl();
ProjectExplorer::StandardRunnable m_runnable; ProjectExplorer::StandardRunnable m_runnable;
QmlDebug::QmlOutputParser m_outputParser; QmlDebug::QmlOutputParser m_outputParser;

View File

@@ -39,7 +39,6 @@
#include <debugger/debuggerkitinformation.h> #include <debugger/debuggerkitinformation.h>
#include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerstartparameters.h> #include <debugger/analyzer/analyzerstartparameters.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <projectexplorer/environmentaspect.h> #include <projectexplorer/environmentaspect.h>
#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
@@ -141,7 +140,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id m
const IDevice::ConstPtr device = DeviceKitInformation::device(kit); const IDevice::ConstPtr device = DeviceKitInformation::device(kit);
if (device.isNull()) if (device.isNull())
return 0; return 0;
AnalyzerRunControl *runControl = Debugger::createAnalyzerRunControl(runConfig, mode); RunControl *runControl = Debugger::createAnalyzerRunControl(runConfig, mode);
QTC_ASSERT(runControl, return 0); QTC_ASSERT(runControl, return 0);
runControl->setRunnable(runConfig->runnable()); runControl->setRunnable(runConfig->runnable());
AnalyzerConnection connection; AnalyzerConnection connection;

View File

@@ -27,8 +27,6 @@
#include "remotelinuxrunconfiguration.h" #include "remotelinuxrunconfiguration.h"
#include <debugger/analyzer/analyzerruncontrol.h>
#include <projectexplorer/buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
@@ -44,7 +42,6 @@
#include <QPointer> #include <QPointer>
using namespace QSsh; using namespace QSsh;
using namespace Debugger;
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
@@ -198,9 +195,7 @@ void RemoteLinuxAnalyzeSupport::handleAppRunnerFinished(bool success)
reset(); reset();
if (!success) if (!success)
showMessage(tr("Failure running remote process."), Utils::NormalMessageFormat); showMessage(tr("Failure running remote process."), Utils::NormalMessageFormat);
auto rc = qobject_cast<AnalyzerRunControl *>(runControl()); runControl()->notifyRemoteFinished();
QTC_ASSERT(rc, return);
rc->notifyRemoteFinished();
} }
void RemoteLinuxAnalyzeSupport::handleProfilingFinished() void RemoteLinuxAnalyzeSupport::handleProfilingFinished()
@@ -210,9 +205,7 @@ void RemoteLinuxAnalyzeSupport::handleProfilingFinished()
void RemoteLinuxAnalyzeSupport::remoteIsRunning() void RemoteLinuxAnalyzeSupport::remoteIsRunning()
{ {
auto rc = qobject_cast<AnalyzerRunControl *>(runControl()); runControl()->notifyRemoteSetupDone(d->qmlPort);
QTC_ASSERT(rc, return);
rc->notifyRemoteSetupDone(d->qmlPort);
} }
void RemoteLinuxAnalyzeSupport::handleRemoteOutput(const QByteArray &output) void RemoteLinuxAnalyzeSupport::handleRemoteOutput(const QByteArray &output)

View File

@@ -32,8 +32,6 @@
#include <utils/outputformat.h> #include <utils/outputformat.h>
namespace Debugger { class AnalyzerRunControl; }
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { class RemoteLinuxAnalyzeSupportPrivate; } namespace Internal { class RemoteLinuxAnalyzeSupportPrivate; }

View File

@@ -31,7 +31,6 @@
#include "remotelinuxrunconfiguration.h" #include "remotelinuxrunconfiguration.h"
#include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h> #include <debugger/analyzer/analyzerstartparameters.h>
#include <debugger/debuggerruncontrol.h> #include <debugger/debuggerruncontrol.h>

View File

@@ -748,7 +748,7 @@ ValgrindRunControl *CallgrindTool::createRunControl(RunConfiguration *runConfigu
auto runControl = new CallgrindRunControl(runConfiguration, runMode); auto runControl = new CallgrindRunControl(runConfiguration, runMode);
connect(runControl, &CallgrindRunControl::parserDataReady, this, &CallgrindTool::takeParserDataFromRunControl); connect(runControl, &CallgrindRunControl::parserDataReady, this, &CallgrindTool::takeParserDataFromRunControl);
connect(runControl, &AnalyzerRunControl::starting, this, &CallgrindTool::engineStarting); connect(runControl, &RunControl::starting, this, &CallgrindTool::engineStarting);
connect(runControl, &RunControl::finished, this, &CallgrindTool::engineFinished); connect(runControl, &RunControl::finished, this, &CallgrindTool::engineFinished);
connect(this, &CallgrindTool::dumpRequested, runControl, &CallgrindRunControl::dump); connect(this, &CallgrindTool::dumpRequested, runControl, &CallgrindRunControl::dump);

View File

@@ -242,7 +242,7 @@ class MemcheckTool : public QObject
public: public:
MemcheckTool(QObject *parent); MemcheckTool(QObject *parent);
AnalyzerRunControl *createRunControl(RunConfiguration *runConfiguration, Core::Id runMode); RunControl *createRunControl(RunConfiguration *runConfiguration, Core::Id runMode);
private: private:
void updateRunActions(); void updateRunActions();
@@ -421,7 +421,7 @@ MemcheckTool::MemcheckTool(QObject *parent)
StartRemoteDialog dlg; StartRemoteDialog dlg;
if (dlg.exec() != QDialog::Accepted) if (dlg.exec() != QDialog::Accepted)
return; return;
AnalyzerRunControl *rc = createRunControl(runConfig, MEMCHECK_RUN_MODE); RunControl *rc = createRunControl(runConfig, MEMCHECK_RUN_MODE);
QTC_ASSERT(rc, return); QTC_ASSERT(rc, return);
const auto runnable = dlg.runnable(); const auto runnable = dlg.runnable();
rc->setRunnable(runnable); rc->setRunnable(runnable);
@@ -531,7 +531,7 @@ void MemcheckTool::maybeActiveRunConfigurationChanged()
updateFromSettings(); updateFromSettings();
} }
AnalyzerRunControl *MemcheckTool::createRunControl(RunConfiguration *runConfiguration, Core::Id runMode) RunControl *MemcheckTool::createRunControl(RunConfiguration *runConfiguration, Core::Id runMode)
{ {
m_errorModel.setRelevantFrameFinder(makeFrameFinder(runConfiguration m_errorModel.setRelevantFrameFinder(makeFrameFinder(runConfiguration
? runConfiguration->target()->project()->files(Project::AllFiles) : QStringList())); ? runConfiguration->target()->project()->files(Project::AllFiles) : QStringList()));

View File

@@ -54,7 +54,7 @@ namespace Valgrind {
namespace Internal { namespace Internal {
ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core::Id runMode) ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core::Id runMode)
: AnalyzerRunControl(runConfiguration, runMode) : RunControl(runConfiguration, runMode)
{ {
setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR); setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);
QTC_ASSERT(runConfiguration, return); QTC_ASSERT(runConfiguration, return);

View File

@@ -26,7 +26,7 @@
#pragma once #pragma once
#include <debugger/analyzer/analyzerruncontrol.h> #include <projectexplorer/runconfiguration.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <valgrind/valgrindrunner.h> #include <valgrind/valgrindrunner.h>
#include <valgrind/valgrindsettings.h> #include <valgrind/valgrindsettings.h>
@@ -37,7 +37,7 @@
namespace Valgrind { namespace Valgrind {
namespace Internal { namespace Internal {
class ValgrindRunControl : public Debugger::AnalyzerRunControl class ValgrindRunControl : public ProjectExplorer::RunControl
{ {
Q_OBJECT Q_OBJECT