forked from qt-creator/qt-creator
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:
@@ -63,11 +63,13 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
|
||||
DebuggerStartParameters params;
|
||||
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.qmlServerPort = qmlServerPort(runConfig);
|
||||
}
|
||||
if (runConfig->useCppDebugger()) {
|
||||
if (debuggingType != MaemoRunConfiguration::DebugQmlOnly) {
|
||||
params.processArgs = runConfig->arguments();
|
||||
params.sysRoot = runConfig->sysRoot();
|
||||
params.toolChainType = ToolChain::GCC_MAEMO;
|
||||
@@ -113,7 +115,7 @@ MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig,
|
||||
: QObject(runControl), m_runControl(runControl), m_runConfig(runConfig),
|
||||
m_deviceConfig(m_runConfig->deviceConfig()),
|
||||
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,
|
||||
SLOT(handleAdapterSetupRequested()));
|
||||
@@ -305,7 +307,7 @@ int MaemoDebugSupport::gdbServerPort(const MaemoRunConfiguration *rc)
|
||||
int MaemoDebugSupport::qmlServerPort(const MaemoRunConfiguration *rc)
|
||||
{
|
||||
MaemoPortList portList = rc->freePorts();
|
||||
if (rc->useCppDebugger())
|
||||
if (rc->debuggingType() != MaemoRunConfiguration::DebugQmlOnly)
|
||||
portList.getNext();
|
||||
return portList.getNext();
|
||||
}
|
||||
@@ -314,7 +316,7 @@ QString MaemoDebugSupport::environment(const MaemoRunConfiguration *rc)
|
||||
{
|
||||
QList<Utils::EnvironmentItem> env = rc->userEnvironmentChanges();
|
||||
// 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),
|
||||
// QString::number(qmlServerPort(rc)));
|
||||
}
|
||||
|
||||
@@ -304,6 +304,30 @@ void MaemoRunConfiguration::setArguments(const QStringList &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()
|
||||
{
|
||||
emit deviceConfigurationChanged(target());
|
||||
|
||||
@@ -71,6 +71,8 @@ public:
|
||||
SystemEnvironmentBase = 1
|
||||
};
|
||||
|
||||
enum DebuggingType { DebugCppOnly, DebugQmlOnly, DebugCppAndQml };
|
||||
|
||||
MaemoRunConfiguration(Qt4Target *parent, const QString &proFilePath);
|
||||
virtual ~MaemoRunConfiguration();
|
||||
|
||||
@@ -96,6 +98,7 @@ public:
|
||||
bool useRemoteGdb() const;
|
||||
void setUseRemoteGdb(bool useRemoteGdb) { m_useRemoteGdb = useRemoteGdb; }
|
||||
void updateFactoryState() { emit isEnabledChanged(true); }
|
||||
DebuggingType debuggingType() const;
|
||||
|
||||
const QString gdbCmd() const;
|
||||
const QString dumperLib() const;
|
||||
@@ -116,7 +119,7 @@ public:
|
||||
Utils::Environment systemEnvironment() const;
|
||||
void setSystemEnvironment(const Utils::Environment &environment);
|
||||
|
||||
int portsUsedByDebuggers() const { return useCppDebugger() + useQmlDebugger(); }
|
||||
int portsUsedByDebuggers() const;
|
||||
|
||||
signals:
|
||||
void deviceConfigurationChanged(ProjectExplorer::Target *target);
|
||||
|
||||
@@ -126,10 +126,11 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
||||
m_debugCppOnlyButton = new QRadioButton(tr("C++ only"));
|
||||
m_debugQmlOnlyButton = new QRadioButton(tr("QML only"));
|
||||
m_debugCppAndQmlButton = new QRadioButton(tr("C++ and QML"));
|
||||
m_debuggingLanguagesLabel = new QLabel(tr("Debugging type:"));
|
||||
debugButtonsLayout->addWidget(m_debugCppOnlyButton);
|
||||
debugButtonsLayout->addWidget(m_debugQmlOnlyButton);
|
||||
debugButtonsLayout->addWidget(m_debugCppAndQmlButton);
|
||||
formLayout->addRow(tr("Debugging type:"), debugButtonsLayout);
|
||||
formLayout->addRow(m_debuggingLanguagesLabel, debugButtonsLayout);
|
||||
if (m_runConfiguration->useCppDebugger()) {
|
||||
if (m_runConfiguration->useQmlDebugger())
|
||||
m_debugCppAndQmlButton->setChecked(true);
|
||||
@@ -304,6 +305,11 @@ void MaemoRunConfigurationWidget::handleToolchainChanged()
|
||||
const bool remoteMountsAvailable = toolChain->allowsRemoteMounts();
|
||||
m_debugDetailsContainer->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();
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ private:
|
||||
QLabel *m_localExecutableLabel;
|
||||
QLabel *m_remoteExecutableLabel;
|
||||
QLabel *m_devConfLabel;
|
||||
QLabel *m_debuggingLanguagesLabel;
|
||||
QRadioButton *m_debugCppOnlyButton;
|
||||
QRadioButton *m_debugQmlOnlyButton;
|
||||
QRadioButton *m_debugCppAndQmlButton;
|
||||
|
||||
@@ -193,9 +193,12 @@ void MaemoSshRunner::handleUnmounted()
|
||||
m_mounter->resetMountSpecifications();
|
||||
MaemoPortList portList = m_devConfig.freePorts();
|
||||
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();
|
||||
if (m_runConfig->useQmlDebugger())
|
||||
if (debuggingType != MaemoRunConfiguration::DebugCppOnly)
|
||||
portList.getNext();
|
||||
}
|
||||
m_mounter->setToolchain(m_runConfig->toolchain());
|
||||
|
||||
@@ -56,6 +56,7 @@ public:
|
||||
MaemoVersion version() const;
|
||||
bool allowsRemoteMounts() const { return version() == Maemo5; }
|
||||
bool allowsPackagingDisabling() const { return version() == Maemo5; }
|
||||
bool allowsQmlDebugging() const { return version() == Maemo6; }
|
||||
|
||||
protected:
|
||||
bool equals(const ToolChain *other) const;
|
||||
|
||||
Reference in New Issue
Block a user