Maemo: Remove C++ dumper support.

They haven't been maintained for a while now, so no need to
try to support them.
This commit is contained in:
Christian Kandeler
2011-04-21 14:03:38 +02:00
parent 8f921b954d
commit ed5216560f
4 changed files with 35 additions and 153 deletions

View File

@@ -38,7 +38,6 @@
#include "maemousedportsgatherer.h" #include "maemousedportsgatherer.h"
#include "qt4maemotarget.h" #include "qt4maemotarget.h"
#include <utils/ssh/sftpchannel.h>
#include <debugger/debuggerplugin.h> #include <debugger/debuggerplugin.h>
#include <debugger/debuggerstartparameters.h> #include <debugger/debuggerstartparameters.h>
#include <debugger/debuggerrunner.h> #include <debugger/debuggerrunner.h>
@@ -72,9 +71,6 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
params.processArgs = runConfig->arguments(); params.processArgs = runConfig->arguments();
params.sysRoot = runConfig->sysRoot(); params.sysRoot = runConfig->sysRoot();
params.toolChainAbi = runConfig->abi(); params.toolChainAbi = runConfig->abi();
params.dumperLibrary = runConfig->dumperLib();
params.remoteDumperLib = uploadDir(devConf).toUtf8() + '/'
+ QFileInfo(runConfig->dumperLib()).fileName().toUtf8();
if (runConfig->useRemoteGdb()) { if (runConfig->useRemoteGdb()) {
params.startMode = StartRemoteGdb; params.startMode = StartRemoteGdb;
params.executable = runConfig->remoteExecutableFilePath(); params.executable = runConfig->remoteExecutableFilePath();
@@ -127,7 +123,6 @@ MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig,
m_deviceConfig(m_runConfig->deviceConfig()), m_deviceConfig(m_runConfig->deviceConfig()),
m_runner(new MaemoSshRunner(this, runConfig, true)), m_runner(new MaemoSshRunner(this, runConfig, true)),
m_debuggingType(runConfig->debuggingType()), m_debuggingType(runConfig->debuggingType()),
m_dumperLib(runConfig->dumperLib()),
m_userEnvChanges(runConfig->userEnvironmentChanges()), m_userEnvChanges(runConfig->userEnvironmentChanges()),
m_state(Inactive), m_gdbServerPort(-1), m_qmlPort(-1), m_state(Inactive), m_gdbServerPort(-1), m_qmlPort(-1),
m_useGdb(useGdb) m_useGdb(useGdb)
@@ -152,7 +147,7 @@ void MaemoDebugSupport::handleAdapterSetupRequested()
ASSERT_STATE(Inactive); ASSERT_STATE(Inactive);
setState(StartingRunner); setState(StartingRunner);
showMessage(tr("Preparing remote side ..."), AppStuff); showMessage(tr("Preparing remote side ...\n"), AppStuff);
disconnect(m_runner, 0, this, 0); disconnect(m_runner, 0, this, 0);
connect(m_runner, SIGNAL(error(QString)), this, connect(m_runner, SIGNAL(error(QString)), this,
SLOT(handleSshError(QString))); SLOT(handleSshError(QString)));
@@ -190,91 +185,11 @@ void MaemoDebugSupport::startExecution()
return; return;
} }
if (m_debuggingType != MaemoRunConfiguration::DebugQmlOnly
&& !m_dumperLib.isEmpty()
&& m_runConfig
&& m_runConfig->deployStep()->currentlyNeedsDeployment(m_deviceConfig->sshParameters().host,
MaemoDeployable(m_dumperLib, uploadDir(m_deviceConfig)))) {
setState(InitializingUploader);
m_uploader = m_runner->connection()->createSftpChannel();
connect(m_uploader.data(), SIGNAL(initialized()), this,
SLOT(handleSftpChannelInitialized()));
connect(m_uploader.data(), SIGNAL(initializationFailed(QString)), this,
SLOT(handleSftpChannelInitializationFailed(QString)));
connect(m_uploader.data(), SIGNAL(finished(Utils::SftpJobId, QString)),
this, SLOT(handleSftpJobFinished(Utils::SftpJobId, QString)));
m_uploader->initialize();
} else {
setState(DumpersUploaded);
startDebugging();
}
}
void MaemoDebugSupport::handleSftpChannelInitialized()
{
if (m_state == Inactive)
return;
ASSERT_STATE(InitializingUploader);
const QString fileName = QFileInfo(m_dumperLib).fileName();
const QString remoteFilePath = uploadDir(m_deviceConfig)
+ QLatin1Char('/') + fileName;
m_uploadJob = m_uploader->uploadFile(m_dumperLib, remoteFilePath,
SftpOverwriteExisting);
if (m_uploadJob == SftpInvalidJob) {
handleAdapterSetupFailed(tr("Upload failed: Could not open file '%1'")
.arg(m_dumperLib));
} else {
setState(UploadingDumpers);
showMessage(tr("Started uploading debugging helpers ('%1').")
.arg(m_dumperLib), AppStuff);
}
}
void MaemoDebugSupport::handleSftpChannelInitializationFailed(const QString &error)
{
if (m_state == Inactive)
return;
ASSERT_STATE(InitializingUploader);
handleAdapterSetupFailed(error);
}
void MaemoDebugSupport::handleSftpJobFinished(Utils::SftpJobId job,
const QString &error)
{
if (m_state == Inactive)
return;
ASSERT_STATE(UploadingDumpers);
if (job != m_uploadJob) {
qWarning("Warning: Unknown debugging helpers upload job %d finished.", job);
return;
}
if (!error.isEmpty()) {
handleAdapterSetupFailed(tr("Could not upload debugging helpers: %1.")
.arg(error));
} else {
setState(DumpersUploaded);
if (m_runConfig) {
m_runConfig->deployStep()->setDeployed(m_deviceConfig->sshParameters().host,
MaemoDeployable(m_dumperLib, uploadDir(m_deviceConfig)));
}
showMessage(tr("Finished uploading debugging helpers."), AppStuff);
startDebugging();
}
m_uploadJob = SftpInvalidJob;
}
void MaemoDebugSupport::startDebugging()
{
ASSERT_STATE(DumpersUploaded);
if (useGdb()) { if (useGdb()) {
handleAdapterSetupDone(); handleAdapterSetupDone();
} else { return;
}
setState(StartingRemoteProcess); setState(StartingRemoteProcess);
m_gdbserverOutput.clear(); m_gdbserverOutput.clear();
connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)), this, connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)), this,
@@ -304,7 +219,6 @@ void MaemoDebugSupport::startDebugging()
connect(m_runner, SIGNAL(remoteProcessFinished(qint64)), connect(m_runner, SIGNAL(remoteProcessFinished(qint64)),
SLOT(handleRemoteProcessFinished(qint64))); SLOT(handleRemoteProcessFinished(qint64)));
m_runner->startExecution(remoteCommandLine.toUtf8()); m_runner->startExecution(remoteCommandLine.toUtf8());
}
} }
void MaemoDebugSupport::handleRemoteProcessFinished(qint64 exitCode) void MaemoDebugSupport::handleRemoteProcessFinished(qint64 exitCode)
@@ -381,18 +295,8 @@ void MaemoDebugSupport::setState(State newState)
if (m_state == newState) if (m_state == newState)
return; return;
m_state = newState; m_state = newState;
if (m_state == Inactive) { if (m_state == Inactive)
if (m_uploader) {
disconnect(m_uploader.data(), 0, this, 0);
m_uploader->closeChannel();
}
m_runner->stop(); m_runner->stop();
}
}
QString MaemoDebugSupport::uploadDir(const MaemoDeviceConfig::ConstPtr &devConf)
{
return MaemoGlobal::homeDirOnDevice(devConf->sshParameters().userName);
} }
bool MaemoDebugSupport::useGdb() const bool MaemoDebugSupport::useGdb() const

View File

@@ -34,19 +34,15 @@
#include "maemorunconfiguration.h" #include "maemorunconfiguration.h"
#include <utils/ssh/sftpdefs.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QPointer> #include <QtCore/QPointer>
#include <QtCore/QSharedPointer> #include <QtCore/QSharedPointer>
namespace Core { class SftpChannel; }
namespace Debugger { namespace Debugger {
class DebuggerEngine; class DebuggerEngine;
} }
namespace ProjectExplorer { class RunControl; } namespace ProjectExplorer { class RunControl; }
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
@@ -66,15 +62,10 @@ public:
Debugger::DebuggerEngine *engine, bool useGdb); Debugger::DebuggerEngine *engine, bool useGdb);
~MaemoDebugSupport(); ~MaemoDebugSupport();
static QString uploadDir(const QSharedPointer<const MaemoDeviceConfig> &devConf);
private slots: private slots:
void handleAdapterSetupRequested(); void handleAdapterSetupRequested();
void handleSshError(const QString &error); void handleSshError(const QString &error);
void startExecution(); void startExecution();
void handleSftpChannelInitialized();
void handleSftpChannelInitializationFailed(const QString &error);
void handleSftpJobFinished(Utils::SftpJobId job, const QString &error);
void handleDebuggingFinished(); void handleDebuggingFinished();
void handleRemoteOutput(const QByteArray &output); void handleRemoteOutput(const QByteArray &output);
void handleRemoteErrorOutput(const QByteArray &output); void handleRemoteErrorOutput(const QByteArray &output);
@@ -84,28 +75,23 @@ private slots:
private: private:
enum State { enum State {
Inactive, StartingRunner, InitializingUploader, UploadingDumpers, Inactive, StartingRunner, StartingRemoteProcess, Debugging
DumpersUploaded, StartingRemoteProcess, Debugging
}; };
void handleAdapterSetupFailed(const QString &error); void handleAdapterSetupFailed(const QString &error);
void handleAdapterSetupDone(); void handleAdapterSetupDone();
void startDebugging();
bool useGdb() const; bool useGdb() const;
void setState(State newState); void setState(State newState);
bool setPort(int &port); bool setPort(int &port);
void showMessage(const QString &msg, int channel); void showMessage(const QString &msg, int channel);
const QPointer<Debugger::DebuggerEngine> m_engine; const QPointer<Debugger::DebuggerEngine> m_engine;
const QPointer<MaemoRunConfiguration> m_runConfig; const QPointer<MaemoRunConfiguration> m_runConfig;
const QSharedPointer<const MaemoDeviceConfig> m_deviceConfig; const QSharedPointer<const MaemoDeviceConfig> m_deviceConfig;
MaemoSshRunner * const m_runner; MaemoSshRunner * const m_runner;
const MaemoRunConfiguration::DebuggingType m_debuggingType; const MaemoRunConfiguration::DebuggingType m_debuggingType;
const QString m_dumperLib;
const QList<Utils::EnvironmentItem> m_userEnvChanges; const QList<Utils::EnvironmentItem> m_userEnvChanges;
QSharedPointer<Utils::SftpChannel> m_uploader;
Utils::SftpJobId m_uploadJob;
QByteArray m_gdbserverOutput; QByteArray m_gdbserverOutput;
State m_state; State m_state;
int m_gdbServerPort; int m_gdbServerPort;

View File

@@ -259,13 +259,6 @@ const QString MaemoRunConfiguration::arguments() const
return m_arguments; return m_arguments;
} }
const QString MaemoRunConfiguration::dumperLib() const
{
Qt4BuildConfiguration *qt4bc(activeQt4BuildConfiguration());
return qt4bc->qtVersion()->gdbDebuggingHelperLibrary();
}
QString MaemoRunConfiguration::localDirToMountForRemoteGdb() const QString MaemoRunConfiguration::localDirToMountForRemoteGdb() const
{ {
const QString projectDir const QString projectDir

View File

@@ -107,7 +107,6 @@ public:
DebuggingType debuggingType() const; DebuggingType debuggingType() const;
const QString gdbCmd() const; const QString gdbCmd() const;
const QString dumperLib() const;
QString localDirToMountForRemoteGdb() const; QString localDirToMountForRemoteGdb() const;
QString remoteProjectSourcesMountPoint() const; QString remoteProjectSourcesMountPoint() const;