36
36
#include "blackberrydebugsupport.h"
37
37
#include "blackberryqtversion.h"
38
38
#include "blackberrydeviceconnectionmanager.h"
39
#include "blackberryapplicationrunner.h"
39
40
#include "qnxutils.h"
41
42
#include <debugger/debuggerplugin.h>
48
49
#include <projectexplorer/toolchain.h>
49
50
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
50
51
#include <qtsupport/qtkitinformation.h>
52
#include <analyzerbase/analyzerstartparameters.h>
53
#include <analyzerbase/analyzermanager.h>
54
#include <analyzerbase/analyzerruncontrol.h>
55
#include <coreplugin/messagemanager.h>
52
57
using namespace Qnx;
53
58
using namespace Qnx::Internal;
86
91
return activeDeployConf != 0;
94
static void createAnalyzerStartParameters(Analyzer::AnalyzerStartParameters *pStartParameters, BlackBerryRunConfiguration* runConfiguration, ProjectExplorer::RunMode mode)
96
QTC_ASSERT(pStartParameters, return);
97
pStartParameters->runMode = mode;
98
if (mode == ProjectExplorer::QmlProfilerRunMode)
99
pStartParameters->startMode = Analyzer::StartLocal;
101
ProjectExplorer::Target *target = runConfiguration->target();
102
ProjectExplorer::Kit *kit = target->kit();
104
ProjectExplorer::IDevice::ConstPtr device = ProjectExplorer::DeviceKitInformation::device(kit);
106
pStartParameters->connParams = device->sshParameters();
107
pStartParameters->analyzerHost = device->qmlProfilerHost();
109
pStartParameters->sysroot = ProjectExplorer::SysRootKitInformation::sysRoot(kit).toString();
111
Debugger::DebuggerRunConfigurationAspect *aspect = runConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
113
pStartParameters->analyzerPort = aspect->qmlDebugServerPort();
89
116
ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration,
90
117
ProjectExplorer::RunMode mode, QString *errorMessage)
106
133
m_activeRunControls[rc->key()] = runControl;
107
134
return runControl;
136
if (mode == ProjectExplorer::QmlProfilerRunMode) {
137
QtSupport::BaseQtVersion *qtVer = QtSupport::QtKitInformation::qtVersion(rc->target()->kit());
138
if (qtVer && qtVer->qtVersion() <= QtSupport::QtVersionNumber(4, 8, 6))
139
Core::MessageManager::write(tr("Target Qt version (%1) might not support QML profiling. "
140
"Cascades applications are not affected and should work as expected. "
141
"For more info see http://qt-project.org/wiki/Qt-Creator-with-BlackBerry-10")
142
.arg(qtVer->qtVersionString()), Core::MessageManager::Flash
145
Analyzer::AnalyzerStartParameters params;
146
createAnalyzerStartParameters(¶ms, rc, mode);
148
Analyzer::AnalyzerRunControl *runControl = Analyzer::AnalyzerManager::createRunControl(params, runConfiguration);
149
BlackBerryApplicationRunner::LaunchFlags launchFlags(BlackBerryApplicationRunner::QmlDebugLaunch
150
| BlackBerryApplicationRunner::QmlDebugLaunchBlocking
151
| BlackBerryApplicationRunner::QmlProfilerLaunch);
152
BlackBerryApplicationRunner *runner = new BlackBerryApplicationRunner(launchFlags, rc, runControl);
154
connect(runner, SIGNAL(finished()), runControl, SLOT(notifyRemoteFinished()));
155
connect(runner, SIGNAL(output(QString, Utils::OutputFormat)),
156
runControl, SLOT(logApplicationMessage(QString, Utils::OutputFormat)));
157
connect(runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)),
158
runner, SLOT(start()));
159
connect(runControl, SIGNAL(finished()), runner, SLOT(stop()));
110
162
Debugger::DebuggerRunControl * const runControl =
111
163
Debugger::DebuggerPlugin::createDebugger(startParameters(rc), runConfiguration, errorMessage);