Commit 6ac987c8 authored by Mike McQuaid's avatar Mike McQuaid Committed by hjk

Add analyzer new APIs support to plugins.

Merge-request: 284
Reviewed-by: default avatarhjk <qtc-committer@nokia.com>
parent 678d1cc9
......@@ -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);
......
......@@ -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:
......
......@@ -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;
}
......@@ -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();
......
/**************************************************************************
**
** 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
/**************************************************************************
**
** 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
......@@ -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);
}
......
......@@ -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 \
......
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)
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