forked from qt-creator/qt-creator
Analyzer: create a run control factory for all tools.
Having one factory per tool (or plugin) created some bugs: * analyzer project settings being created twice * per-project analyzer settings widget duplicated Also, most of the code from the run control factory were copied. Now, the Analyzer only creates one run control factory shared among all tools, and the IAnalyzerTool has two new virtual method: canRun and createStartParameters. It simplify the code a bit, and creating a new analyzer tool is easier (only two classes to subclass: IAnalyzerTool and IAnalyzerEngine). Change-Id: I4e180846a26b74b2b77cb99bc97534d680a80a4d Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
committed by
hjk
parent
26ae954fae
commit
4a8432112a
@@ -20,7 +20,8 @@ SOURCES += \
|
||||
analyzeroptionspage.cpp \
|
||||
analyzerrunconfigwidget.cpp \
|
||||
analyzerutils.cpp \
|
||||
startremotedialog.cpp
|
||||
startremotedialog.cpp \
|
||||
analyzerruncontrolfactory.cpp
|
||||
|
||||
HEADERS += \
|
||||
ianalyzerengine.h \
|
||||
@@ -35,7 +36,8 @@ HEADERS += \
|
||||
analyzeroptionspage.h \
|
||||
analyzerrunconfigwidget.h \
|
||||
analyzerutils.h \
|
||||
startremotedialog.h
|
||||
startremotedialog.h \
|
||||
analyzerruncontrolfactory.h
|
||||
|
||||
FORMS += \
|
||||
startremotedialog.ui
|
||||
|
||||
@@ -908,7 +908,6 @@ IAnalyzerTool *AnalyzerManager::toolFromId(const Core::Id &id)
|
||||
foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
|
||||
if (id.name().startsWith(tool->id().name()))
|
||||
return tool;
|
||||
QTC_ASSERT(false, qDebug() << "NO ANAYLYZER TOOL FOUND FOR ID" << id.name());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "analyzerconstants.h"
|
||||
#include "analyzermanager.h"
|
||||
#include "ianalyzertool.h"
|
||||
#include "analyzerruncontrolfactory.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/imode.h>
|
||||
@@ -79,6 +80,8 @@ bool AnalyzerPlugin::initialize(const QStringList &arguments, QString *errorStri
|
||||
|
||||
(void) new AnalyzerManager(this);
|
||||
|
||||
addAutoReleasedObject(new AnalyzerRunControlFactory());
|
||||
|
||||
// Task integration.
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
ProjectExplorer::TaskHub *hub = pm->getObject<ProjectExplorer::TaskHub>();
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include "analyzerrunconfigwidget.h"
|
||||
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
@@ -45,18 +44,31 @@
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
namespace Analyzer {
|
||||
namespace Internal {
|
||||
|
||||
AnalyzerToolDetailWidget::AnalyzerToolDetailWidget(AbstractAnalyzerSubConfig *config, QWidget *parent)
|
||||
: Utils::DetailsWidget(parent)
|
||||
{
|
||||
QTC_ASSERT(config!=0, return);
|
||||
|
||||
// update summary text
|
||||
setSummaryText(tr("<strong>%1</strong> settings").arg(config->displayName()));
|
||||
|
||||
// create config widget
|
||||
QWidget *configWidget = config->createConfigWidget(this);
|
||||
setWidget(configWidget);
|
||||
}
|
||||
|
||||
AnalyzerRunConfigWidget::AnalyzerRunConfigWidget()
|
||||
: m_detailsWidget(new Utils::DetailsWidget(this))
|
||||
{
|
||||
QWidget *mainWidget = new QWidget(this);
|
||||
new QVBoxLayout(mainWidget);
|
||||
m_detailsWidget->setWidget(mainWidget);
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QWidget *globalSetting = new QWidget(mainWidget);
|
||||
QWidget *globalSetting = new QWidget(this);
|
||||
QHBoxLayout *globalSettingLayout = new QHBoxLayout(globalSetting);
|
||||
mainWidget->layout()->addWidget(globalSetting);
|
||||
QLabel *label = new QLabel(displayName(), globalSetting);
|
||||
globalSettingLayout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->addWidget(globalSetting);
|
||||
QLabel *label = new QLabel(tr("Analyzer Settings:"), globalSetting);
|
||||
globalSettingLayout->addWidget(label);
|
||||
m_settingsCombo = new QComboBox(globalSetting);
|
||||
m_settingsCombo->addItems(QStringList()
|
||||
@@ -72,13 +84,9 @@ AnalyzerRunConfigWidget::AnalyzerRunConfigWidget()
|
||||
connect(m_restoreButton, SIGNAL(clicked()), this, SLOT(restoreGlobal()));
|
||||
globalSettingLayout->addStretch(2);
|
||||
|
||||
m_subConfigWidget = new QWidget(mainWidget);
|
||||
mainWidget->layout()->addWidget(m_subConfigWidget);
|
||||
m_subConfigWidget = new QWidget(this);
|
||||
new QVBoxLayout(m_subConfigWidget);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->addWidget(m_detailsWidget);
|
||||
layout->addWidget(m_subConfigWidget);
|
||||
}
|
||||
|
||||
QString AnalyzerRunConfigWidget::displayName() const
|
||||
@@ -93,29 +101,28 @@ void AnalyzerRunConfigWidget::setRunConfiguration(ProjectExplorer::RunConfigurat
|
||||
m_settings = rc->extraAspect<AnalyzerProjectSettings>();
|
||||
QTC_ASSERT(m_settings, return);
|
||||
|
||||
// update summary text
|
||||
QStringList tools;
|
||||
foreach (AbstractAnalyzerSubConfig *config, m_settings->subConfigs()) {
|
||||
tools << QString("<strong>%1</strong>").arg(config->displayName());
|
||||
}
|
||||
m_detailsWidget->setSummaryText(tr("Available settings: %1").arg(tools.join(", ")));
|
||||
|
||||
// add group boxes for each sub config
|
||||
QLayout *layout = m_subConfigWidget->layout();
|
||||
// add config widget for each sub config
|
||||
foreach (AbstractAnalyzerSubConfig *config, m_settings->customSubConfigs()) {
|
||||
QWidget *widget = config->createConfigWidget(this);
|
||||
layout->addWidget(widget);
|
||||
QWidget *widget = new AnalyzerToolDetailWidget(config);
|
||||
m_subConfigWidget->layout()->addWidget(widget);
|
||||
}
|
||||
m_subConfigWidget->setEnabled(!m_settings->isUsingGlobalSettings());
|
||||
setDetailEnabled(!m_settings->isUsingGlobalSettings());
|
||||
m_settingsCombo->setCurrentIndex(m_settings->isUsingGlobalSettings() ? 0 : 1);
|
||||
m_restoreButton->setEnabled(!m_settings->isUsingGlobalSettings());
|
||||
}
|
||||
|
||||
void AnalyzerRunConfigWidget::setDetailEnabled(bool value)
|
||||
{
|
||||
QList<AnalyzerToolDetailWidget*> details = findChildren<AnalyzerToolDetailWidget*>();
|
||||
foreach (AnalyzerToolDetailWidget *detail, details)
|
||||
detail->widget()->setEnabled(value);
|
||||
}
|
||||
|
||||
void AnalyzerRunConfigWidget::chooseSettings(int setting)
|
||||
{
|
||||
QTC_ASSERT(m_settings, return);
|
||||
setDetailEnabled(setting != 0);
|
||||
m_settings->setUsingGlobalSettings(setting == 0);
|
||||
m_subConfigWidget->setEnabled(!m_settings->isUsingGlobalSettings());
|
||||
m_restoreButton->setEnabled(!m_settings->isUsingGlobalSettings());
|
||||
}
|
||||
|
||||
@@ -125,4 +132,5 @@ void AnalyzerRunConfigWidget::restoreGlobal()
|
||||
m_settings->resetCustomToGlobalSettings();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Analyzer
|
||||
|
||||
@@ -35,11 +35,12 @@
|
||||
#ifndef ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
|
||||
#define ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
|
||||
|
||||
#include "analyzerbase_global.h"
|
||||
#include "analyzersettings.h"
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <utils/detailswidget.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QComboBox;
|
||||
class QPushButton;
|
||||
@@ -52,8 +53,19 @@ class DetailsWidget;
|
||||
namespace Analyzer {
|
||||
|
||||
class AnalyzerSettings;
|
||||
class AbstractAnalyzerSubConfig;
|
||||
|
||||
class ANALYZER_EXPORT AnalyzerRunConfigWidget : public ProjectExplorer::RunConfigWidget
|
||||
namespace Internal {
|
||||
|
||||
class AnalyzerToolDetailWidget : public Utils::DetailsWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AnalyzerToolDetailWidget(AbstractAnalyzerSubConfig *config, QWidget *parent=0);
|
||||
};
|
||||
|
||||
class AnalyzerRunConfigWidget : public ProjectExplorer::RunConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -64,18 +76,21 @@ public:
|
||||
|
||||
void setRunConfiguration(ProjectExplorer::RunConfiguration *rc);
|
||||
|
||||
private:
|
||||
void setDetailEnabled(bool value);
|
||||
|
||||
private slots:
|
||||
void chooseSettings(int setting);
|
||||
void restoreGlobal();
|
||||
|
||||
private:
|
||||
Utils::DetailsWidget *m_detailsWidget;
|
||||
QWidget *m_subConfigWidget;
|
||||
AnalyzerProjectSettings *m_settings;
|
||||
QComboBox *m_settingsCombo;
|
||||
QPushButton *m_restoreButton;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Analyzer
|
||||
|
||||
#endif // ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (C) 2011 Kläralvdalens Datakonsult AB, a KDAB Group company.
|
||||
**
|
||||
** Contact: Kläralvdalens Datakonsult AB (info@kdab.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "analyzerruncontrolfactory.h"
|
||||
#include "analyzersettings.h"
|
||||
#include "analyzerruncontrol.h"
|
||||
#include "analyzerrunconfigwidget.h"
|
||||
#include "analyzermanager.h"
|
||||
#include "ianalyzertool.h"
|
||||
#include "analyzerstartparameters.h"
|
||||
|
||||
#include <projectexplorer/applicationrunconfiguration.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QAction>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace Analyzer {
|
||||
namespace Internal {
|
||||
|
||||
AnalyzerRunControlFactory::AnalyzerRunControlFactory(QObject *parent) :
|
||||
IRunControlFactory(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QString AnalyzerRunControlFactory::displayName() const
|
||||
{
|
||||
return tr("Analyzer");
|
||||
}
|
||||
|
||||
bool AnalyzerRunControlFactory::canRun(RunConfiguration *runConfiguration, const QString &mode) const
|
||||
{
|
||||
IAnalyzerTool *tool = AnalyzerManager::toolFromId(Core::Id(mode));
|
||||
if (tool)
|
||||
return tool->canRun(runConfiguration, mode);
|
||||
return false;
|
||||
}
|
||||
|
||||
RunControl *AnalyzerRunControlFactory::create(RunConfiguration *runConfiguration, const QString &mode)
|
||||
{
|
||||
IAnalyzerTool *tool = AnalyzerManager::toolFromId(Core::Id(mode));
|
||||
if (!tool)
|
||||
return 0;
|
||||
|
||||
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
||||
|
||||
AnalyzerStartParameters sp = tool->createStartParameters(runConfiguration, mode);
|
||||
sp.toolId = tool->id();
|
||||
|
||||
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration);
|
||||
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
||||
return rc;
|
||||
}
|
||||
|
||||
IRunConfigurationAspect *AnalyzerRunControlFactory::createRunConfigurationAspect()
|
||||
{
|
||||
return new AnalyzerProjectSettings;
|
||||
}
|
||||
|
||||
RunConfigWidget *AnalyzerRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
|
||||
{
|
||||
AnalyzerProjectSettings *settings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
|
||||
if (!settings)
|
||||
return 0;
|
||||
|
||||
AnalyzerRunConfigWidget *ret = new AnalyzerRunConfigWidget;
|
||||
ret->setRunConfiguration(runConfiguration);
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Analyzer
|
||||
+10
-13
@@ -2,9 +2,9 @@
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** Copyright (C) 2011 Kläralvdalens Datakonsult AB, a KDAB Group company.
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
** Contact: Kläralvdalens Datakonsult AB (info@kdab.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
@@ -26,27 +26,26 @@
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef QMLPROFILERRUNCONTROLFACTORY_H
|
||||
#define QMLPROFILERRUNCONTROLFACTORY_H
|
||||
#ifndef ANALYZERRUNCONTROLFACTORY_H
|
||||
#define ANALYZERRUNCONTROLFACTORY_H
|
||||
|
||||
#include <analyzerbase/analyzerruncontrol.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
namespace QmlProfiler {
|
||||
namespace Analyzer {
|
||||
namespace Internal {
|
||||
|
||||
class QmlProfilerRunControlFactory : public ProjectExplorer::IRunControlFactory
|
||||
class AnalyzerRunControlFactory : public ProjectExplorer::IRunControlFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
typedef ProjectExplorer::RunConfiguration RunConfiguration;
|
||||
|
||||
QmlProfilerRunControlFactory(QObject *parent = 0);
|
||||
explicit AnalyzerRunControlFactory(QObject *parent = 0);
|
||||
|
||||
// IRunControlFactory implementation
|
||||
QString displayName() const;
|
||||
@@ -55,11 +54,9 @@ public:
|
||||
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect();
|
||||
ProjectExplorer::RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
||||
|
||||
signals:
|
||||
void runControlCreated(Analyzer::AnalyzerRunControl *);
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QmlProfiler
|
||||
} // namespace Analyzer
|
||||
|
||||
#endif // QMLPROFILERRUNCONTROLFACTORY_H
|
||||
#endif // ANALYZERRUNCONTROLFACTORY_H
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
#include "analyzerbase_global.h"
|
||||
#include "analyzerconstants.h"
|
||||
#include "analyzerstartparameters.h"
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
|
||||
@@ -48,7 +49,6 @@ class RunConfiguration;
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
class AnalyzerStartParameters;
|
||||
class IAnalyzerOutputPaneAdapter;
|
||||
class IAnalyzerEngine;
|
||||
|
||||
@@ -121,6 +121,15 @@ public:
|
||||
virtual IAnalyzerEngine *createEngine(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0) = 0;
|
||||
|
||||
/// Returns true if the tool can be run
|
||||
virtual bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const QString &mode) const = 0;
|
||||
|
||||
/// Create the start parameters for the run control factory
|
||||
virtual AnalyzerStartParameters createStartParameters(
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const QString &mode) const = 0;
|
||||
|
||||
virtual void startTool(StartMode mode) = 0;
|
||||
|
||||
/// Called when tools gets selected.
|
||||
|
||||
@@ -26,8 +26,7 @@ SOURCES += \
|
||||
localqmlprofilerrunner.cpp \
|
||||
codaqmlprofilerrunner.cpp \
|
||||
remotelinuxqmlprofilerrunner.cpp \
|
||||
qmlprofilereventview.cpp \
|
||||
qmlprofilerruncontrolfactory.cpp
|
||||
qmlprofilereventview.cpp
|
||||
|
||||
HEADERS += \
|
||||
qmlprofilerconstants.h \
|
||||
@@ -42,8 +41,7 @@ HEADERS += \
|
||||
localqmlprofilerrunner.h \
|
||||
codaqmlprofilerrunner.h \
|
||||
remotelinuxqmlprofilerrunner.h \
|
||||
qmlprofilereventview.h \
|
||||
qmlprofilerruncontrolfactory.h
|
||||
qmlprofilereventview.h
|
||||
|
||||
RESOURCES += \
|
||||
qml/qmlprofiler.qrc
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "qmlprofilerplugin.h"
|
||||
|
||||
#include "qmlprofilertool.h"
|
||||
#include "qmlprofilerruncontrolfactory.h"
|
||||
|
||||
#include <analyzerbase/analyzermanager.h>
|
||||
|
||||
@@ -48,11 +47,12 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
|
||||
{
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(errorString)
|
||||
addAutoReleasedObject(new QmlProfilerRunControlFactory());
|
||||
|
||||
StartModes modes;
|
||||
modes.append(StartMode(StartLocal));
|
||||
modes.append(StartMode(StartRemote));
|
||||
AnalyzerManager::addTool(new QmlProfilerTool(this), modes);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "qmlprofilerruncontrolfactory.h"
|
||||
#include "qmlprojectmanager/qmlprojectrunconfiguration.h"
|
||||
|
||||
#include <analyzerbase/analyzerstartparameters.h>
|
||||
#include <analyzerbase/analyzermanager.h>
|
||||
#include <analyzerbase/analyzersettings.h>
|
||||
#include <analyzerbase/analyzerrunconfigwidget.h>
|
||||
|
||||
#include <projectexplorer/applicationrunconfiguration.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||
#include <remotelinux/remotelinuxrunconfiguration.h>
|
||||
#include <qt4projectmanager/qt-s60/s60devicedebugruncontrol.h>
|
||||
#include <qt4projectmanager/qt-s60/s60devicerunconfiguration.h>
|
||||
#include <qt4projectmanager/qt-s60/s60deployconfiguration.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
|
||||
using namespace Analyzer;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace QmlProfiler::Internal;
|
||||
using namespace QmlProjectManager;
|
||||
|
||||
QmlProfilerRunControlFactory::QmlProfilerRunControlFactory(QObject *parent)
|
||||
: IRunControlFactory(parent)
|
||||
{
|
||||
setObjectName(QLatin1String("QmlProfilerRunControlFactory"));
|
||||
}
|
||||
|
||||
bool QmlProfilerRunControlFactory::canRun(RunConfiguration *runConfiguration, const QString &mode) const
|
||||
{
|
||||
// FIXME: Should this just accept all mode == QLatin1String("QmlProfiler"); ?
|
||||
if (qobject_cast<QmlProjectRunConfiguration *>(runConfiguration))
|
||||
return mode == QLatin1String("QmlProfiler");
|
||||
if (qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration))
|
||||
return mode == QLatin1String("QmlProfiler");
|
||||
if (qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration))
|
||||
return mode == QLatin1String("QmlProfiler");
|
||||
if (qobject_cast<Qt4ProjectManager::S60DeviceRunConfiguration *>(runConfiguration))
|
||||
return mode == QLatin1String("QmlProfiler");
|
||||
return false;
|
||||
}
|
||||
|
||||
RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfiguration, const QString &mode)
|
||||
{
|
||||
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
||||
AnalyzerStartParameters sp;
|
||||
sp.toolId = "QmlProfiler";
|
||||
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<QmlProjectRunConfiguration *>(runConfiguration)) {
|
||||
// This is a "plain" .qmlproject.
|
||||
sp.environment = rc1->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 = rc1->qmlDebugServerPort();
|
||||
} else if (LocalApplicationRunConfiguration *rc2 =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
sp.environment = rc2->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 = rc2->qmlDebugServerPort();
|
||||
} else if (RemoteLinux::RemoteLinuxRunConfiguration *rc3 =
|
||||
qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
sp.debuggee = rc3->remoteExecutableFilePath();
|
||||
sp.debuggeeArgs = rc3->arguments();
|
||||
sp.connParams = rc3->deviceConfig()->sshParameters();
|
||||
sp.analyzerCmdPrefix = rc3->commandPrefix();
|
||||
sp.displayName = rc3->displayName();
|
||||
} else if (Qt4ProjectManager::S60DeviceRunConfiguration *rc4 =
|
||||
qobject_cast<Qt4ProjectManager::S60DeviceRunConfiguration *>(runConfiguration)) {
|
||||
Qt4ProjectManager::S60DeployConfiguration *deployConf =
|
||||
qobject_cast<Qt4ProjectManager::S60DeployConfiguration *>(runConfiguration->target()->activeDeployConfiguration());
|
||||
|
||||
sp.debuggeeArgs = rc4->commandLineArguments();
|
||||
sp.displayName = rc4->displayName();
|
||||
sp.connParams.host = deployConf->deviceAddress();
|
||||
sp.connParams.port = rc4->qmlDebugServerPort();
|
||||
} else {
|
||||
// What could that be?
|
||||
QTC_ASSERT(false, return 0);
|
||||
}
|
||||
|
||||
IAnalyzerTool *tool = AnalyzerManager::toolFromId(Core::Id(mode));
|
||||
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration);
|
||||
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
||||
return rc;
|
||||
}
|
||||
|
||||
QString QmlProfilerRunControlFactory::displayName() const
|
||||
{
|
||||
return tr("QML Profiler");
|
||||
}
|
||||
|
||||
IRunConfigurationAspect *QmlProfilerRunControlFactory::createRunConfigurationAspect()
|
||||
{
|
||||
return new AnalyzerProjectSettings;
|
||||
}
|
||||
|
||||
RunConfigWidget *QmlProfilerRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
|
||||
{
|
||||
QmlProjectManager::QmlProjectRunConfiguration *localRc =
|
||||
qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration);
|
||||
if (!localRc)
|
||||
return 0;
|
||||
|
||||
AnalyzerProjectSettings *settings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
|
||||
if (!settings)
|
||||
return 0;
|
||||
|
||||
Analyzer::AnalyzerRunConfigWidget *ret = new Analyzer::AnalyzerRunConfigWidget;
|
||||
|
||||
ret->setRunConfiguration(runConfiguration);
|
||||
return ret;
|
||||
}
|
||||
@@ -60,6 +60,10 @@
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/applicationrunconfiguration.h>
|
||||
|
||||
#include <remotelinux/remotelinuxrunconfiguration.h>
|
||||
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||
|
||||
#include <texteditor/itexteditor.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -74,6 +78,8 @@
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt-s60/s60devicedebugruncontrol.h>
|
||||
#include <qt4projectmanager/qt-s60/s60devicerunconfiguration.h>
|
||||
#include <qt4projectmanager/qt-s60/s60deployconfiguration.h>
|
||||
|
||||
#include <QtCore/QFile>
|
||||
@@ -95,6 +101,8 @@ using namespace Analyzer::Constants;
|
||||
using namespace QmlProfiler::Internal;
|
||||
using namespace QmlJsDebugClient;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace QmlProjectManager;
|
||||
using namespace RemoteLinux;
|
||||
|
||||
class QmlProfilerTool::QmlProfilerToolPrivate
|
||||
{
|
||||
@@ -357,6 +365,68 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp
|
||||
return engine;
|
||||
}
|
||||
|
||||
bool QmlProfilerTool::canRun(RunConfiguration *runConfiguration, const QString &mode) const
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
|
||||
if (qobject_cast<QmlProjectRunConfiguration *>(runConfiguration)
|
||||
|| qobject_cast<RemoteLinuxRunConfiguration *>(runConfiguration)
|
||||
|| qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)
|
||||
|| qobject_cast<Qt4ProjectManager::S60DeviceRunConfiguration *>(runConfiguration))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration *runConfiguration, const QString &mode) const
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
|
||||
AnalyzerStartParameters 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<QmlProjectRunConfiguration *>(runConfiguration)) {
|
||||
// This is a "plain" .qmlproject.
|
||||
sp.environment = rc1->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 = rc1->qmlDebugServerPort();
|
||||
} else if (LocalApplicationRunConfiguration *rc2 =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
sp.environment = rc2->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 = rc2->qmlDebugServerPort();
|
||||
} else if (RemoteLinux::RemoteLinuxRunConfiguration *rc3 =
|
||||
qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
sp.debuggee = rc3->remoteExecutableFilePath();
|
||||
sp.debuggeeArgs = rc3->arguments();
|
||||
sp.connParams = rc3->deviceConfig()->sshParameters();
|
||||
sp.analyzerCmdPrefix = rc3->commandPrefix();
|
||||
sp.displayName = rc3->displayName();
|
||||
} else if (Qt4ProjectManager::S60DeviceRunConfiguration *rc4 =
|
||||
qobject_cast<Qt4ProjectManager::S60DeviceRunConfiguration *>(runConfiguration)) {
|
||||
Qt4ProjectManager::S60DeployConfiguration *deployConf =
|
||||
qobject_cast<Qt4ProjectManager::S60DeployConfiguration *>(runConfiguration->target()->activeDeployConfiguration());
|
||||
|
||||
sp.debuggeeArgs = rc4->commandLineArguments();
|
||||
sp.displayName = rc4->displayName();
|
||||
sp.connParams.host = deployConf->deviceAddress();
|
||||
sp.connParams.port = rc4->qmlDebugServerPort();
|
||||
} else {
|
||||
// What could that be?
|
||||
QTC_ASSERT(false, return sp);
|
||||
}
|
||||
return sp;
|
||||
}
|
||||
|
||||
QWidget *QmlProfilerTool::createWidgets()
|
||||
{
|
||||
QTC_ASSERT(!d->m_traceWindow, return 0);
|
||||
|
||||
@@ -61,6 +61,13 @@ public:
|
||||
Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||
|
||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const QString &mode) const;
|
||||
|
||||
Analyzer::AnalyzerStartParameters createStartParameters(
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const QString &mode) const;
|
||||
|
||||
QWidget *createWidgets();
|
||||
void startTool(Analyzer::StartMode mode);
|
||||
|
||||
|
||||
@@ -497,7 +497,7 @@ static QToolButton *createToolButton(QAction *action)
|
||||
}
|
||||
|
||||
CallgrindTool::CallgrindTool(QObject *parent)
|
||||
: Analyzer::IAnalyzerTool(parent)
|
||||
: ValgrindTool(parent)
|
||||
{
|
||||
d = new CallgrindToolPrivate(this);
|
||||
setObjectName(QLatin1String("CallgrindTool"));
|
||||
|
||||
@@ -33,14 +33,14 @@
|
||||
#ifndef CALLGRINDTOOL_H
|
||||
#define CALLGRINDTOOL_H
|
||||
|
||||
#include <analyzerbase/ianalyzertool.h>
|
||||
#include "valgrindtool.h"
|
||||
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
class CallgrindToolPrivate;
|
||||
|
||||
class CallgrindTool : public Analyzer::IAnalyzerTool
|
||||
class CallgrindTool : public ValgrindTool
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ static void initKindFilterAction(QAction *action, const QList<int> &kinds)
|
||||
}
|
||||
|
||||
MemcheckTool::MemcheckTool(QObject *parent)
|
||||
: Analyzer::IAnalyzerTool(parent)
|
||||
: ValgrindTool(parent)
|
||||
{
|
||||
m_settings = 0;
|
||||
m_errorModel = 0;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#ifndef MEMCHECKTOOL_H
|
||||
#define MEMCHECKTOOL_H
|
||||
|
||||
#include <analyzerbase/ianalyzertool.h>
|
||||
#include "valgrindtool.h"
|
||||
|
||||
#include <QtGui/QSortFilterProxyModel>
|
||||
#include <QtCore/QSharedPointer>
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
bool m_filterExternalIssues;
|
||||
};
|
||||
|
||||
class MemcheckTool : public Analyzer::IAnalyzerTool
|
||||
class MemcheckTool : public ValgrindTool
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -30,7 +30,8 @@ HEADERS += \
|
||||
memchecktool.h \
|
||||
memcheckengine.h \
|
||||
memcheckerrorview.h \
|
||||
suppressiondialog.h
|
||||
suppressiondialog.h \
|
||||
valgrindtool.h
|
||||
|
||||
SOURCES += \
|
||||
valgrindplugin.cpp \
|
||||
@@ -52,7 +53,8 @@ SOURCES += \
|
||||
memchecktool.cpp \
|
||||
memcheckengine.cpp \
|
||||
memcheckerrorview.cpp \
|
||||
suppressiondialog.cpp
|
||||
suppressiondialog.cpp \
|
||||
valgrindtool.cpp
|
||||
|
||||
FORMS += \
|
||||
valgrindconfigwidget.ui
|
||||
|
||||
@@ -59,112 +59,12 @@
|
||||
#include <QtGui/QAction>
|
||||
|
||||
using namespace Analyzer;
|
||||
using namespace Valgrind::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ValgrindRunControlFactory
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
class ValgrindRunControlFactory : public ProjectExplorer::IRunControlFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ValgrindRunControlFactory(QObject *parent = 0);
|
||||
|
||||
// IRunControlFactory
|
||||
bool canRun(RunConfiguration *runConfiguration, const QString &mode) const;
|
||||
RunControl *create(RunConfiguration *runConfiguration, const QString &mode);
|
||||
QString displayName() const;
|
||||
|
||||
IRunConfigurationAspect *createRunConfigurationAspect();
|
||||
RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
||||
};
|
||||
|
||||
ValgrindRunControlFactory::ValgrindRunControlFactory(QObject *parent)
|
||||
: IRunControlFactory(parent)
|
||||
{
|
||||
setObjectName(QLatin1String("ValgrindRunControlFactory"));
|
||||
}
|
||||
|
||||
bool ValgrindRunControlFactory::canRun(RunConfiguration *runConfiguration, const QString &mode) const
|
||||
{
|
||||
Q_UNUSED(runConfiguration);
|
||||
return mode.startsWith("Callgrind") || mode.startsWith("Memcheck");
|
||||
}
|
||||
|
||||
RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration, const QString &mode)
|
||||
{
|
||||
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
||||
|
||||
AnalyzerStartParameters sp;
|
||||
if (LocalApplicationRunConfiguration *rc1 =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
sp.startMode = StartLocal;
|
||||
sp.environment = rc1->environment();
|
||||
sp.workingDirectory = rc1->workingDirectory();
|
||||
sp.debuggee = rc1->executable();
|
||||
sp.debuggeeArgs = rc1->commandLineArguments();
|
||||
sp.displayName = rc1->displayName();
|
||||
sp.connParams.host = QLatin1String("localhost");
|
||||
sp.connParams.port = rc1->qmlDebugServerPort();
|
||||
} else if (RemoteLinux::RemoteLinuxRunConfiguration *rc2 =
|
||||
qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
sp.startMode = StartRemote;
|
||||
sp.debuggee = rc2->remoteExecutableFilePath();
|
||||
sp.debuggeeArgs = rc2->arguments();
|
||||
sp.connParams = rc2->deviceConfig()->sshParameters();
|
||||
sp.analyzerCmdPrefix = rc2->commandPrefix();
|
||||
sp.displayName = rc2->displayName();
|
||||
} else {
|
||||
// Might be S60DeviceRunfiguration, or something else ...
|
||||
//sp.startMode = StartRemote;
|
||||
sp.startMode = StartRemote;
|
||||
}
|
||||
|
||||
IAnalyzerTool *tool = AnalyzerManager::toolFromId(Core::Id(mode));
|
||||
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration);
|
||||
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
|
||||
return rc;
|
||||
}
|
||||
|
||||
QString ValgrindRunControlFactory::displayName() const
|
||||
{
|
||||
return tr("Analyzer");
|
||||
}
|
||||
|
||||
IRunConfigurationAspect *ValgrindRunControlFactory::createRunConfigurationAspect()
|
||||
{
|
||||
return new AnalyzerProjectSettings;
|
||||
}
|
||||
|
||||
RunConfigWidget *ValgrindRunControlFactory::createConfigurationWidget(RunConfiguration *runConfiguration)
|
||||
{
|
||||
LocalApplicationRunConfiguration *localRc =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
|
||||
if (!localRc)
|
||||
return 0;
|
||||
AnalyzerProjectSettings *settings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
|
||||
if (!settings)
|
||||
return 0;
|
||||
|
||||
AnalyzerRunConfigWidget *ret = new AnalyzerRunConfigWidget;
|
||||
ret->setRunConfiguration(runConfiguration);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ValgrindPlugin
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void startRemoteTool(IAnalyzerTool *tool)
|
||||
{
|
||||
Q_UNUSED(tool);
|
||||
@@ -219,9 +119,6 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *)
|
||||
AnalyzerManager::addTool(new MemcheckTool(this), modes);
|
||||
AnalyzerManager::addTool(new CallgrindTool(this), modes);
|
||||
|
||||
ValgrindRunControlFactory *factory = new ValgrindRunControlFactory();
|
||||
addAutoReleasedObject(factory);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -230,5 +127,3 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *)
|
||||
|
||||
|
||||
Q_EXPORT_PLUGIN(Valgrind::Internal::ValgrindPlugin)
|
||||
|
||||
#include "valgrindplugin.moc"
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (C) 2011 Kläralvdalens Datakonsult AB, a KDAB Group company.
|
||||
**
|
||||
** Contact: Kläralvdalens Datakonsult AB (info@kdab.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "valgrindtool.h"
|
||||
|
||||
#include <remotelinux/remotelinuxrunconfiguration.h>
|
||||
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||
|
||||
#include <projectexplorer/applicationrunconfiguration.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace RemoteLinux;
|
||||
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
ValgrindTool::ValgrindTool(QObject *parent) :
|
||||
Analyzer::IAnalyzerTool(parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool ValgrindTool::canRun(ProjectExplorer::RunConfiguration *, const QString &) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Analyzer::AnalyzerStartParameters ValgrindTool::createStartParameters(
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const QString &mode) const
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
|
||||
Analyzer::AnalyzerStartParameters sp;
|
||||
if (LocalApplicationRunConfiguration *rc1 =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
sp.startMode = Analyzer::StartLocal;
|
||||
sp.environment = rc1->environment();
|
||||
sp.workingDirectory = rc1->workingDirectory();
|
||||
sp.debuggee = rc1->executable();
|
||||
sp.debuggeeArgs = rc1->commandLineArguments();
|
||||
sp.displayName = rc1->displayName();
|
||||
sp.connParams.host = QLatin1String("localhost");
|
||||
sp.connParams.port = rc1->qmlDebugServerPort();
|
||||
} else if (RemoteLinuxRunConfiguration *rc2 =
|
||||
qobject_cast<RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
sp.startMode = Analyzer::StartRemote;
|
||||
sp.debuggee = rc2->remoteExecutableFilePath();
|
||||
sp.debuggeeArgs = rc2->arguments();
|
||||
sp.connParams = rc2->deviceConfig()->sshParameters();
|
||||
sp.analyzerCmdPrefix = rc2->commandPrefix();
|
||||
sp.displayName = rc2->displayName();
|
||||
} else {
|
||||
// Might be S60DeviceRunfiguration, or something else ...
|
||||
//sp.startMode = StartRemote;
|
||||
sp.startMode = Analyzer::StartRemote;
|
||||
}
|
||||
return sp;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Valgrind
|
||||
@@ -0,0 +1,58 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (C) 2011 Kläralvdalens Datakonsult AB, a KDAB Group company.
|
||||
**
|
||||
** Contact: Kläralvdalens Datakonsult AB (info@kdab.com)
|
||||
**
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
||||
** Please review the following information to ensure the GNU Lesser General
|
||||
** Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** Other Usage
|
||||
**
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at info@qt.nokia.com.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef VALGRINDTOOL_H
|
||||
#define VALGRINDTOOL_H
|
||||
|
||||
#include <analyzerbase/ianalyzertool.h>
|
||||
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
class ValgrindTool : public Analyzer::IAnalyzerTool
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ValgrindTool(QObject *parent);
|
||||
|
||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const QString &mode) const;
|
||||
|
||||
Analyzer::AnalyzerStartParameters createStartParameters(
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const QString &mode) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Valgrind
|
||||
|
||||
#endif // VALGRINDTOOL_H
|
||||
Reference in New Issue
Block a user