{
const S60DeviceRunConfiguration *s60runConfig = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration);
QTC_ASSERT(s60runConfig, return);
- const S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(s60runConfig->qt4Target()->activeDeployConfiguration());
+ const S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(s60runConfig->target()->activeDeployConfiguration());
QTC_ASSERT(activeDeployConf, return);
S60DeployConfiguration::CommunicationChannel channel = activeDeployConf->communicationChannel();
$$PWD/s60publishingbuildsettingspageovi.cpp \
$$PWD/s60publishingresultspageovi.cpp \
$$PWD/symbianqtversionfactory.cpp \
- $$PWD/symbianqtversion.cpp
+ $$PWD/symbianqtversion.cpp \
+ $$PWD/s60devicedebugruncontrol.cpp
HEADERS += $$PWD/s60manager.h \
$$PWD/sbsv2parser.h \
$$PWD/s60publishingbuildsettingspageovi.h \
$$PWD/s60publishingresultspageovi.h \
$$PWD/symbianqtversionfactory.h \
- $$PWD/symbianqtversion.h
+ $$PWD/symbianqtversion.h \
+ $$PWD/s60devicedebugruncontrol.h
FORMS += $$PWD/s60createpackagestep.ui \
$$PWD/s60certificatedetailsdialog.ui \
namespace Qt4ProjectManager {
class Qt4ProFileNode;
+class S60DeviceRunConfiguration;
namespace Internal {
class Qt4SymbianTarget;
class S60DeployConfigurationFactory;
-class S60DeviceRunConfiguration;
class S60DeployConfiguration : public ProjectExplorer::DeployConfiguration
{
}
namespace Qt4ProjectManager {
+
+class S60DeviceRunConfiguration;
+
namespace Internal {
class BuildConfiguration;
-class S60DeviceRunConfiguration;
struct CommunicationChannel;
class S60DeployStepFactory : public ProjectExplorer::IBuildStepFactory
--- /dev/null
+/**************************************************************************
+**
+** 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 "s60devicedebugruncontrol.h"
+
+#include "codaruncontrol.h"
+#include "qt4symbiantarget.h"
+#include "s60deployconfiguration.h"
+#include "s60devicerunconfiguration.h"
+
+#include <coreplugin/icore.h>
+#include <debugger/debuggerengine.h>
+#include <debugger/debuggerstartparameters.h>
+#include <projectexplorer/project.h>
+#include <utils/qtcassert.h>
+
+#include <QtCore/QFileInfo>
+
+using namespace ProjectExplorer;
+using namespace Qt4ProjectManager::Internal;
+using namespace Qt4ProjectManager;
+
+// Return symbol file which should co-exist with the executable.
+// location in debug builds. This can be 'foo.sym' (ABLD) or 'foo.exe.sym' (Raptor)
+static inline QString symbolFileFromExecutable(const QString &executable)
+{
+ // 'foo.exe.sym' (Raptor)
+ const QFileInfo raptorSymFi(executable + QLatin1String(".sym"));
+ if (raptorSymFi.isFile())
+ return raptorSymFi.absoluteFilePath();
+ // 'foo.sym' (ABLD)
+ const int lastDotPos = executable.lastIndexOf(QLatin1Char('.'));
+ if (lastDotPos != -1) {
+ const QString symbolFileName = executable.mid(0, lastDotPos) + QLatin1String(".sym");
+ const QFileInfo symbolFileNameFi(symbolFileName);
+ if (symbolFileNameFi.isFile())
+ return symbolFileNameFi.absoluteFilePath();
+ }
+ return QString();
+}
+
+// Create start parameters from run configuration
+static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceRunConfiguration *rc)
+{
+ Debugger::DebuggerStartParameters sp;
+ QTC_ASSERT(rc, return sp);
+
+ const S60DeployConfiguration *activeDeployConf =
+ qobject_cast<S60DeployConfiguration *>(rc->target()->activeDeployConfiguration());
+ QTC_ASSERT(activeDeployConf, return sp);
+
+ const QString debugFileName = QString::fromLatin1("%1:\\sys\\bin\\%2.exe")
+ .arg(activeDeployConf->installationDrive()).arg(rc->targetName());
+
+ sp.remoteChannel = activeDeployConf->serialPortName();
+ sp.processArgs = rc->commandLineArguments();
+ if (rc->useQmlDebugger() && !rc->useCppDebugger())
+ sp.startMode = Debugger::AttachToRemote;
+ else
+ sp.startMode = Debugger::StartInternal;
+
+ sp.toolChainAbi = rc->abi();
+ sp.executable = debugFileName;
+ sp.executableUid = rc->executableUid();
+ sp.serverAddress = activeDeployConf->deviceAddress();
+ sp.serverPort = activeDeployConf->devicePort().toInt();
+ sp.displayName = rc->displayName();
+ sp.qmlServerPort = rc->qmlDebugServerPort();
+ if (rc->useQmlDebugger()) {
+ QString qmlArgs = rc->qmlCommandLineArguments();
+ if (sp.processArgs.length())
+ sp.processArgs.prepend(" ");
+ sp.processArgs.prepend(qmlArgs);
+ }
+
+ sp.communicationChannel = activeDeployConf->communicationChannel() == S60DeployConfiguration::CommunicationCodaTcpConnection?
+ Debugger::DebuggerStartParameters::CommunicationChannelTcpIp:
+ Debugger::DebuggerStartParameters::CommunicationChannelUsb;
+
+ sp.debugClient = activeDeployConf->communicationChannel() == S60DeployConfiguration::CommunicationTrkSerialConnection?
+ Debugger::DebuggerStartParameters::SymbianDebugClientTrk:
+ Debugger::DebuggerStartParameters::SymbianDebugClientCoda;
+
+ if (const ProjectExplorer::Project *project = rc->target()->project()) {
+ sp.projectSourceDirectory = project->projectDirectory();
+ if (const ProjectExplorer::BuildConfiguration *buildConfig = rc->target()->activeBuildConfiguration()) {
+ sp.projectBuildDirectory = buildConfig->buildDirectory();
+ }
+ sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
+ }
+
+ QTC_ASSERT(sp.executableUid, return sp);
+
+ // Prefer the '*.sym' file over the '.exe', which should exist at the same
+ // location in debug builds. This can be 'foo.exe' (ABLD) or 'foo.exe.sym' (Raptor)
+ sp.symbolFileName = symbolFileFromExecutable(rc->localExecutableFileName());
+ return sp;
+}
+
+S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *rc,
+ const Debugger::DebuggerStartParameters &sp,
+ const QPair<Debugger::DebuggerEngineType, Debugger::DebuggerEngineType> &masterSlaveEngineTypes) :
+ Debugger::DebuggerRunControl(rc, sp, masterSlaveEngineTypes),
+ m_codaRunControl(NULL),
+ m_codaState(ENotUsingCodaRunControl)
+{
+ if (startParameters().symbolFileName.isEmpty()) {
+ const QString msg = tr("Warning: Cannot locate the symbol file belonging to %1.\n").
+ arg(rc->localExecutableFileName());
+ appendMessage(msg, Utils::ErrorMessageFormat);
+ }
+ if (masterSlaveEngineTypes.first == Debugger::QmlEngineType) {
+ connect(engine(), SIGNAL(requestRemoteSetup()), this, SLOT(remoteSetupRequested()));
+ connect(engine(), SIGNAL(stateChanged(Debugger::DebuggerState)), this, SLOT(qmlEngineStateChanged(Debugger::DebuggerState)));
+ }
+}
+
+void S60DeviceDebugRunControl::start()
+{
+ appendMessage(tr("Launching debugger...\n"), Utils::NormalMessageFormat);
+ Debugger::DebuggerRunControl::start();
+}
+
+bool S60DeviceDebugRunControl::promptToStop(bool *) const
+{
+ // We override the settings prompt
+ return Debugger::DebuggerRunControl::promptToStop(0);
+}
+
+void S60DeviceDebugRunControl::remoteSetupRequested()
+{
+ // This is called from Engine->setupInferior(), ie InferiorSetupRequested state
+ QTC_ASSERT(runConfiguration()->useQmlDebugger() && !runConfiguration()->useCppDebugger(), return);
+ m_codaRunControl = new CodaRunControl(runConfiguration(), Debugger::Constants::DEBUGMODE);
+ connect(m_codaRunControl, SIGNAL(connected()), this, SLOT(codaConnected()));
+ connect(m_codaRunControl, SIGNAL(finished()), this, SLOT(codaFinished()));
+ connect(m_codaRunControl, SIGNAL(appendMessage(ProjectExplorer::RunControl*,QString,Utils::OutputFormat)), this, SLOT(handleMessageFromCoda(ProjectExplorer::RunControl*,QString,Utils::OutputFormat)));
+ connect(this, SIGNAL(finished()), this, SLOT(handleDebuggingFinished()));
+ m_codaState = EWaitingForCodaConnection;
+ m_codaRunControl->connect();
+}
+
+void S60DeviceDebugRunControl::codaFinished()
+{
+ if (m_codaRunControl) {
+ m_codaRunControl->deleteLater();
+ m_codaRunControl = NULL;
+ }
+ if (m_codaState == EWaitingForCodaConnection) {
+ engine()->handleRemoteSetupFailed(QLatin1String("CODA failed to initialise")); // TODO sort out this error string? Unlikely we'll ever hit this state anyway.
+ } else {
+ debuggingFinished();
+ }
+ m_codaState = ENotUsingCodaRunControl;
+}
+
+void S60DeviceDebugRunControl::codaConnected()
+{
+ QTC_ASSERT(m_codaState == EWaitingForCodaConnection, return);
+ m_codaState = ECodaConnected;
+ engine()->handleRemoteSetupDone(-1, 0); // calls notifyInferiorSetupOk()
+}
+
+void S60DeviceDebugRunControl::qmlEngineStateChanged(const Debugger::DebuggerState &state)
+{
+ if (state == Debugger::EngineRunRequested)
+ m_codaRunControl->run();
+}
+
+void S60DeviceDebugRunControl::handleDebuggingFinished()
+{
+ if (m_codaRunControl) {
+ m_codaRunControl->stop(); // We'll get a callback to our codaFinished() slot when it's done
+ }
+}
+
+void S60DeviceDebugRunControl::handleMessageFromCoda(ProjectExplorer::RunControl *aCodaRunControl, const QString &msg, Utils::OutputFormat format)
+{
+ // This only gets used when QmlEngine is the master debug engine. If GDB is running, messages are handled via the gdb adapter
+ Q_UNUSED(aCodaRunControl)
+ Q_UNUSED(format)
+ engine()->showMessage(msg, Debugger::AppOutput);
+}
+
+//
+
+S60DeviceDebugRunControlFactory::S60DeviceDebugRunControlFactory(QObject *parent) :
+ IRunControlFactory(parent)
+{
+}
+
+bool S60DeviceDebugRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const
+{
+ return mode == QLatin1String(Debugger::Constants::DEBUGMODE)
+ && qobject_cast<S60DeviceRunConfiguration *>(runConfiguration) != 0;
+}
+
+ProjectExplorer::RunControl* S60DeviceDebugRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode)
+{
+ S60DeviceRunConfiguration *rc = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration);
+ QTC_ASSERT(rc && mode == QLatin1String(Debugger::Constants::DEBUGMODE), return 0);
+ const Debugger::DebuggerStartParameters startParameters = s60DebuggerStartParams(rc);
+ const Debugger::ConfigurationCheck check = Debugger::checkDebugConfiguration(startParameters);
+ if (!check) {
+ Core::ICore::instance()->showWarningWithOptions(S60DeviceDebugRunControl::tr("Debugger for Symbian Platform"),
+ check.errorMessage, check.errorDetailsString(), check.settingsCategory, check.settingsPage);
+ return 0;
+ }
+ return new S60DeviceDebugRunControl(rc, startParameters, check.masterSlaveEngineTypes);
+}
+
+QString S60DeviceDebugRunControlFactory::displayName() const
+{
+ return S60DeviceDebugRunControl::tr("Debug on Device");
+}
+
+ProjectExplorer::RunConfigWidget *S60DeviceDebugRunControlFactory::createConfigurationWidget(RunConfiguration* /*runConfiguration */)
+{
+ return 0;
+}
--- /dev/null
+/**************************************************************************
+**
+** 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 S60DEVICEDEBUGRUNCONTROL_H
+#define S60DEVICEDEBUGRUNCONTROL_H
+
+#include <debugger/debuggerrunner.h>
+
+namespace Qt4ProjectManager {
+
+class S60DeviceRunConfiguration;
+class CodaRunControl;
+
+namespace Internal {
+
+class S60DeviceDebugRunControl : public Debugger::DebuggerRunControl
+{
+ Q_DISABLE_COPY(S60DeviceDebugRunControl)
+ Q_OBJECT
+public:
+ explicit S60DeviceDebugRunControl(S60DeviceRunConfiguration *runConfiguration,
+ const Debugger::DebuggerStartParameters &sp,
+ const QPair<Debugger::DebuggerEngineType, Debugger::DebuggerEngineType> &masterSlaveEngineTypes);
+ virtual void start();
+ virtual bool promptToStop(bool *optionalPrompt = 0) const;
+
+private slots:
+ void remoteSetupRequested();
+ void codaConnected();
+ void qmlEngineStateChanged(const Debugger::DebuggerState &state);
+ void codaFinished();
+ void handleDebuggingFinished();
+ void handleMessageFromCoda(ProjectExplorer::RunControl *aCodaRunControl, const QString &msg, Utils::OutputFormat format);
+
+private:
+ CodaRunControl *m_codaRunControl;
+ enum {
+ ENotUsingCodaRunControl = 0,
+ EWaitingForCodaConnection,
+ ECodaConnected
+ } m_codaState;
+};
+
+class S60DeviceDebugRunControlFactory : public ProjectExplorer::IRunControlFactory
+{
+public:
+ explicit S60DeviceDebugRunControlFactory(QObject *parent = 0);
+ bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const;
+
+ ProjectExplorer::RunControl* create(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode);
+ QString displayName() const;
+ ProjectExplorer::RunConfigWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration * /*runConfiguration */);
+};
+
+} // namespace Internal
+} // namespace Qt4ProjectManager
+
+#endif // S60DEVICEDEBUGRUNCONTROL_H
**************************************************************************/
#include "s60devicerunconfiguration.h"
-#include "s60devicerunconfigurationwidget.h"
-#include "s60deployconfiguration.h"
+
#include "qt4project.h"
-#include "qt4target.h"
-#include "s60manager.h"
-#include "s60runconfigbluetoothstarter.h"
#include "qt4projectmanagerconstants.h"
#include "qt4symbiantarget.h"
-#include "codaruncontrol.h"
+#include "qt4target.h"
+#include "s60deployconfiguration.h"
+#include "s60devicerunconfigurationwidget.h"
+#include "s60manager.h"
#include "symbianqtversion.h"
#include <utils/qtcassert.h>
-
-#include <coreplugin/icore.h>
-#include <coreplugin/progressmanager/progressmanager.h>
-
-#include <debugger/debuggerengine.h>
-#include <debugger/debuggerstartparameters.h>
#include <qtsupport/qtoutputformatter.h>
-#include <qtsupport/baseqtversion.h>
-
-#include <QtGui/QMessageBox>
-#include <QtGui/QMainWindow>
-#include <QtCore/QFileInfo>
-#include <QtCore/QDateTime>
-#include <QtCore/QDir>
-
-#include <QtNetwork/QTcpSocket>
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
S60DeviceRunConfiguration *old = static_cast<S60DeviceRunConfiguration *>(source);
return new S60DeviceRunConfiguration(t, old);
}
-
-// ======== S60DeviceDebugRunControl
-
-// Return symbol file which should co-exist with the executable.
-// location in debug builds. This can be 'foo.sym' (ABLD) or 'foo.exe.sym' (Raptor)
-static inline QString symbolFileFromExecutable(const QString &executable)
-{
- // 'foo.exe.sym' (Raptor)
- const QFileInfo raptorSymFi(executable + QLatin1String(".sym"));
- if (raptorSymFi.isFile())
- return raptorSymFi.absoluteFilePath();
- // 'foo.sym' (ABLD)
- const int lastDotPos = executable.lastIndexOf(QLatin1Char('.'));
- if (lastDotPos != -1) {
- const QString symbolFileName = executable.mid(0, lastDotPos) + QLatin1String(".sym");
- const QFileInfo symbolFileNameFi(symbolFileName);
- if (symbolFileNameFi.isFile())
- return symbolFileNameFi.absoluteFilePath();
- }
- return QString();
-}
-
-// Create start parameters from run configuration
-static Debugger::DebuggerStartParameters s60DebuggerStartParams(const S60DeviceRunConfiguration *rc)
-{
- Debugger::DebuggerStartParameters sp;
- QTC_ASSERT(rc, return sp);
-
- const S60DeployConfiguration *activeDeployConf =
- qobject_cast<S60DeployConfiguration *>(rc->qt4Target()->activeDeployConfiguration());
- QTC_ASSERT(activeDeployConf, return sp);
-
- const QString debugFileName = QString::fromLatin1("%1:\\sys\\bin\\%2.exe")
- .arg(activeDeployConf->installationDrive()).arg(rc->targetName());
-
- sp.remoteChannel = activeDeployConf->serialPortName();
- sp.processArgs = rc->commandLineArguments();
- if (rc->useQmlDebugger() && !rc->useCppDebugger())
- sp.startMode = Debugger::AttachToRemote;
- else
- sp.startMode = Debugger::StartInternal;
-
- sp.toolChainAbi = rc->abi();
- sp.executable = debugFileName;
- sp.executableUid = rc->executableUid();
- sp.serverAddress = activeDeployConf->deviceAddress();
- sp.serverPort = activeDeployConf->devicePort().toInt();
- sp.displayName = rc->displayName();
- sp.qmlServerPort = rc->qmlDebugServerPort();
- if (rc->useQmlDebugger()) {
- QString qmlArgs = rc->qmlCommandLineArguments();
- if (sp.processArgs.length())
- sp.processArgs.prepend(" ");
- sp.processArgs.prepend(qmlArgs);
- }
-
- sp.communicationChannel = activeDeployConf->communicationChannel() == S60DeployConfiguration::CommunicationCodaTcpConnection?
- Debugger::DebuggerStartParameters::CommunicationChannelTcpIp:
- Debugger::DebuggerStartParameters::CommunicationChannelUsb;
-
- sp.debugClient = activeDeployConf->communicationChannel() == S60DeployConfiguration::CommunicationTrkSerialConnection?
- Debugger::DebuggerStartParameters::SymbianDebugClientTrk:
- Debugger::DebuggerStartParameters::SymbianDebugClientCoda;
-
- if (const ProjectExplorer::Project *project = rc->target()->project()) {
- sp.projectSourceDirectory = project->projectDirectory();
- if (const ProjectExplorer::BuildConfiguration *buildConfig = rc->target()->activeBuildConfiguration()) {
- sp.projectBuildDirectory = buildConfig->buildDirectory();
- }
- sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
- }
-
- QTC_ASSERT(sp.executableUid, return sp);
-
- // Prefer the '*.sym' file over the '.exe', which should exist at the same
- // location in debug builds. This can be 'foo.exe' (ABLD) or 'foo.exe.sym' (Raptor)
- sp.symbolFileName = symbolFileFromExecutable(rc->localExecutableFileName());
- return sp;
-}
-
-S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *rc,
- const Debugger::DebuggerStartParameters &sp,
- const QPair<Debugger::DebuggerEngineType, Debugger::DebuggerEngineType> &masterSlaveEngineTypes) :
- Debugger::DebuggerRunControl(rc, sp, masterSlaveEngineTypes),
- m_codaRunControl(NULL),
- m_codaState(ENotUsingCodaRunControl)
-{
- if (startParameters().symbolFileName.isEmpty()) {
- const QString msg = tr("Warning: Cannot locate the symbol file belonging to %1.\n").
- arg(rc->localExecutableFileName());
- appendMessage(msg, Utils::ErrorMessageFormat);
- }
- if (masterSlaveEngineTypes.first == Debugger::QmlEngineType) {
- connect(engine(), SIGNAL(requestRemoteSetup()), this, SLOT(remoteSetupRequested()));
- connect(engine(), SIGNAL(stateChanged(Debugger::DebuggerState)), this, SLOT(qmlEngineStateChanged(Debugger::DebuggerState)));
- }
-}
-
-void S60DeviceDebugRunControl::start()
-{
- appendMessage(tr("Launching debugger...\n"), Utils::NormalMessageFormat);
- Debugger::DebuggerRunControl::start();
-}
-
-bool S60DeviceDebugRunControl::promptToStop(bool *) const
-{
- // We override the settings prompt
- return Debugger::DebuggerRunControl::promptToStop(0);
-}
-
-void S60DeviceDebugRunControl::remoteSetupRequested()
-{
- // This is called from Engine->setupInferior(), ie InferiorSetupRequested state
- QTC_ASSERT(runConfiguration()->useQmlDebugger() && !runConfiguration()->useCppDebugger(), return);
- m_codaRunControl = new CodaRunControl(runConfiguration(), Debugger::Constants::DEBUGMODE);
- connect(m_codaRunControl, SIGNAL(connected()), this, SLOT(codaConnected()));
- connect(m_codaRunControl, SIGNAL(finished()), this, SLOT(codaFinished()));
- connect(m_codaRunControl, SIGNAL(appendMessage(ProjectExplorer::RunControl*,QString,Utils::OutputFormat)), this, SLOT(handleMessageFromCoda(ProjectExplorer::RunControl*,QString,Utils::OutputFormat)));
- connect(this, SIGNAL(finished()), this, SLOT(handleDebuggingFinished()));
- m_codaState = EWaitingForCodaConnection;
- m_codaRunControl->connect();
-}
-
-void S60DeviceDebugRunControl::codaFinished()
-{
- if (m_codaRunControl) {
- m_codaRunControl->deleteLater();
- m_codaRunControl = NULL;
- }
- if (m_codaState == EWaitingForCodaConnection) {
- engine()->handleRemoteSetupFailed(QLatin1String("CODA failed to initialise")); // TODO sort out this error string? Unlikely we'll ever hit this state anyway.
- } else {
- debuggingFinished();
- }
- m_codaState = ENotUsingCodaRunControl;
-}
-
-void S60DeviceDebugRunControl::codaConnected()
-{
- QTC_ASSERT(m_codaState == EWaitingForCodaConnection, return);
- m_codaState = ECodaConnected;
- engine()->handleRemoteSetupDone(-1, 0); // calls notifyInferiorSetupOk()
-}
-
-void S60DeviceDebugRunControl::qmlEngineStateChanged(const Debugger::DebuggerState &state)
-{
- if (state == Debugger::EngineRunRequested)
- m_codaRunControl->run();
-}
-
-void S60DeviceDebugRunControl::handleDebuggingFinished()
-{
- if (m_codaRunControl) {
- m_codaRunControl->stop(); // We'll get a callback to our codaFinished() slot when it's done
- }
-}
-
-void S60DeviceDebugRunControl::handleMessageFromCoda(ProjectExplorer::RunControl *aCodaRunControl, const QString &msg, Utils::OutputFormat format)
-{
- // This only gets used when QmlEngine is the master debug engine. If GDB is running, messages are handled via the gdb adapter
- Q_UNUSED(aCodaRunControl)
- Q_UNUSED(format)
- engine()->showMessage(msg, Debugger::AppOutput);
-}
-
-//
-
-S60DeviceDebugRunControlFactory::S60DeviceDebugRunControlFactory(QObject *parent) :
- IRunControlFactory(parent)
-{
-}
-
-bool S60DeviceDebugRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const
-{
- return mode == QLatin1String(Debugger::Constants::DEBUGMODE)
- && qobject_cast<S60DeviceRunConfiguration *>(runConfiguration) != 0;
-}
-
-ProjectExplorer::RunControl* S60DeviceDebugRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode)
-{
- S60DeviceRunConfiguration *rc = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration);
- QTC_ASSERT(rc && mode == QLatin1String(Debugger::Constants::DEBUGMODE), return 0);
- const Debugger::DebuggerStartParameters startParameters = s60DebuggerStartParams(rc);
- const Debugger::ConfigurationCheck check = Debugger::checkDebugConfiguration(startParameters);
- if (!check) {
- Core::ICore::instance()->showWarningWithOptions(S60DeviceDebugRunControl::tr("Debugger for Symbian Platform"),
- check.errorMessage, check.errorDetailsString(), check.settingsCategory, check.settingsPage);
- return 0;
- }
- return new S60DeviceDebugRunControl(rc, startParameters, check.masterSlaveEngineTypes);
-}
-
-QString S60DeviceDebugRunControlFactory::displayName() const
-{
- return S60DeviceDebugRunControl::tr("Debug on Device");
-}
-
-ProjectExplorer::RunConfigWidget *S60DeviceDebugRunControlFactory::createConfigurationWidget(RunConfiguration* /*runConfiguration */)
-{
- return 0;
-}
#ifndef S60DEVICERUNCONFIGURATION_H
#define S60DEVICERUNCONFIGURATION_H
-#include <debugger/debuggerrunner.h>
#include <projectexplorer/runconfiguration.h>
+#include <qt4projectmanager/qt4projectmanager_global.h>
#include <QtCore/QFutureInterface>
#include <QtCore/QScopedPointer>
#include <QtCore/QStringList>
QT_BEGIN_NAMESPACE
-class QMessageBox;
class QWidget;
QT_END_NAMESPACE
namespace Qt4ProjectManager {
class Qt4BaseTarget;
class Qt4ProFileNode;
-class CodaRunControl;
namespace Internal {
class SymbianQtVersion;
class Qt4SymbianTarget;
+}
+
class S60DeviceRunConfigurationFactory;
-class S60DeviceRunConfiguration : public ProjectExplorer::RunConfiguration
-{
+class QT4PROJECTMANAGER_EXPORT S60DeviceRunConfiguration : public ProjectExplorer::RunConfiguration {
Q_OBJECT
friend class S60DeviceRunConfigurationFactory;
S60DeviceRunConfiguration(Qt4ProjectManager::Qt4BaseTarget *parent, const QString &proFilePath);
virtual ~S60DeviceRunConfiguration();
- Qt4SymbianTarget *qt4Target() const;
- SymbianQtVersion *qtVersion() const;
-
bool isEnabled() const;
QString disabledReason() const;
QWidget *createConfigurationWidget();
S60DeviceRunConfiguration(Qt4ProjectManager::Qt4BaseTarget *parent, S60DeviceRunConfiguration *source);
QString defaultDisplayName() const;
virtual bool fromMap(const QVariantMap &map);
+
private slots:
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro);
void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success);
private:
void ctor();
void handleParserState(bool success);
+ Internal::Qt4SymbianTarget *qt4Target() const;
+ Internal::SymbianQtVersion *qtVersion() const;
QString m_proFilePath;
QString m_commandLineArguments;
QString displayNameForId(const QString &id) const;
};
-// S60DeviceDebugRunControl starts debugging
-
-class S60DeviceDebugRunControl : public Debugger::DebuggerRunControl
-{
- Q_DISABLE_COPY(S60DeviceDebugRunControl)
- Q_OBJECT
-public:
- explicit S60DeviceDebugRunControl(S60DeviceRunConfiguration *runConfiguration,
- const Debugger::DebuggerStartParameters &sp,
- const QPair<Debugger::DebuggerEngineType, Debugger::DebuggerEngineType> &masterSlaveEngineTypes);
- virtual void start();
- virtual bool promptToStop(bool *optionalPrompt = 0) const;
-
-private slots:
- void remoteSetupRequested();
- void codaConnected();
- void qmlEngineStateChanged(const Debugger::DebuggerState &state);
- void codaFinished();
- void handleDebuggingFinished();
- void handleMessageFromCoda(ProjectExplorer::RunControl *aCodaRunControl, const QString &msg, Utils::OutputFormat format);
-
-private:
- CodaRunControl *m_codaRunControl;
- enum {
- ENotUsingCodaRunControl = 0,
- EWaitingForCodaConnection,
- ECodaConnected
- } m_codaState;
-};
-
-class S60DeviceDebugRunControlFactory : public ProjectExplorer::IRunControlFactory
-{
-public:
- explicit S60DeviceDebugRunControlFactory(QObject *parent = 0);
- bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode) const;
-
- ProjectExplorer::RunControl* create(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode);
- QString displayName() const;
- ProjectExplorer::RunConfigWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration * /*runConfiguration */);
-};
-
-} // namespace Internal
} // namespace Qt4ProjectManager
#endif // S60DEVICERUNCONFIGURATION_H
}
namespace Qt4ProjectManager {
-namespace Internal {
class S60DeviceRunConfiguration;
+namespace Internal {
+
class S60DeviceRunConfigurationWidget : public QWidget
{
Q_OBJECT
#include "s60deployconfiguration.h"
#include "s60deploystep.h"
#include "s60runcontrolfactory.h"
+#include "s60devicedebugruncontrol.h"
#include "qt4symbiantargetfactory.h"
#include "s60publishingwizardfactories.h"
#include <utils/qtcassert.h>
+#include <debugger/debuggerconstants.h>
+
#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/progressmanager.h>
const S60DeviceRunConfiguration *s60runConfig = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration);
QTC_ASSERT(s60runConfig, return);
- const Qt4BuildConfiguration *activeBuildConf = s60runConfig->qt4Target()->activeBuildConfiguration();
+ const Qt4BuildConfiguration *activeBuildConf = qobject_cast<Qt4BuildConfiguration *>(s60runConfig->target()->activeBuildConfiguration());
QTC_ASSERT(activeBuildConf, return);
- const S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(s60runConfig->qt4Target()->activeDeployConfiguration());
+ const S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(s60runConfig->target()->activeDeployConfiguration());
QTC_ASSERT(activeDeployConf, return);
m_executableUid = s60runConfig->executableUid();
S60DeviceRunConfiguration *rc = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration);
if (!rc)
return false;
- S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(rc->qt4Target()->activeDeployConfiguration());
+ S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(rc->target()->activeDeployConfiguration());
return activeDeployConf != 0;
}
QTC_ASSERT(rc, return 0);
QTC_ASSERT(mode == m_mode, return 0);
- S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(rc->qt4Target()->activeDeployConfiguration());
+ S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(rc->target()->activeDeployConfiguration());
if (!activeDeployConf)
return 0;
{
const S60DeviceRunConfiguration *s60runConfig = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration);
QTC_ASSERT(s60runConfig, return);
- const S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(s60runConfig->qt4Target()->activeDeployConfiguration());
+ const S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(s60runConfig->target()->activeDeployConfiguration());
QTC_ASSERT(activeDeployConf, return);
m_serialPortName = activeDeployConf->serialPortName();