From 85d6f4bd61a1d9cc394a5d3de26c0bc5c427e373 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 10 Jan 2011 17:22:27 +0100 Subject: [PATCH] Maemo: Switch to command-line based QML debugging parameters. Used to be an environment variable. --- .../qt-maemo/maemodebugsupport.cpp | 23 ++++++++-------------- .../qt4projectmanager/qt-maemo/maemodebugsupport.h | 4 +--- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp index 014bf49dfc..c3cb89506d 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp @@ -83,7 +83,7 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC params.executable = runConfig->remoteExecutableFilePath(); params.debuggerCommand = MaemoGlobal::remoteCommandPrefix(runConfig->remoteExecutableFilePath()) - + environment(debuggingType, runConfig->userEnvironmentChanges()) + + MaemoGlobal::remoteEnvironment(runConfig->userEnvironmentChanges()) + QLatin1String(" /usr/bin/gdb"); params.connParams = devConf.server; params.localMountDir = runConfig->localDirToMountForRemoteGdb(); @@ -125,6 +125,7 @@ MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig, m_runner(new MaemoSshRunner(this, runConfig, true)), m_debuggingType(runConfig->debuggingType()), m_dumperLib(runConfig->dumperLib()), + m_userEnvChanges(runConfig->userEnvironmentChanges()), m_state(Inactive), m_gdbServerPort(-1), m_qmlPort(-1), m_useGdb(useGdb) { @@ -278,9 +279,12 @@ void MaemoDebugSupport::startDebugging() SLOT(handleRemoteOutput(QByteArray))); const QString &remoteExe = m_runner->remoteExecutable(); const QString cmdPrefix = MaemoGlobal::remoteCommandPrefix(remoteExe); - const QString env - = environment(m_debuggingType, m_runner->userEnvChanges()); - const QString args = m_runner->arguments(); + const QString env = MaemoGlobal::remoteEnvironment(m_userEnvChanges); + QString args = m_runner->arguments(); + if (m_debuggingType != MaemoRunConfiguration::DebugCppOnly) { + args += QString(QLatin1String(" -qmljsdebugger=port:%1,block")) + .arg(m_qmlPort); + } const QString remoteCommandLine = m_debuggingType == MaemoRunConfiguration::DebugQmlOnly ? QString::fromLocal8Bit("%1 %2 %3 %4").arg(cmdPrefix).arg(env) @@ -352,17 +356,6 @@ void MaemoDebugSupport::setState(State newState) } } -QString MaemoDebugSupport::environment(MaemoRunConfiguration::DebuggingType debuggingType, - const QList &userEnvChanges) -{ - // FIXME: this must use command line argument instead: -qmljsdebugger=port:1234. - if (debuggingType != MaemoRunConfiguration::DebugCppOnly) { -// env << Utils::EnvironmentItem(QLatin1String(Debugger::Constants::E_QML_DEBUG_SERVER_PORT), -// QString::number(qmlServerPort(rc))); - } - return MaemoGlobal::remoteEnvironment(userEnvChanges); -} - QString MaemoDebugSupport::uploadDir(const MaemoDeviceConfig &devConf) { return MaemoGlobal::homeDirOnDevice(devConf.server.uname); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.h b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.h index 4e72040027..9e0a85e333 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.h @@ -88,9 +88,6 @@ private: DumpersUploaded, StartingRemoteProcess, Debugging }; - static QString environment(MaemoRunConfiguration::DebuggingType debuggingType, - const QList &userEnvChanges); - void handleAdapterSetupFailed(const QString &error); void handleAdapterSetupDone(); void startDebugging(); @@ -104,6 +101,7 @@ private: MaemoSshRunner * const m_runner; const MaemoRunConfiguration::DebuggingType m_debuggingType; const QString m_dumperLib; + const QList m_userEnvChanges; QSharedPointer m_uploader; Core::SftpJobId m_uploadJob; -- 2.11.0