diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 6b967b92e0fd7a5a8e5e94d7c6416252b9a7798b..357d5588ca415bf30e02490238fac8ddb50e3638 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -81,8 +81,9 @@ public: bool m_running; }; -QmlProfilerEngine::QmlProfilerEngine(ProjectExplorer::RunConfiguration *runConfiguration) - : IAnalyzerEngine(runConfiguration), d(new QmlProfilerEnginePrivate(this)) +QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration) + : IAnalyzerEngine(sp, runConfiguration) + , d(new QmlProfilerEnginePrivate(this)) { ProjectExplorer::LocalApplicationRunConfiguration *localAppConfig = qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(runConfiguration); diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.h b/src/plugins/qmlprofiler/qmlprofilerengine.h index 257e2083a8713029839afe0c4b7bfb3211c809d0..b4d5122cf36b3e0c002ed61ef4f4cd1edd07257d 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.h +++ b/src/plugins/qmlprofiler/qmlprofilerengine.h @@ -43,7 +43,8 @@ class QmlProfilerEngine : public Analyzer::IAnalyzerEngine { Q_OBJECT public: - explicit QmlProfilerEngine(ProjectExplorer::RunConfiguration *runConfiguration); + explicit QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp, + ProjectExplorer::RunConfiguration *runConfiguration); ~QmlProfilerEngine(); signals: diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index b4e5d5c6b352ef27e92eca68a7ade9f3b0d85c46..67a0e5a8f4c886fc64b56fc9a8cd974718c8f4a6 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -40,6 +40,7 @@ #include <analyzerbase/analyzermanager.h> #include <analyzerbase/analyzerconstants.h> +#include <analyzerbase/ianalyzeroutputpaneadapter.h> #include "timelineview.h" @@ -142,9 +143,10 @@ IAnalyzerTool::ToolMode QmlProfilerTool::mode() const } -IAnalyzerEngine *QmlProfilerTool::createEngine(ProjectExplorer::RunConfiguration *runConfiguration) +IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp, + ProjectExplorer::RunConfiguration *runConfiguration) { - QmlProfilerEngine *engine = new QmlProfilerEngine(runConfiguration); + QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration); d->m_project = runConfiguration->target()->project(); if (d->m_project) { @@ -178,6 +180,10 @@ void QmlProfilerTool::initialize(ExtensionSystem::IPlugin */*plugin*/) d->m_traceWindow->reset(d->m_client); } +void QmlProfilerTool::extensionsInitialized() +{ +} + IAnalyzerOutputPaneAdapter *QmlProfilerTool::outputPaneAdapter() { if (!d->m_outputPaneAdapter) @@ -273,3 +279,9 @@ void QmlProfilerTool::updateProjectFileList() d->m_projectFinder.setProjectFiles( d->m_project->files(ProjectExplorer::Project::ExcludeGeneratedFiles)); } + +bool QmlProfilerTool::canRunRemotely() const +{ + // TODO: Is this correct? + return true; +} diff --git a/src/plugins/qmlprofiler/qmlprofilertool.h b/src/plugins/qmlprofiler/qmlprofilertool.h index 949d67dd350d4e950cbc59a9c9007c19afe620c1..8663e974d827c77e0872b65a664ed3d319f32c24 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.h +++ b/src/plugins/qmlprofiler/qmlprofilertool.h @@ -52,13 +52,17 @@ public: ToolMode mode() const; void initialize(ExtensionSystem::IPlugin *plugin); + void extensionsInitialized(); - Analyzer::IAnalyzerEngine *createEngine(ProjectExplorer::RunConfiguration *runConfiguration); + Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp, + ProjectExplorer::RunConfiguration *runConfiguration = 0); Analyzer::IAnalyzerOutputPaneAdapter *outputPaneAdapter(); QWidget *createToolBarWidget(); QWidget *createTimeLineWidget(); + bool canRunRemotely() const; + public slots: void connectClient(); void disconnectClient(); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoanalyzersupport.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoanalyzersupport.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0596a95bf7c78f9a3b645601d93b298452de7201 --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoanalyzersupport.cpp @@ -0,0 +1,76 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** No Commercial Usage +** +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** +** Alternatively, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#include "maemoanalyzersupport.h" + +#include <analyzerbase/analyzermanager.h> +#include <analyzerbase/analyzerstartparameters.h> +#include <analyzerbase/analyzerconstants.h> +#include <analyzerbase/analyzerruncontrol.h> + +#include <QtCore/QDir> + +using namespace Utils; +using namespace Analyzer; +using namespace ProjectExplorer; + +namespace Qt4ProjectManager { +namespace Internal { + +RunControl *MaemoAnalyzerSupport::createAnalyzerRunControl(MaemoRunConfiguration *runConfig) +{ + AnalyzerStartParameters params; + + const MaemoDeviceConfig::ConstPtr &devConf = runConfig->deviceConfig(); + params.debuggee = runConfig->remoteExecutableFilePath(); + params.debuggeeArgs = runConfig->arguments(); + params.analyzerCmdPrefix + = MaemoGlobal::remoteCommandPrefix(runConfig->remoteExecutableFilePath()) + + MaemoGlobal::remoteEnvironment(runConfig->userEnvironmentChanges()); + params.startMode = StartRemote; + params.connParams = devConf->sshParameters(); + params.localMountDir = runConfig->localDirToMountForRemoteGdb(); + params.remoteMountPoint = runConfig->remoteProjectSourcesMountPoint(); + const QString execDirAbs + = QDir::fromNativeSeparators(QFileInfo(runConfig->localExecutableFilePath()).path()); + const QString execDirRel + = QDir(params.localMountDir).relativeFilePath(execDirAbs); + params.remoteSourcesDir = QString(params.remoteMountPoint + + QLatin1Char('/') + execDirRel).toUtf8(); + params.displayName = runConfig->displayName(); + + return AnalyzerManager::instance()->createAnalyzer(params, runConfig); +} + +} // namespace Internal +} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoanalyzersupport.h b/src/plugins/qt4projectmanager/qt-maemo/maemoanalyzersupport.h new file mode 100644 index 0000000000000000000000000000000000000000..fb106f9b5674057e39ae158229331f74177698cb --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoanalyzersupport.h @@ -0,0 +1,51 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** No Commercial Usage +** +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** +** Alternatively, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +**************************************************************************/ + +#ifndef MAEMOANALYZERSUPPORT_H +#define MAEMOANALYZERSUPPORT_H + +#include "maemorunconfiguration.h" + +namespace Qt4ProjectManager { +namespace Internal { + +namespace MaemoAnalyzerSupport { + +ProjectExplorer::RunControl *createAnalyzerRunControl(MaemoRunConfiguration *runConfig); + +} + +} // namespace Internal +} // namespace Qt4ProjectManager + +#endif // MAEMOANALYZERSUPPORT_H diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp index aeff84e654424838c77d6b830cc40c60032ac440..5f5b4956ab83665f4142b91afada5725c31033dd 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp @@ -36,6 +36,7 @@ #include "maemoconstants.h" #include "maemodebugsupport.h" +#include "maemoanalyzersupport.h" #include "maemoglobal.h" #include "maemoremotemountsmodel.h" #include "maemorunconfiguration.h" @@ -47,6 +48,7 @@ #include <debugger/debuggerconstants.h> #include <qt4projectmanager/qt4project.h> #include <qt4projectmanager/qt4projectmanagerconstants.h> +#include <analyzerbase/analyzerconstants.h> namespace Qt4ProjectManager { namespace Internal { @@ -179,7 +181,8 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration, : 0; if (mode == Debugger::Constants::DEBUGMODE) return freePortCount >= mountDirCount + maemoRunConfig->portsUsedByDebuggers(); - if (mode == ProjectExplorer::Constants::RUNMODE) + if (mode == ProjectExplorer::Constants::RUNMODE + || Analyzer::Constants::MODE_ANALYZE) return freePortCount >= mountDirCount; return false; } @@ -188,12 +191,15 @@ RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig, const QString &mode) { Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE - || mode == Debugger::Constants::DEBUGMODE); + || mode == Debugger::Constants::DEBUGMODE + || mode == Analyzer::Constants::MODE_ANALYZE); Q_ASSERT(canRun(runConfig, mode)); MaemoRunConfiguration *rc = qobject_cast<MaemoRunConfiguration *>(runConfig); Q_ASSERT(rc); if (mode == ProjectExplorer::Constants::RUNMODE) return new MaemoRunControl(rc); + if (mode == Analyzer::Constants::MODE_ANALYZE) + return MaemoAnalyzerSupport::createAnalyzerRunControl(rc); return MaemoDebugSupport::createDebugRunControl(rc); } diff --git a/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri b/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri index a8fa237d3bc29209a46b2660872f42990202822f..0c43ec8ec0bc93643022471eff17558744170a8e 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri +++ b/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri @@ -23,6 +23,7 @@ HEADERS += \ $$PWD/maemoglobal.h \ $$PWD/maemosshrunner.h \ $$PWD/maemodebugsupport.h \ + $$PWD/maemoanalyzersupport.h \ $$PWD/maemoremotemountsmodel.h \ $$PWD/maemodeviceenvreader.h \ $$PWD/maemomountspecification.h \ @@ -82,6 +83,7 @@ SOURCES += \ $$PWD/maemoglobal.cpp \ $$PWD/maemosshrunner.cpp \ $$PWD/maemodebugsupport.cpp \ + $$PWD/maemoanalyzersupport.cpp \ $$PWD/maemoremotemountsmodel.cpp \ $$PWD/maemodeviceenvreader.cpp \ $$PWD/maemomountspecification.cpp \ diff --git a/src/plugins/qt4projectmanager/qt4projectmanager_dependencies.pri b/src/plugins/qt4projectmanager/qt4projectmanager_dependencies.pri index 93c68b8b37d226077fedaf627595f277bb224f21..1a8b3dff3a5b3eeb08f9e5d4b467048dd4cebfec 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager_dependencies.pri +++ b/src/plugins/qt4projectmanager/qt4projectmanager_dependencies.pri @@ -1,5 +1,6 @@ include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/cpptools/cpptools.pri) include(../../plugins/debugger/debugger.pri) +include(../../plugins/analyzerbase/analyzerbase.pri) include(../../libs/symbianutils/symbianutils.pri) include(../../libs/qmljs/qmljs.pri)