diff options
Diffstat (limited to 'src/plugins/qnx')
-rw-r--r-- | src/plugins/qnx/blackberryapilevelconfiguration.cpp | 12 | ||||
-rw-r--r-- | src/plugins/qnx/blackberryapplicationrunner.cpp | 135 | ||||
-rw-r--r-- | src/plugins/qnx/blackberryapplicationrunner.h | 24 | ||||
-rw-r--r-- | src/plugins/qnx/blackberryconfigurationmanager.cpp | 5 | ||||
-rw-r--r-- | src/plugins/qnx/blackberrycreatepackagestep.cpp | 75 | ||||
-rw-r--r-- | src/plugins/qnx/blackberrydebugsupport.cpp | 8 | ||||
-rw-r--r-- | src/plugins/qnx/blackberrydebugtokenpinsdialog.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qnx/blackberryruncontrol.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qnx/blackberryruncontrolfactory.cpp | 54 | ||||
-rw-r--r-- | src/plugins/qnx/qnx.qbs | 2 | ||||
-rw-r--r-- | src/plugins/qnx/qnxtoolchain.cpp | 1 |
11 files changed, 242 insertions, 78 deletions
diff --git a/src/plugins/qnx/blackberryapilevelconfiguration.cpp b/src/plugins/qnx/blackberryapilevelconfiguration.cpp index f2192aa5f2..e6b7adf609 100644 --- a/src/plugins/qnx/blackberryapilevelconfiguration.cpp +++ b/src/plugins/qnx/blackberryapilevelconfiguration.cpp @@ -337,9 +337,15 @@ Kit *BlackBerryApiLevelConfiguration::createKit( if (debuggerItemId.isValid()) DebuggerKitInformation::setDebugger(kit, debuggerItemId); - if (isSimulator) - QmakeProjectManager::QmakeKitInformation::setMkspec( - kit, FileName::fromLatin1("blackberry-x86-qcc")); + if (version->qtVersion().majorVersion == 4) { + if (isSimulator) { + QmakeProjectManager::QmakeKitInformation::setMkspec( + kit, FileName::fromLatin1("blackberry-x86-qcc")); + } else { + QmakeProjectManager::QmakeKitInformation::setMkspec( + kit, FileName::fromLatin1("blackberry-armv7le-qcc")); + } + } DeviceTypeKitInformation::setDeviceTypeId(kit, Constants::QNX_BB_OS_TYPE); SysRootKitInformation::setSysRoot(kit, m_sysRoot); diff --git a/src/plugins/qnx/blackberryapplicationrunner.cpp b/src/plugins/qnx/blackberryapplicationrunner.cpp index c894235bcd..850a12f20f 100644 --- a/src/plugins/qnx/blackberryapplicationrunner.cpp +++ b/src/plugins/qnx/blackberryapplicationrunner.cpp @@ -42,14 +42,18 @@ #include <projectexplorer/kit.h> #include <projectexplorer/target.h> #include <qmakeprojectmanager/qmakebuildconfiguration.h> +#include <debugger/debuggerrunconfigurationaspect.h> #include <ssh/sshremoteprocessrunner.h> #include <utils/qtcassert.h> #include <QMessageBox> #include <QTimer> #include <QDir> +#include <QTemporaryFile> namespace { +enum { debugCheckQmlJSArgs = 0 }; + bool parseRunningState(const QString &line) { QTC_ASSERT(line.startsWith(QLatin1String("result::")), return false); @@ -61,9 +65,9 @@ using namespace ProjectExplorer; using namespace Qnx; using namespace Qnx::Internal; -BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool cppDebugMode, BlackBerryRunConfiguration *runConfiguration, QObject *parent) +BlackBerryApplicationRunner::BlackBerryApplicationRunner(const BlackBerryApplicationRunner::LaunchFlags &launchFlags, BlackBerryRunConfiguration *runConfiguration, QObject *parent) : QObject(parent) - , m_cppDebugMode(cppDebugMode) + , m_launchFlags(launchFlags) , m_pid(-1) , m_appId(QString()) , m_running(false) @@ -74,6 +78,8 @@ BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool cppDebugMode, Blac , m_logProcessRunner(0) , m_runningStateTimer(new QTimer(this)) , m_runningStateProcess(0) + , m_qmlDebugServerPort(0) + , m_checkQmlJsDebugArgumentsProcess(0) { QTC_ASSERT(runConfiguration, return); @@ -92,6 +98,11 @@ BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool cppDebugMode, Blac m_sshParams = m_device->sshParameters(); m_sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypePublicKey; + Debugger::DebuggerRunConfigurationAspect *aspect = + runConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>(); + if (aspect) + m_qmlDebugServerPort = aspect->qmlDebugServerPort(); + m_runningStateTimer->setInterval(3000); m_runningStateTimer->setSingleShot(true); connect(m_runningStateTimer, SIGNAL(timeout()), this, SLOT(determineRunningState())); @@ -105,14 +116,14 @@ void BlackBerryApplicationRunner::start() { if (!BlackBerryDeviceConnectionManager::instance()->isConnected(m_device->id())) { connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceConnected()), - this, SLOT(launchApplication())); + this, SLOT(checkDeployMode())); connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceDisconnected(Core::Id)), this, SLOT(disconnectFromDeviceSignals(Core::Id))); connect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(connectionOutput(Core::Id,QString)), this, SLOT(displayConnectionOutput(Core::Id,QString))); BlackBerryDeviceConnectionManager::instance()->connectDevice(m_device->id()); } else { - launchApplication(); + checkDeployMode(); } } @@ -148,7 +159,7 @@ void BlackBerryApplicationRunner::checkDeviceRuntimeVersion(int status) if (m_bbApiLevelVersion.isEmpty()) { emit output(tr("Cannot determine API level version."), Utils::StdErrFormat); - launchApplication(); + checkQmlJsDebugArguments(); return; } @@ -170,7 +181,7 @@ void BlackBerryApplicationRunner::checkDeviceRuntimeVersion(int status) } } - launchApplication(); + checkQmlJsDebugArguments(); } void BlackBerryApplicationRunner::queryDeviceInformation() @@ -273,7 +284,7 @@ void BlackBerryApplicationRunner::disconnectFromDeviceSignals(Core::Id deviceId) { if (m_device->id() == deviceId) { disconnect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceConnected()), - this, SLOT(launchApplication())); + this, SLOT(checkDeployMode())); disconnect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(deviceDisconnected(Core::Id)), this, SLOT(disconnectFromDeviceSignals(Core::Id))); disconnect(BlackBerryDeviceConnectionManager::instance(), SIGNAL(connectionOutput(Core::Id,QString)), @@ -291,6 +302,105 @@ void BlackBerryApplicationRunner::setApplicationId(const QString &applicationId) m_appId = applicationId; } +void BlackBerryApplicationRunner::checkQmlJsDebugArguments() +{ + if (!m_launchFlags.testFlag(QmlDebugLaunch)) { + // no need to change anytning in app manifest for this kind of run + launchApplication(); + } + + emit output(tr("Checking qmljsdebugger command line argument."), Utils::StdOutFormat); + QString nativePackagerCmd = m_environment.searchInPath(QLatin1String("blackberry-nativepackager")); + if (nativePackagerCmd.isEmpty()) { + emit output(tr("Cannot find Native Packager executable."), Utils::StdErrFormat); + return; + } + + m_checkQmlJsDebugArgumentsProcess = new QProcess(this); + connect(m_checkQmlJsDebugArgumentsProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(checkQmlJsDebugArgumentsManifestLoaded())); + connect(m_checkQmlJsDebugArgumentsProcess, SIGNAL(finished(int)), this, SLOT(checkQmlJsDebugArgumentsManifestLoaded())); + + QStringList args; + args << QLatin1String("-listManifest") << QDir::toNativeSeparators(m_barPackage); + if (debugCheckQmlJSArgs) + qDebug() << "get manifest:" << nativePackagerCmd << args.join(QLatin1String(" ")); + m_checkQmlJsDebugArgumentsProcess->start(nativePackagerCmd, args); +} + +void BlackBerryApplicationRunner::checkQmlJsDebugArgumentsManifestLoaded() +{ + m_checkQmlJsDebugArgumentsProcess->deleteLater(); + + if (m_checkQmlJsDebugArgumentsProcess->exitStatus() != QProcess::NormalExit) { + emit output(tr("Cannot read bar package manifest."), Utils::StdErrFormat); + qWarning() << "Cannot read bar package manifest:" << m_checkQmlJsDebugArgumentsProcess->errorString(); + qWarning() << m_checkQmlJsDebugArgumentsProcess->readAllStandardError(); + return; + } + + QString manifestContent = QString::fromUtf8(m_checkQmlJsDebugArgumentsProcess->readAllStandardOutput()); + + QRegExp rxEoln(QLatin1String("(\\r\\n|\\n|\\r)")); + QStringList manifestLines = manifestContent.split(rxEoln); + + QMutableListIterator<QString> it(manifestLines); + QLatin1String entryPoint("Entry-Point: "); + while (it.hasNext()) { + it.next(); + if (it.value().startsWith(entryPoint)) { + while (it.hasNext() && it.peekNext().startsWith(QLatin1Char(' '))) + it.next(); + QString qmljsdbgArg = QString::fromLatin1("-qmljsdebugger=port:%1%2") + .arg(m_qmlDebugServerPort) + .arg(m_launchFlags.testFlag(QmlDebugLaunchBlocking)? QLatin1String(",block"): QLatin1String("")); + it.insert(QLatin1String(" ") + qmljsdbgArg); + manifestContent = manifestLines.join(QLatin1String("\n")); + break; + } + } + + m_checkQmlJsDebugArgumentsProcess = new QProcess(this); + connect(m_checkQmlJsDebugArgumentsProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(checkQmlJsDebugArgumentsManifestSaved())); + connect(m_checkQmlJsDebugArgumentsProcess, SIGNAL(finished(int)), this, SLOT(checkQmlJsDebugArgumentsManifestSaved())); + + QTemporaryFile *manifestFile = new QTemporaryFile(m_checkQmlJsDebugArgumentsProcess); + if (!manifestFile->open()) { + emit output(tr("Internal error: Cannot create temporary manifest file '%1'") + .arg(manifestFile->fileName()), Utils::StdErrFormat); + delete manifestFile; + return; + } + + manifestFile->write(manifestContent.toUtf8()); + manifestFile->flush(); + + QStringList args; + args << QLatin1String("-device") << m_sshParams.host; + if (!m_sshParams.password.isEmpty()) + args << QLatin1String("-password") << m_sshParams.password; + args << QLatin1String("-package") << QDir::toNativeSeparators(m_barPackage); + args << QLatin1String("-putFile"); + args << manifestFile->fileName(); + args << QLatin1String("app/META-INF/MANIFEST.MF"); + if (debugCheckQmlJSArgs) + qDebug() << "set manifest:" << m_deployCmd << args.join(QLatin1String(" ")); + m_checkQmlJsDebugArgumentsProcess->start(m_deployCmd, args); +} + +void BlackBerryApplicationRunner::checkQmlJsDebugArgumentsManifestSaved() +{ + m_checkQmlJsDebugArgumentsProcess->deleteLater(); + + if (m_checkQmlJsDebugArgumentsProcess->exitStatus() != QProcess::NormalExit) { + emit output(tr("Cannot set command line arguments."), Utils::StdErrFormat); + qWarning() << "Cannot set command line arguments:" << m_checkQmlJsDebugArgumentsProcess->errorString(); + qWarning() << m_checkQmlJsDebugArgumentsProcess->readAllStandardError(); + return; + } + + launchApplication(); +} + void BlackBerryApplicationRunner::launchApplication() { // If original device connection fails before launching, this method maybe triggered @@ -300,12 +410,12 @@ void BlackBerryApplicationRunner::launchApplication() QStringList args; args << QLatin1String("-launchApp"); - if (m_cppDebugMode) + if (m_launchFlags.testFlag(CppDebugLaunch)) args << QLatin1String("-debugNative"); args << QLatin1String("-device") << m_sshParams.host; if (!m_sshParams.password.isEmpty()) args << QLatin1String("-password") << m_sshParams.password; - args << QDir::toNativeSeparators(m_barPackage); + args << QLatin1String("-package") << QDir::toNativeSeparators(m_barPackage); if (!m_launchProcess) { m_launchProcess = new QProcess(this); @@ -316,7 +426,8 @@ void BlackBerryApplicationRunner::launchApplication() m_launchProcess->setEnvironment(m_environment.toStringList()); } - + if (debugCheckQmlJSArgs) + qDebug() << "launch:" << m_deployCmd << args.join(QLatin1String(" ")); m_launchProcess->start(m_deployCmd, args); m_runningStateTimer->start(); m_running = true; @@ -329,10 +440,10 @@ void BlackBerryApplicationRunner::checkDeployMode() if (!BlackBerryDeviceConnectionManager::instance()->isConnected(m_device->id())) return; - if (m_cppDebugMode) + if (m_launchFlags.testFlag(CppDebugLaunch)) queryDeviceInformation(); // check API version vs Runtime version else - launchApplication(); + checkQmlJsDebugArguments(); } void BlackBerryApplicationRunner::startRunningStateTimer() diff --git a/src/plugins/qnx/blackberryapplicationrunner.h b/src/plugins/qnx/blackberryapplicationrunner.h index fc8f2a0f3d..490bc395f5 100644 --- a/src/plugins/qnx/blackberryapplicationrunner.h +++ b/src/plugins/qnx/blackberryapplicationrunner.h @@ -58,15 +58,24 @@ class BlackBerryApplicationRunner : public QObject { Q_OBJECT public: - explicit BlackBerryApplicationRunner(bool cppDebugMode, BlackBerryRunConfiguration *runConfiguration, QObject *parent = 0); + enum LaunchFlag + { + CppDebugLaunch = 0x1, + QmlDebugLaunch = 0x2, + QmlDebugLaunchBlocking = 0x4, + QmlProfilerLaunch = 0x8 + }; + Q_DECLARE_FLAGS(LaunchFlags, LaunchFlag) + +public: + explicit BlackBerryApplicationRunner(const LaunchFlags &launchFlags, BlackBerryRunConfiguration *runConfiguration, QObject *parent = 0); bool isRunning() const; qint64 pid() const; - ProjectExplorer::RunControl::StopResult stop(); - public slots: void start(); + ProjectExplorer::RunControl::StopResult stop(); signals: void output(const QString &msg, Utils::OutputFormat format); @@ -97,11 +106,15 @@ private slots: void displayConnectionOutput(Core::Id deviceId, const QString &output); void checkDeviceRuntimeVersion(int status); + void checkQmlJsDebugArguments(); + void checkQmlJsDebugArgumentsManifestLoaded(); + void checkQmlJsDebugArgumentsManifestSaved(); + private: void reset(); void queryDeviceInformation(); - bool m_cppDebugMode; + LaunchFlags m_launchFlags; qint64 m_pid; QString m_appId; @@ -126,6 +139,9 @@ private: QProcess *m_runningStateProcess; BlackBerryVersionNumber m_bbApiLevelVersion; + + int m_qmlDebugServerPort; + QProcess *m_checkQmlJsDebugArgumentsProcess; }; } // namespace Internal diff --git a/src/plugins/qnx/blackberryconfigurationmanager.cpp b/src/plugins/qnx/blackberryconfigurationmanager.cpp index 5221d88e87..0340ab1ec0 100644 --- a/src/plugins/qnx/blackberryconfigurationmanager.cpp +++ b/src/plugins/qnx/blackberryconfigurationmanager.cpp @@ -457,11 +457,6 @@ void BlackBerryConfigurationManager::loadSettings() loadAutoDetectedRuntimes(); checkToolChainConfiguration(); - // If no target was/is activated, activate one since it's needed by - // device connection and CSK code. - if (activeApiLevels().isEmpty() && !m_apiLevels.isEmpty()) - m_apiLevels.first()->activate(); - emit settingsLoaded(); emit settingsChanged(); } diff --git a/src/plugins/qnx/blackberrycreatepackagestep.cpp b/src/plugins/qnx/blackberrycreatepackagestep.cpp index 26a3c74470..4a5df4b28f 100644 --- a/src/plugins/qnx/blackberrycreatepackagestep.cpp +++ b/src/plugins/qnx/blackberrycreatepackagestep.cpp @@ -134,7 +134,6 @@ bool BlackBerryCreatePackageStep::init() // If there is an error, prepareAppDescriptorFile() will raise it return false; - QStringList args; if (m_packageMode == DevelopmentMode) { args << QLatin1String("-devMode"); @@ -165,39 +164,6 @@ bool BlackBerryCreatePackageStep::init() args << QLatin1String("-package") << QnxUtils::addQuotes(QDir::toNativeSeparators(info.packagePath())); args << QnxUtils::addQuotes(QDir::toNativeSeparators(preparedFilePath)); - if (m_packageMode == DevelopmentMode && m_bundleMode == BundleQt) { - BlackBerryQtVersion *qtVersion = dynamic_cast<BlackBerryQtVersion *> - (QtSupport::QtKitInformation::qtVersion(target()->kit())); - if (!qtVersion) { - raiseError(tr("Qt version configured for BlackBerry kit " - "is not a BlackBerry Qt version.")); - return false; - } - - QMap<QString, QString> qtFolders; - qtFolders[QLatin1String("lib")] = - qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS")); - qtFolders[QLatin1String("plugins")] = - qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS")); - qtFolders[QLatin1String("imports")] = - qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_IMPORTS")); - qtFolders[QLatin1String("qml")] = - qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_QML")); - - for (QMap<QString, QString>::const_iterator it = qtFolders.constBegin(); - it != qtFolders.constEnd(); ++it) { - const QString target = it.key(); - const QString qtFolder = it.value(); - if (QFileInfo(qtFolder).exists()) { - args << QLatin1String("-e"); - args << qtFolder; - args << target; - } - } - - args << QLatin1String("."); - } - addCommand(packageCmd, args); } @@ -340,24 +306,12 @@ bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDes QDir::toNativeSeparators(target()->project()->projectDirectory()); doc.expandPlaceHolders(placeHoldersHash); - // Add parameter for QML debugging (if enabled) - Debugger::DebuggerRunConfigurationAspect *aspect - = target()->activeRunConfiguration()->extraAspect<Debugger::DebuggerRunConfigurationAspect>(); - if (aspect->useQmlDebugger()) { - const QString qmlDebuggerArg = QString::fromLatin1("-qmljsdebugger=port:%1") - .arg(aspect->qmlDebugServerPort()); - - QStringList args = doc.value(BarDescriptorDocument::arg).toStringList(); - if (!args.contains(qmlDebuggerArg)) - args.append(qmlDebuggerArg); - - doc.setValue(BarDescriptorDocument::arg, args); - } - // Set up correct environment depending on using bundled/pre-installed Qt QList<Utils::EnvironmentItem> envItems = doc.value(BarDescriptorDocument::env).value<QList<Utils::EnvironmentItem> >(); Utils::Environment env(Utils::EnvironmentItem::toStringList(envItems), Utils::OsTypeOtherUnix); + BarDescriptorAssetList assetList = doc.value(BarDescriptorDocument::asset) + .value<BarDescriptorAssetList>(); if (m_packageMode == SigningPackageMode || (m_packageMode == DevelopmentMode && m_bundleMode == PreInstalledQt)) { @@ -371,6 +325,29 @@ bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDes env.prependOrSetLibrarySearchPath(QString::fromLatin1("/usr/lib/qt%1/lib") .arg(versionNumber.majorVersion)); } else if (m_packageMode == DevelopmentMode && m_bundleMode == BundleQt) { + QList<QPair<QString, QString> > qtFolders; + qtFolders.append(qMakePair(QString::fromLatin1("lib"), + qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_LIBS")))); + qtFolders.append(qMakePair(QString::fromLatin1("plugins"), + qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_PLUGINS")))); + qtFolders.append(qMakePair(QString::fromLatin1("imports"), + qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_IMPORTS")))); + qtFolders.append(qMakePair(QString::fromLatin1("qml"), + qtVersion->versionInfo().value(QLatin1String("QT_INSTALL_QML")))); + + for (QList<QPair<QString, QString> >::const_iterator it = qtFolders.constBegin(); + it != qtFolders.constEnd(); ++it) { + const QString target = it->first; + const QString qtFolder = it->second; + if (QFileInfo(qtFolder).exists()) { + BarDescriptorAsset asset; + asset.source = qtFolder; + asset.destination = target; + asset.entry = false; + assetList << asset; + } + } + env.appendOrSet(QLatin1String("QML2_IMPORT_PATH"), QLatin1String("app/native/imports:app/native/qml"), QLatin1String(":")); env.appendOrSet(QLatin1String("QML_IMPORT_PATH"), @@ -390,6 +367,8 @@ bool BlackBerryCreatePackageStep::prepareAppDescriptorFile(const QString &appDes env.prependOrSetLibrarySearchPath(QString::fromLatin1("%1/lib").arg(fullQtLibraryPath())); } + doc.setValue(BarDescriptorDocument::asset, QVariant::fromValue(assetList)); + QVariant envVar; envVar.setValue(Utils::EnvironmentItem::fromStringList(env.toStringList())); doc.setValue(BarDescriptorDocument::env, envVar); diff --git a/src/plugins/qnx/blackberrydebugsupport.cpp b/src/plugins/qnx/blackberrydebugsupport.cpp index c89650b132..15fe95f6b9 100644 --- a/src/plugins/qnx/blackberrydebugsupport.cpp +++ b/src/plugins/qnx/blackberrydebugsupport.cpp @@ -44,8 +44,12 @@ BlackBerryDebugSupport::BlackBerryDebugSupport(BlackBerryRunConfiguration *runCo : QObject(runControl->engine()) , m_engine(runControl->engine()) { - const bool cppDebugMode = m_engine->startParameters().languages & Debugger::CppLanguage; - m_runner = new BlackBerryApplicationRunner(cppDebugMode, runConfig, this); + BlackBerryApplicationRunner::LaunchFlags launchFlags; + if (m_engine->startParameters().languages & Debugger::CppLanguage) + launchFlags |= BlackBerryApplicationRunner::CppDebugLaunch; + if (m_engine->startParameters().languages & Debugger::QmlLanguage) + launchFlags |= BlackBerryApplicationRunner::QmlDebugLaunch; + m_runner = new BlackBerryApplicationRunner(launchFlags, runConfig, this); connect(m_engine, SIGNAL(requestRemoteSetup()), this, SLOT(launchRemoteApplication())); connect(m_engine, SIGNAL(stateChanged(Debugger::DebuggerState)), diff --git a/src/plugins/qnx/blackberrydebugtokenpinsdialog.cpp b/src/plugins/qnx/blackberrydebugtokenpinsdialog.cpp index 07c1616a90..466e224051 100644 --- a/src/plugins/qnx/blackberrydebugtokenpinsdialog.cpp +++ b/src/plugins/qnx/blackberrydebugtokenpinsdialog.cpp @@ -110,7 +110,7 @@ void BlackBerryDebugTokenPinsDialog::removePin() const QString pin = m_model->item(index.row(), 0)->text(); const int result = QMessageBox::question(this, tr("Confirmation"), - tr("Are you sure you want to remove PIN: %1") + tr("Are you sure you want to remove PIN: %1?") .arg(pin), QMessageBox::Yes | QMessageBox::No); if (result == QMessageBox::Yes) { diff --git a/src/plugins/qnx/blackberryruncontrol.cpp b/src/plugins/qnx/blackberryruncontrol.cpp index e42a223246..660ca53f59 100644 --- a/src/plugins/qnx/blackberryruncontrol.cpp +++ b/src/plugins/qnx/blackberryruncontrol.cpp @@ -43,7 +43,7 @@ using namespace Qnx::Internal; BlackBerryRunControl::BlackBerryRunControl(BlackBerryRunConfiguration *runConfiguration) : ProjectExplorer::RunControl(runConfiguration, ProjectExplorer::NormalRunMode) { - m_runner = new BlackBerryApplicationRunner(false, runConfiguration, this); + m_runner = new BlackBerryApplicationRunner(BlackBerryApplicationRunner::LaunchFlags(), runConfiguration, this); connect(m_runner, SIGNAL(started()), this, SIGNAL(started())); connect(m_runner, SIGNAL(finished()), this, SIGNAL(finished())); diff --git a/src/plugins/qnx/blackberryruncontrolfactory.cpp b/src/plugins/qnx/blackberryruncontrolfactory.cpp index 7ce739d65f..3a67695236 100644 --- a/src/plugins/qnx/blackberryruncontrolfactory.cpp +++ b/src/plugins/qnx/blackberryruncontrolfactory.cpp @@ -36,6 +36,7 @@ #include "blackberrydebugsupport.h" #include "blackberryqtversion.h" #include "blackberrydeviceconnectionmanager.h" +#include "blackberryapplicationrunner.h" #include "qnxutils.h" #include <debugger/debuggerplugin.h> @@ -48,6 +49,10 @@ #include <projectexplorer/toolchain.h> #include <qmakeprojectmanager/qmakebuildconfiguration.h> #include <qtsupport/qtkitinformation.h> +#include <analyzerbase/analyzerstartparameters.h> +#include <analyzerbase/analyzermanager.h> +#include <analyzerbase/analyzerruncontrol.h> +#include <coreplugin/messagemanager.h> using namespace Qnx; using namespace Qnx::Internal; @@ -86,6 +91,28 @@ bool BlackBerryRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runC return activeDeployConf != 0; } +static void createAnalyzerStartParameters(Analyzer::AnalyzerStartParameters *pStartParameters, BlackBerryRunConfiguration* runConfiguration, ProjectExplorer::RunMode mode) +{ + QTC_ASSERT(pStartParameters, return); + pStartParameters->runMode = mode; + if (mode == ProjectExplorer::QmlProfilerRunMode) + pStartParameters->startMode = Analyzer::StartLocal; + + ProjectExplorer::Target *target = runConfiguration->target(); + ProjectExplorer::Kit *kit = target->kit(); + + ProjectExplorer::IDevice::ConstPtr device = ProjectExplorer::DeviceKitInformation::device(kit); + if (device) { + pStartParameters->connParams = device->sshParameters(); + pStartParameters->analyzerHost = device->qmlProfilerHost(); + } + pStartParameters->sysroot = ProjectExplorer::SysRootKitInformation::sysRoot(kit).toString(); + + Debugger::DebuggerRunConfigurationAspect *aspect = runConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>(); + if (aspect) + pStartParameters->analyzerPort = aspect->qmlDebugServerPort(); +} + ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode, QString *errorMessage) { @@ -106,7 +133,32 @@ ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer m_activeRunControls[rc->key()] = runControl; return runControl; } - + if (mode == ProjectExplorer::QmlProfilerRunMode) { + QtSupport::BaseQtVersion *qtVer = QtSupport::QtKitInformation::qtVersion(rc->target()->kit()); + if (qtVer && qtVer->qtVersion() <= QtSupport::QtVersionNumber(4, 8, 6)) + Core::MessageManager::write(tr("Target Qt version (%1) might not support QML profiling. " + "Cascades applications are not affected and should work as expected. " + "For more info see http://qt-project.org/wiki/Qt-Creator-with-BlackBerry-10") + .arg(qtVer->qtVersionString()), Core::MessageManager::Flash + ); + + Analyzer::AnalyzerStartParameters params; + createAnalyzerStartParameters(¶ms, rc, mode); + + Analyzer::AnalyzerRunControl *runControl = Analyzer::AnalyzerManager::createRunControl(params, runConfiguration); + BlackBerryApplicationRunner::LaunchFlags launchFlags(BlackBerryApplicationRunner::QmlDebugLaunch + | BlackBerryApplicationRunner::QmlDebugLaunchBlocking + | BlackBerryApplicationRunner::QmlProfilerLaunch); + BlackBerryApplicationRunner *runner = new BlackBerryApplicationRunner(launchFlags, rc, runControl); + + connect(runner, SIGNAL(finished()), runControl, SLOT(notifyRemoteFinished())); + connect(runner, SIGNAL(output(QString, Utils::OutputFormat)), + runControl, SLOT(logApplicationMessage(QString, Utils::OutputFormat))); + connect(runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)), + runner, SLOT(start())); + connect(runControl, SIGNAL(finished()), runner, SLOT(stop())); + return runControl; + } Debugger::DebuggerRunControl * const runControl = Debugger::DebuggerPlugin::createDebugger(startParameters(rc), runConfiguration, errorMessage); if (!runControl) diff --git a/src/plugins/qnx/qnx.qbs b/src/plugins/qnx/qnx.qbs index 2dff37b9bf..db37410db6 100644 --- a/src/plugins/qnx/qnx.qbs +++ b/src/plugins/qnx/qnx.qbs @@ -1,4 +1,4 @@ -import qbs.base 1.0 +import qbs 1.0 import QtcPlugin diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp index 4c0ab1f6f9..bee5b0947e 100644 --- a/src/plugins/qnx/qnxtoolchain.cpp +++ b/src/plugins/qnx/qnxtoolchain.cpp @@ -108,6 +108,7 @@ QList<Utils::FileName> QnxToolChain::suggestedMkspecList() const mkspecList << Utils::FileName::fromLatin1("qnx-armv7le-qcc"); mkspecList << Utils::FileName::fromLatin1("qnx-x86-qcc"); mkspecList << Utils::FileName::fromLatin1("blackberry-armv7le-qcc"); + mkspecList << Utils::FileName::fromLatin1("blackberry-armle-v7-qcc"); mkspecList << Utils::FileName::fromLatin1("blackberry-x86-qcc"); return mkspecList; |