Maemo: QML debugging is not possible on Fremantle ...

... so disable the respective widgets if the active build
configuration has a Fremantle toolchain.

Reviewed-by: kh1
This commit is contained in:
Christian Kandeler
2010-10-06 16:26:19 +02:00
parent 26808a4beb
commit 803206d5b5
7 changed files with 49 additions and 9 deletions

View File

@@ -63,11 +63,13 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
DebuggerStartParameters params; DebuggerStartParameters params;
const MaemoDeviceConfig &devConf = runConfig->deviceConfig(); const MaemoDeviceConfig &devConf = runConfig->deviceConfig();
if (runConfig->useQmlDebugger()) { const MaemoRunConfiguration::DebuggingType debuggingType
= runConfig->debuggingType();
if (debuggingType != MaemoRunConfiguration::DebugCppOnly) {
params.qmlServerAddress = runConfig->deviceConfig().server.host; params.qmlServerAddress = runConfig->deviceConfig().server.host;
params.qmlServerPort = qmlServerPort(runConfig); params.qmlServerPort = qmlServerPort(runConfig);
} }
if (runConfig->useCppDebugger()) { if (debuggingType != MaemoRunConfiguration::DebugQmlOnly) {
params.processArgs = runConfig->arguments(); params.processArgs = runConfig->arguments();
params.sysRoot = runConfig->sysRoot(); params.sysRoot = runConfig->sysRoot();
params.toolChainType = ToolChain::GCC_MAEMO; params.toolChainType = ToolChain::GCC_MAEMO;
@@ -113,7 +115,7 @@ MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig,
: 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()) m_qmlOnlyDebugging(m_runConfig->debuggingType() == MaemoRunConfiguration::DebugQmlOnly)
{ {
connect(m_runControl, SIGNAL(engineRequestSetup()), this, connect(m_runControl, SIGNAL(engineRequestSetup()), this,
SLOT(handleAdapterSetupRequested())); SLOT(handleAdapterSetupRequested()));
@@ -305,7 +307,7 @@ 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();
if (rc->useCppDebugger()) if (rc->debuggingType() != MaemoRunConfiguration::DebugQmlOnly)
portList.getNext(); portList.getNext();
return portList.getNext(); return portList.getNext();
} }
@@ -314,7 +316,7 @@ QString MaemoDebugSupport::environment(const MaemoRunConfiguration *rc)
{ {
QList<Utils::EnvironmentItem> env = rc->userEnvironmentChanges(); QList<Utils::EnvironmentItem> env = rc->userEnvironmentChanges();
// FIXME: this must use command line argument instead: -qmljsdebugger=port:1234. // FIXME: this must use command line argument instead: -qmljsdebugger=port:1234.
if (rc->useQmlDebugger()) { if (rc->debuggingType() != MaemoRunConfiguration::DebugCppOnly) {
// env << Utils::EnvironmentItem(QLatin1String(Debugger::Constants::E_QML_DEBUG_SERVER_PORT), // env << Utils::EnvironmentItem(QLatin1String(Debugger::Constants::E_QML_DEBUG_SERVER_PORT),
// QString::number(qmlServerPort(rc))); // QString::number(qmlServerPort(rc)));
} }

View File

@@ -304,6 +304,30 @@ void MaemoRunConfiguration::setArguments(const QStringList &args)
m_arguments = args; m_arguments = args;
} }
MaemoRunConfiguration::DebuggingType MaemoRunConfiguration::debuggingType() const
{
if (!toolchain() || !toolchain()->allowsQmlDebugging())
return DebugCppOnly;
if (useCppDebugger()) {
if (useQmlDebugger())
return DebugCppAndQml;
return DebugCppOnly;
}
return DebugQmlOnly;
}
int MaemoRunConfiguration::portsUsedByDebuggers() const
{
switch (debuggingType()) {
case DebugCppOnly:
case DebugQmlOnly:
return 1;
case DebugCppAndQml:
default:
return 2;
}
}
void MaemoRunConfiguration::updateDeviceConfigurations() void MaemoRunConfiguration::updateDeviceConfigurations()
{ {
emit deviceConfigurationChanged(target()); emit deviceConfigurationChanged(target());

View File

@@ -71,6 +71,8 @@ public:
SystemEnvironmentBase = 1 SystemEnvironmentBase = 1
}; };
enum DebuggingType { DebugCppOnly, DebugQmlOnly, DebugCppAndQml };
MaemoRunConfiguration(Qt4Target *parent, const QString &proFilePath); MaemoRunConfiguration(Qt4Target *parent, const QString &proFilePath);
virtual ~MaemoRunConfiguration(); virtual ~MaemoRunConfiguration();
@@ -96,6 +98,7 @@ public:
bool useRemoteGdb() const; bool useRemoteGdb() const;
void setUseRemoteGdb(bool useRemoteGdb) { m_useRemoteGdb = useRemoteGdb; } void setUseRemoteGdb(bool useRemoteGdb) { m_useRemoteGdb = useRemoteGdb; }
void updateFactoryState() { emit isEnabledChanged(true); } void updateFactoryState() { emit isEnabledChanged(true); }
DebuggingType debuggingType() const;
const QString gdbCmd() const; const QString gdbCmd() const;
const QString dumperLib() const; const QString dumperLib() const;
@@ -116,7 +119,7 @@ public:
Utils::Environment systemEnvironment() const; Utils::Environment systemEnvironment() const;
void setSystemEnvironment(const Utils::Environment &environment); void setSystemEnvironment(const Utils::Environment &environment);
int portsUsedByDebuggers() const { return useCppDebugger() + useQmlDebugger(); } int portsUsedByDebuggers() const;
signals: signals:
void deviceConfigurationChanged(ProjectExplorer::Target *target); void deviceConfigurationChanged(ProjectExplorer::Target *target);

View File

@@ -126,10 +126,11 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
m_debugCppOnlyButton = new QRadioButton(tr("C++ only")); m_debugCppOnlyButton = new QRadioButton(tr("C++ only"));
m_debugQmlOnlyButton = new QRadioButton(tr("QML only")); m_debugQmlOnlyButton = new QRadioButton(tr("QML only"));
m_debugCppAndQmlButton = new QRadioButton(tr("C++ and QML")); m_debugCppAndQmlButton = new QRadioButton(tr("C++ and QML"));
m_debuggingLanguagesLabel = new QLabel(tr("Debugging type:"));
debugButtonsLayout->addWidget(m_debugCppOnlyButton); debugButtonsLayout->addWidget(m_debugCppOnlyButton);
debugButtonsLayout->addWidget(m_debugQmlOnlyButton); debugButtonsLayout->addWidget(m_debugQmlOnlyButton);
debugButtonsLayout->addWidget(m_debugCppAndQmlButton); debugButtonsLayout->addWidget(m_debugCppAndQmlButton);
formLayout->addRow(tr("Debugging type:"), debugButtonsLayout); formLayout->addRow(m_debuggingLanguagesLabel, debugButtonsLayout);
if (m_runConfiguration->useCppDebugger()) { if (m_runConfiguration->useCppDebugger()) {
if (m_runConfiguration->useQmlDebugger()) if (m_runConfiguration->useQmlDebugger())
m_debugCppAndQmlButton->setChecked(true); m_debugCppAndQmlButton->setChecked(true);
@@ -304,6 +305,11 @@ void MaemoRunConfigurationWidget::handleToolchainChanged()
const bool remoteMountsAvailable = toolChain->allowsRemoteMounts(); const bool remoteMountsAvailable = toolChain->allowsRemoteMounts();
m_debugDetailsContainer->setVisible(remoteMountsAvailable); m_debugDetailsContainer->setVisible(remoteMountsAvailable);
m_mountDetailsContainer->setVisible(remoteMountsAvailable); m_mountDetailsContainer->setVisible(remoteMountsAvailable);
const bool qmlDebuggingAvailable = toolChain->allowsQmlDebugging();
m_debuggingLanguagesLabel->setVisible(qmlDebuggingAvailable);
m_debugCppOnlyButton->setVisible(qmlDebuggingAvailable);
m_debugQmlOnlyButton->setVisible(qmlDebuggingAvailable);
m_debugCppAndQmlButton->setVisible(qmlDebuggingAvailable);
} }
m_runConfiguration->updateFactoryState(); m_runConfiguration->updateFactoryState();
} }

View File

@@ -107,6 +107,7 @@ private:
QLabel *m_localExecutableLabel; QLabel *m_localExecutableLabel;
QLabel *m_remoteExecutableLabel; QLabel *m_remoteExecutableLabel;
QLabel *m_devConfLabel; QLabel *m_devConfLabel;
QLabel *m_debuggingLanguagesLabel;
QRadioButton *m_debugCppOnlyButton; QRadioButton *m_debugCppOnlyButton;
QRadioButton *m_debugQmlOnlyButton; QRadioButton *m_debugQmlOnlyButton;
QRadioButton *m_debugCppAndQmlButton; QRadioButton *m_debugCppAndQmlButton;

View File

@@ -193,9 +193,12 @@ void MaemoSshRunner::handleUnmounted()
m_mounter->resetMountSpecifications(); m_mounter->resetMountSpecifications();
MaemoPortList portList = m_devConfig.freePorts(); MaemoPortList portList = m_devConfig.freePorts();
if (m_debugging) { // gdbserver and QML inspector need one port each. if (m_debugging) { // gdbserver and QML inspector need one port each.
if (m_runConfig->useCppDebugger() && !m_runConfig->useRemoteGdb()) MaemoRunConfiguration::DebuggingType debuggingType
= m_runConfig->debuggingType();
if (debuggingType != MaemoRunConfiguration::DebugQmlOnly
&& !m_runConfig->useRemoteGdb())
portList.getNext(); portList.getNext();
if (m_runConfig->useQmlDebugger()) if (debuggingType != MaemoRunConfiguration::DebugCppOnly)
portList.getNext(); portList.getNext();
} }
m_mounter->setToolchain(m_runConfig->toolchain()); m_mounter->setToolchain(m_runConfig->toolchain());

View File

@@ -56,6 +56,7 @@ public:
MaemoVersion version() const; MaemoVersion version() const;
bool allowsRemoteMounts() const { return version() == Maemo5; } bool allowsRemoteMounts() const { return version() == Maemo5; }
bool allowsPackagingDisabling() const { return version() == Maemo5; } bool allowsPackagingDisabling() const { return version() == Maemo5; }
bool allowsQmlDebugging() const { return version() == Maemo6; }
protected: protected:
bool equals(const ToolChain *other) const; bool equals(const ToolChain *other) const;