Commit ae4c35bd authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Support QML-only debugging.

Reviewed-by: kh1
parent 82f4e73c
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "gdb/gdbengine.h" #include "gdb/gdbengine.h"
#include "gdb/remotegdbserveradapter.h" #include "gdb/remotegdbserveradapter.h"
#include "gdb/remoteplaingdbadapter.h" #include "gdb/remoteplaingdbadapter.h"
#include "qml/qmlengine.h"
#include "qml/qmlcppengine.h" #include "qml/qmlcppengine.h"
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
...@@ -435,6 +436,9 @@ void DebuggerRunControl::createEngine(const DebuggerStartParameters &startParams ...@@ -435,6 +436,9 @@ void DebuggerRunControl::createEngine(const DebuggerStartParameters &startParams
break; break;
case QmlEngineType: case QmlEngineType:
d->m_engine = Internal::createQmlEngine(sp); d->m_engine = Internal::createQmlEngine(sp);
connect(qobject_cast<QmlEngine *>(d->m_engine),
SIGNAL(remoteStartupRequested()), this,
SIGNAL(engineRequestSetup()));
break; break;
case QmlCppEngineType: case QmlCppEngineType:
d->m_engine = Internal::createQmlCppEngine(sp); d->m_engine = Internal::createQmlCppEngine(sp);
...@@ -463,10 +467,10 @@ void DebuggerRunControl::initGdbEngine(Internal::GdbEngine *engine) ...@@ -463,10 +467,10 @@ void DebuggerRunControl::initGdbEngine(Internal::GdbEngine *engine)
Internal::AbstractGdbAdapter *adapter = engine->gdbAdapter(); Internal::AbstractGdbAdapter *adapter = engine->gdbAdapter();
if (RemotePlainGdbAdapter *rpga = qobject_cast<RemotePlainGdbAdapter *>(adapter)) { if (RemotePlainGdbAdapter *rpga = qobject_cast<RemotePlainGdbAdapter *>(adapter)) {
connect(rpga, SIGNAL(requestSetup()), this, connect(rpga, SIGNAL(requestSetup()), this,
SIGNAL(gdbAdapterRequestSetup())); SIGNAL(engineRequestSetup()));
} else if (RemoteGdbServerAdapter *rgsa = qobject_cast<RemoteGdbServerAdapter *>(adapter)) { } else if (RemoteGdbServerAdapter *rgsa = qobject_cast<RemoteGdbServerAdapter *>(adapter)) {
connect(rgsa, SIGNAL(requestSetup()), connect(rgsa, SIGNAL(requestSetup()),
this, SIGNAL(gdbAdapterRequestSetup())); this, SIGNAL(engineRequestSetup()));
} }
} }
...@@ -650,27 +654,35 @@ Internal::AbstractGdbAdapter *DebuggerRunControl::gdbAdapter() const ...@@ -650,27 +654,35 @@ Internal::AbstractGdbAdapter *DebuggerRunControl::gdbAdapter() const
return engine->gdbAdapter(); return engine->gdbAdapter();
} }
void DebuggerRunControl::remoteGdbHandleSetupDone() void DebuggerRunControl::handleRemoteSetupDone()
{ {
Internal::AbstractGdbAdapter *adapter = gdbAdapter(); if (QmlEngine *qmlEngine = qobject_cast<QmlEngine *>(d->m_engine)) {
QTC_ASSERT(adapter, return); qmlEngine->handleRemoteSetupDone();
if (RemotePlainGdbAdapter *rpga = qobject_cast<RemotePlainGdbAdapter *>(adapter)) { } else if (Internal::AbstractGdbAdapter *adapter = gdbAdapter()) {
rpga->handleSetupDone(); if (RemotePlainGdbAdapter *rpga = qobject_cast<RemotePlainGdbAdapter *>(adapter)) {
} else if (RemoteGdbServerAdapter *rgsa = qobject_cast<RemoteGdbServerAdapter *>(adapter)) { rpga->handleSetupDone();
rgsa->handleSetupDone(); } else if (RemoteGdbServerAdapter *rgsa = qobject_cast<RemoteGdbServerAdapter *>(adapter)) {
rgsa->handleSetupDone();
} else {
QTC_ASSERT(false, /* */ );
}
} else { } else {
QTC_ASSERT(false, /* */ ); QTC_ASSERT(false, /* */ );
} }
} }
void DebuggerRunControl::remoteGdbHandleSetupFailed(const QString &message) void DebuggerRunControl::handleRemoteSetupFailed(const QString &message)
{ {
Internal::AbstractGdbAdapter *adapter = gdbAdapter(); if (QmlEngine *qmlEngine = qobject_cast<QmlEngine *>(d->m_engine)) {
QTC_ASSERT(adapter, return); qmlEngine->handleRemoteSetupFailed(message);
if (RemotePlainGdbAdapter *rpga = qobject_cast<RemotePlainGdbAdapter *>(adapter)) { } else if (Internal::AbstractGdbAdapter *adapter = gdbAdapter()) {
rpga->handleSetupFailed(message); if (RemotePlainGdbAdapter *rpga = qobject_cast<RemotePlainGdbAdapter *>(adapter)) {
} else if (RemoteGdbServerAdapter *rgsa = qobject_cast<RemoteGdbServerAdapter *>(adapter)) { rpga->handleSetupFailed(message);
rgsa->handleSetupFailed(message); } else if (RemoteGdbServerAdapter *rgsa = qobject_cast<RemoteGdbServerAdapter *>(adapter)) {
rgsa->handleSetupFailed(message);
} else {
QTC_ASSERT(false, /* */ );
}
} else { } else {
QTC_ASSERT(false, /* */ ); QTC_ASSERT(false, /* */ );
} }
......
...@@ -116,8 +116,8 @@ public: ...@@ -116,8 +116,8 @@ public:
void showMessage(const QString &msg, int channel); void showMessage(const QString &msg, int channel);
void remoteGdbHandleSetupDone(); void handleRemoteSetupDone();
void remoteGdbHandleSetupFailed(const QString &message); void handleRemoteSetupFailed(const QString &message);
static bool checkDebugConfiguration(int toolChain, static bool checkDebugConfiguration(int toolChain,
QString *errorMessage, QString *errorMessage,
...@@ -125,7 +125,7 @@ public: ...@@ -125,7 +125,7 @@ public:
QString *settingsPage = 0); QString *settingsPage = 0);
signals: signals:
void gdbAdapterRequestSetup(); void engineRequestSetup();
public slots: public slots:
void emitAddToOutputWindow(const QString &line, bool onStdErr); void emitAddToOutputWindow(const QString &line, bool onStdErr);
......
...@@ -168,19 +168,23 @@ void QmlEngine::setupInferior() ...@@ -168,19 +168,23 @@ void QmlEngine::setupInferior()
{ {
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state()); QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
connect(&d->m_applicationLauncher, SIGNAL(processExited(int)), if (startParameters().startMode == AttachToRemote) {
this, SLOT(disconnected())); emit remoteStartupRequested();
connect(&d->m_applicationLauncher, SIGNAL(appendMessage(QString,bool)), } else {
runControl(), SLOT(emitAppendMessage(QString,bool))); connect(&d->m_applicationLauncher, SIGNAL(processExited(int)),
connect(&d->m_applicationLauncher, SIGNAL(appendOutput(QString, bool)), this, SLOT(disconnected()));
runControl(), SLOT(emitAddToOutputWindow(QString, bool))); connect(&d->m_applicationLauncher, SIGNAL(appendMessage(QString,bool)),
connect(&d->m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)), runControl(), SLOT(emitAppendMessage(QString,bool)));
runControl(), SLOT(bringApplicationToForeground(qint64))); connect(&d->m_applicationLauncher, SIGNAL(appendOutput(QString, bool)),
runControl(), SLOT(emitAddToOutputWindow(QString, bool)));
d->m_applicationLauncher.setEnvironment(startParameters().environment); connect(&d->m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)),
d->m_applicationLauncher.setWorkingDirectory(startParameters().workingDirectory); runControl(), SLOT(bringApplicationToForeground(qint64)));
notifyInferiorSetupOk(); d->m_applicationLauncher.setEnvironment(startParameters().environment);
d->m_applicationLauncher.setWorkingDirectory(startParameters().workingDirectory);
notifyInferiorSetupOk();
}
} }
void QmlEngine::connectionEstablished() void QmlEngine::connectionEstablished()
...@@ -227,6 +231,18 @@ void QmlEngine::runEngine() ...@@ -227,6 +231,18 @@ void QmlEngine::runEngine()
plugin()->showMessage(tr("QML Debugger connecting..."), StatusBar); plugin()->showMessage(tr("QML Debugger connecting..."), StatusBar);
} }
void QmlEngine::handleRemoteSetupDone()
{
notifyInferiorSetupOk();
}
void QmlEngine::handleRemoteSetupFailed(const QString &message)
{
QMessageBox::critical(0,tr("Failed to start application"),
tr("Application startup failed: %1").arg(message));
notifyInferiorSetupFailed();
}
void QmlEngine::shutdownInferiorAsSlave() void QmlEngine::shutdownInferiorAsSlave()
{ {
resetLocation(); resetLocation();
......
...@@ -48,6 +48,9 @@ public: ...@@ -48,6 +48,9 @@ public:
explicit QmlEngine(const DebuggerStartParameters &startParameters); explicit QmlEngine(const DebuggerStartParameters &startParameters);
virtual ~QmlEngine(); virtual ~QmlEngine();
void handleRemoteSetupDone();
void handleRemoteSetupFailed(const QString &message);
void setAttachToRunningExternalApp(bool value); void setAttachToRunningExternalApp(bool value);
void shutdownInferiorAsSlave(); void shutdownInferiorAsSlave();
void shutdownEngineAsSlave(); void shutdownEngineAsSlave();
...@@ -59,6 +62,9 @@ public slots: ...@@ -59,6 +62,9 @@ public slots:
void messageReceived(const QByteArray &message); void messageReceived(const QByteArray &message);
void disconnected(); void disconnected();
signals:
void remoteStartupRequested();
private: private:
// DebuggerEngine implementation // DebuggerEngine implementation
bool isSynchronous() const { return false; } bool isSynchronous() const { return false; }
......
...@@ -67,40 +67,41 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC ...@@ -67,40 +67,41 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
params.qmlServerAddress = runConfig->deviceConfig().server.host; params.qmlServerAddress = runConfig->deviceConfig().server.host;
params.qmlServerPort = qmlServerPort(runConfig); params.qmlServerPort = qmlServerPort(runConfig);
} }
if (runConfig->useCppDebugger()) {
if (runConfig->useRemoteGdb()) { params.processArgs = runConfig->arguments();
params.startMode = StartRemoteGdb; params.sysRoot = runConfig->sysRoot();
params.executable = runConfig->remoteExecutableFilePath(); params.toolChainType = ToolChain::GCC_MAEMO;
params.debuggerCommand params.dumperLibrary = runConfig->dumperLib();
= MaemoGlobal::remoteCommandPrefix(runConfig->remoteExecutableFilePath()) params.remoteDumperLib = uploadDir(devConf).toUtf8() + '/'
+ environment(runConfig) + QLatin1String(" /usr/bin/gdb"); + QFileInfo(runConfig->dumperLib()).fileName().toUtf8();
params.connParams = devConf.server; if (runConfig->useRemoteGdb()) {
params.localMountDir = runConfig->localDirToMountForRemoteGdb(); params.startMode = StartRemoteGdb;
params.remoteMountPoint = MaemoGlobal::remoteProjectSourcesMountPoint(); params.executable = runConfig->remoteExecutableFilePath();
const QString execDirAbs params.debuggerCommand
= QDir::fromNativeSeparators(QFileInfo(runConfig->localExecutableFilePath()).path()); = MaemoGlobal::remoteCommandPrefix(runConfig->remoteExecutableFilePath())
const QString execDirRel + environment(runConfig) + QLatin1String(" /usr/bin/gdb");
= QDir(params.localMountDir).relativeFilePath(execDirAbs); params.connParams = devConf.server;
params.remoteSourcesDir = QString(params.remoteMountPoint params.localMountDir = runConfig->localDirToMountForRemoteGdb();
+ QLatin1Char('/') + execDirRel).toUtf8(); params.remoteMountPoint = MaemoGlobal::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();
} else {
params.startMode = AttachToRemote;
params.executable = runConfig->localExecutableFilePath();
params.debuggerCommand = runConfig->gdbCmd();
params.remoteChannel = devConf.server.host + QLatin1Char(':')
+ QString::number(gdbServerPort(runConfig));
params.useServerStartScript = true;
params.remoteArchitecture = QLatin1String("arm");
}
} else { } else {
params.startMode = AttachToRemote; params.startMode = AttachToRemote;
params.executable = runConfig->localExecutableFilePath();
params.debuggerCommand = runConfig->gdbCmd();
params.remoteChannel = devConf.server.host + QLatin1Char(':')
+ QString::number(gdbServerPort(runConfig));
params.useServerStartScript = true;
params.remoteArchitecture = QLatin1String("arm");
} }
params.processArgs = runConfig->arguments();
params.sysRoot = runConfig->sysRoot();
params.toolChainType = ToolChain::GCC_MAEMO;
params.dumperLibrary = runConfig->dumperLib();
params.remoteDumperLib = uploadDir(devConf).toUtf8() + '/'
+ QFileInfo(runConfig->dumperLib()).fileName().toUtf8();
DebuggerRunControl * const debuggerRunControl DebuggerRunControl * const debuggerRunControl
= DebuggerPlugin::createDebugger(params, runConfig); = DebuggerPlugin::createDebugger(params, runConfig);
new MaemoDebugSupport(runConfig, debuggerRunControl); new MaemoDebugSupport(runConfig, debuggerRunControl);
...@@ -111,9 +112,11 @@ MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig, ...@@ -111,9 +112,11 @@ MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig,
DebuggerRunControl *runControl) DebuggerRunControl *runControl)
: QObject(runControl), m_runControl(runControl), m_runConfig(runConfig), : QObject(runControl), m_runControl(runControl), m_runConfig(runConfig),
m_deviceConfig(m_runConfig->deviceConfig()), m_deviceConfig(m_runConfig->deviceConfig()),
m_runner(new MaemoSshRunner(this, m_runConfig, true)) m_runner(new MaemoSshRunner(this, m_runConfig, true)),
m_qmlOnlyDebugging(m_runConfig->useQmlDebugger() && !m_runConfig->useCppDebugger())
{ {
connect(m_runControl, SIGNAL(gdbAdapterRequestSetup()), this, SLOT(handleAdapterSetupRequested())); connect(m_runControl, SIGNAL(adapterRequestSetup()), this,
SLOT(handleAdapterSetupRequested()));
connect(m_runControl, SIGNAL(finished()), this, connect(m_runControl, SIGNAL(finished()), this,
SLOT(handleDebuggingFinished())); SLOT(handleDebuggingFinished()));
} }
...@@ -154,7 +157,7 @@ void MaemoDebugSupport::startExecution() ...@@ -154,7 +157,7 @@ void MaemoDebugSupport::startExecution()
return; return;
const QString &dumperLib = m_runConfig->dumperLib(); const QString &dumperLib = m_runConfig->dumperLib();
if (!dumperLib.isEmpty() if (!m_qmlOnlyDebugging && !dumperLib.isEmpty()
&& m_runConfig->deployStep()->currentlyNeedsDeployment(m_deviceConfig.server.host, && m_runConfig->deployStep()->currentlyNeedsDeployment(m_deviceConfig.server.host,
MaemoDeployable(dumperLib, uploadDir(m_deviceConfig)))) { MaemoDeployable(dumperLib, uploadDir(m_deviceConfig)))) {
m_uploader = m_runner->connection()->createSftpChannel(); m_uploader = m_runner->connection()->createSftpChannel();
...@@ -232,11 +235,16 @@ void MaemoDebugSupport::startDebugging() ...@@ -232,11 +235,16 @@ void MaemoDebugSupport::startDebugging()
connect(m_runner, SIGNAL(remoteProcessStarted()), this, connect(m_runner, SIGNAL(remoteProcessStarted()), this,
SLOT(handleRemoteProcessStarted())); SLOT(handleRemoteProcessStarted()));
const QString &remoteExe = m_runConfig->remoteExecutableFilePath(); const QString &remoteExe = m_runConfig->remoteExecutableFilePath();
m_runner->startExecution(QString::fromLocal8Bit("%1 %2 gdbserver :%3 %4 %5") const QString cmdPrefix = MaemoGlobal::remoteCommandPrefix(remoteExe);
.arg(MaemoGlobal::remoteCommandPrefix(remoteExe)) const QString env = environment(m_runConfig);
.arg(environment(m_runConfig)).arg(gdbServerPort(m_runConfig)) const QString args = m_runConfig->arguments().join(QLatin1String(" "));
.arg(remoteExe).arg(m_runConfig->arguments() const QString remoteCommandLine = m_qmlOnlyDebugging
.join(QLatin1String(" "))).toUtf8()); ? QString::fromLocal8Bit("%1 %2 %3 %4").arg(cmdPrefix).arg(env)
.arg(remoteExe).arg(args)
: QString::fromLocal8Bit("%1 %2 gdbserver :%3 %4 %5")
.arg(cmdPrefix).arg(env).arg(gdbServerPort(m_runConfig))
.arg(remoteExe).arg(args);
m_runner->startExecution(remoteCommandLine.toUtf8());
} }
} }
...@@ -278,8 +286,7 @@ void MaemoDebugSupport::stopSsh() ...@@ -278,8 +286,7 @@ void MaemoDebugSupport::stopSsh()
void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error) void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error)
{ {
m_runControl->handleRemoteSetupFailed(tr("Initial setup failed: %1").arg(error));
m_runControl->remoteGdbHandleSetupFailed(tr("Initial setup failed: %1").arg(error));
m_stopped = true; m_stopped = true;
stopSsh(); stopSsh();
} }
...@@ -287,7 +294,7 @@ void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error) ...@@ -287,7 +294,7 @@ void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error)
void MaemoDebugSupport::handleAdapterSetupDone() void MaemoDebugSupport::handleAdapterSetupDone()
{ {
m_adapterStarted = true; m_adapterStarted = true;
m_runControl->remoteGdbHandleSetupDone(); m_runControl->handleRemoteSetupDone();
} }
int MaemoDebugSupport::gdbServerPort(const MaemoRunConfiguration *rc) int MaemoDebugSupport::gdbServerPort(const MaemoRunConfiguration *rc)
...@@ -298,7 +305,8 @@ int MaemoDebugSupport::gdbServerPort(const MaemoRunConfiguration *rc) ...@@ -298,7 +305,8 @@ int MaemoDebugSupport::gdbServerPort(const MaemoRunConfiguration *rc)
int MaemoDebugSupport::qmlServerPort(const MaemoRunConfiguration *rc) int MaemoDebugSupport::qmlServerPort(const MaemoRunConfiguration *rc)
{ {
MaemoPortList portList = rc->freePorts(); MaemoPortList portList = rc->freePorts();
portList.getNext(); if (rc->useCppDebugger())
portList.getNext();
return portList.getNext(); return portList.getNext();
} }
...@@ -319,7 +327,8 @@ QString MaemoDebugSupport::uploadDir(const MaemoDeviceConfig &devConf) ...@@ -319,7 +327,8 @@ QString MaemoDebugSupport::uploadDir(const MaemoDeviceConfig &devConf)
bool MaemoDebugSupport::useGdb() const bool MaemoDebugSupport::useGdb() const
{ {
return m_runControl->engine()->startParameters().startMode == StartRemoteGdb; return m_runControl->engine()->startParameters().startMode == StartRemoteGdb
&& !m_qmlOnlyDebugging;
} }
} // namespace Internal } // namespace Internal
......
...@@ -92,10 +92,11 @@ private: ...@@ -92,10 +92,11 @@ private:
void startDebugging(); void startDebugging();
bool useGdb() const; bool useGdb() const;
Debugger::DebuggerRunControl *m_runControl; Debugger::DebuggerRunControl * const m_runControl;
MaemoRunConfiguration * const m_runConfig; MaemoRunConfiguration * const m_runConfig;
const MaemoDeviceConfig m_deviceConfig; const MaemoDeviceConfig m_deviceConfig;
MaemoSshRunner * const m_runner; MaemoSshRunner * const m_runner;
const bool m_qmlOnlyDebugging;
QSharedPointer<Core::SftpChannel> m_uploader; QSharedPointer<Core::SftpChannel> m_uploader;
Core::SftpJobId m_uploadJob; Core::SftpJobId m_uploadJob;
......
...@@ -88,6 +88,8 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent, ...@@ -88,6 +88,8 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
void MaemoRunConfiguration::init() void MaemoRunConfiguration::init()
{ {
setDefaultDisplayName(defaultDisplayName()); setDefaultDisplayName(defaultDisplayName());
setUseCppDebugger(true);
setUseQmlDebugger(false);
m_remoteMounts = new MaemoRemoteMountsModel(this); m_remoteMounts = new MaemoRemoteMountsModel(this);
connect(target(), connect(target(),
......
...@@ -115,6 +115,8 @@ public: ...@@ -115,6 +115,8 @@ public:
ProjectExplorer::Environment systemEnvironment() const; ProjectExplorer::Environment systemEnvironment() const;
void setSystemEnvironment(const ProjectExplorer::Environment &environment); void setSystemEnvironment(const ProjectExplorer::Environment &environment);
int portsUsedByDebuggers() const { return useCppDebugger() + useQmlDebugger(); }
signals: signals:
void deviceConfigurationChanged(ProjectExplorer::Target *target); void deviceConfigurationChanged(ProjectExplorer::Target *target);
void targetInformationChanged() const; void targetInformationChanged() const;
......
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
#include <qt4projectmanager/qt4target.h> #include <qt4projectmanager/qt4target.h>
#include <utils/detailswidget.h> #include <utils/detailswidget.h>
#include <QtGui/QCheckBox>
#include <QtGui/QComboBox> #include <QtGui/QComboBox>
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
#include <QtGui/QFormLayout> #include <QtGui/QFormLayout>
...@@ -123,9 +122,22 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout) ...@@ -123,9 +122,22 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" ")); m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
formLayout->addRow(tr("Arguments:"), m_argsLineEdit); formLayout->addRow(tr("Arguments:"), m_argsLineEdit);
m_qmlCheckBox = new QCheckBox(tr("Also debug QML parts")); QHBoxLayout * const debugButtonsLayout = new QHBoxLayout;
m_qmlCheckBox->setChecked(m_runConfiguration->useQmlDebugger()); m_debugCppOnlyButton = new QRadioButton(tr("C++ only"));
formLayout->addRow(new QLabel(tr("Debugging:")), m_qmlCheckBox); m_debugQmlOnlyButton = new QRadioButton(tr("QML only"));
m_debugCppAndQmlButton = new QRadioButton(tr("C++ and QML"));
debugButtonsLayout->addWidget(m_debugCppOnlyButton);
debugButtonsLayout->addWidget(m_debugQmlOnlyButton);
debugButtonsLayout->addWidget(m_debugCppAndQmlButton);
formLayout->addRow(tr("Debugging type:"), debugButtonsLayout);
if (m_runConfiguration->useCppDebugger()) {
if (m_runConfiguration->useQmlDebugger())
m_debugCppAndQmlButton->setChecked(true);
else
m_debugCppOnlyButton->setChecked(true);
} else {
m_debugQmlOnlyButton->setChecked(true);
}
connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this, connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this,
SLOT(showSettingsDialog(QString))); SLOT(showSettingsDialog(QString)));
...@@ -133,8 +145,12 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout) ...@@ -133,8 +145,12 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
SLOT(showSettingsDialog(QString))); SLOT(showSettingsDialog(QString)));
connect(m_argsLineEdit, SIGNAL(textEdited(QString)), this, connect(m_argsLineEdit, SIGNAL(textEdited(QString)), this,
SLOT(argumentsEdited(QString))); SLOT(argumentsEdited(QString)));
connect(m_qmlCheckBox, SIGNAL(toggled(bool)), this, connect(m_debugCppOnlyButton, SIGNAL(toggled(bool)), this,
SLOT(handleQmlDebuggingChanged(bool))); SLOT(handleDebuggingTypeChanged()));
connect(m_debugQmlOnlyButton, SIGNAL(toggled(bool)), this,
SLOT(handleDebuggingTypeChanged()));
connect(m_debugCppAndQmlButton, SIGNAL(toggled(bool)), this,
SLOT(handleDebuggingTypeChanged()));
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this, connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
SLOT(updateTargetInformation())); SLOT(updateTargetInformation()));
connect(m_runConfiguration->deployStep()->deployables(), connect(m_runConfiguration->deployStep()->deployables(),
...@@ -432,9 +448,12 @@ void MaemoRunConfigurationWidget::handleRemoteMountsChanged() ...@@ -432,9 +448,12 @@ void MaemoRunConfigurationWidget::handleRemoteMountsChanged()
updateMountWarning(); updateMountWarning();
} }
void MaemoRunConfigurationWidget::handleQmlDebuggingChanged(bool debugQml) void MaemoRunConfigurationWidget::handleDebuggingTypeChanged()
{ {
m_runConfiguration->setUseQmlDebugger(debugQml); m_runConfiguration->setUseCppDebugger(m_debugCppOnlyButton->isChecked()
|| m_debugCppAndQmlButton->isChecked());
m_runConfiguration->setUseQmlDebugger(m_debugQmlOnlyButton->isChecked()
|| m_debugCppAndQmlButton->isChecked());
updateMountWarning(); updateMountWarning();
} }
...@@ -452,8 +471,8 @@ void MaemoRunConfigurationWidget::updateMountWarning() ...@@ -452,8 +471,8 @@ void MaemoRunConfigurationWidget::updateMountWarning()
"to run this configuration.", 0, availablePortCount) "to run this configuration.", 0, availablePortCount)
.arg(mountDirCount); .arg(mountDirCount);
} else if (mountDirCount > 0) { } else if (mountDirCount > 0) {
const int portsLeftByDebuggers const int portsLeftByDebuggers = availablePortCount
= availablePortCount - 1 - m_runConfiguration->useQmlDebugger(); - m_runConfiguration->portsUsedByDebuggers();
if (mountDirCount > portsLeftByDebuggers) { if (mountDirCount > portsLeftByDebuggers) {
mountWarning = tr("WARNING: You want to mount %1 directories, " mountWarning = tr("WARNING: You want to mount %1 directories, "
"but only %n ports on the device will be available " "but only %n ports on the device will be available "
......
...@@ -38,12 +38,12 @@ ...@@ -38,12 +38,12 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QCheckBox;
class QComboBox; class QComboBox;
class QLabel; class QLabel;
class QLineEdit; class QLineEdit;