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 "qt4maemotarget.h"
#include <utils/ssh/sftpchannel.h>
#include <debugger/debuggerplugin.h>
#include <debugger/debuggerstartparameters.h>
#include <debugger/debuggerrunner.h>
@@ -72,9 +71,6 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
params.processArgs = runConfig->arguments();
params.sysRoot = runConfig->sysRoot();
params.toolChainAbi = runConfig->abi();
params.dumperLibrary = runConfig->dumperLib();
params.remoteDumperLib = uploadDir(devConf).toUtf8() + '/'
+ QFileInfo(runConfig->dumperLib()).fileName().toUtf8();
if (runConfig->useRemoteGdb()) {
params.startMode = StartRemoteGdb;
params.executable = runConfig->remoteExecutableFilePath();
@@ -127,7 +123,6 @@ MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig,
m_deviceConfig(m_runConfig->deviceConfig()),
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)
@@ -152,7 +147,7 @@ void MaemoDebugSupport::handleAdapterSetupRequested()
ASSERT_STATE(Inactive);
setState(StartingRunner);
showMessage(tr("Preparing remote side ..."), AppStuff);
showMessage(tr("Preparing remote side ...\n"), AppStuff);
disconnect(m_runner, 0, this, 0);
connect(m_runner, SIGNAL(error(QString)), this,
SLOT(handleSshError(QString)));
@@ -190,91 +185,11 @@ void MaemoDebugSupport::startExecution()
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()) {
handleAdapterSetupDone();
} else {
return;
}
setState(StartingRemoteProcess);
m_gdbserverOutput.clear();
connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)), this,
@@ -305,7 +220,6 @@ void MaemoDebugSupport::startDebugging()
SLOT(handleRemoteProcessFinished(qint64)));
m_runner->startExecution(remoteCommandLine.toUtf8());
}
}
void MaemoDebugSupport::handleRemoteProcessFinished(qint64 exitCode)
{
@@ -381,19 +295,9 @@ void MaemoDebugSupport::setState(State newState)
if (m_state == newState)
return;
m_state = newState;
if (m_state == Inactive) {
if (m_uploader) {
disconnect(m_uploader.data(), 0, this, 0);
m_uploader->closeChannel();
}
if (m_state == Inactive)
m_runner->stop();
}
}
QString MaemoDebugSupport::uploadDir(const MaemoDeviceConfig::ConstPtr &devConf)
{
return MaemoGlobal::homeDirOnDevice(devConf->sshParameters().userName);
}
bool MaemoDebugSupport::useGdb() const
{

View File

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

View File

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

View File

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