forked from qt-creator/qt-creator
Maemo: Complete support for debugging via remote gdb.
1) Make sources available on device. 2) Enable users to switch between gdb and gdbserver approach (users may not be able to use the former if they have no control over their firewall). Reviewed-by: kh1
This commit is contained in:
@@ -75,20 +75,23 @@ public:
|
|||||||
bool useTerminal;
|
bool useTerminal;
|
||||||
bool breakAtMain;
|
bool breakAtMain;
|
||||||
QString crashParameter; // for AttachCrashedExternal
|
QString crashParameter; // for AttachCrashedExternal
|
||||||
|
|
||||||
// for remote debugging
|
// for remote debugging
|
||||||
QString remoteChannel;
|
QString remoteChannel;
|
||||||
QString remoteArchitecture;
|
QString remoteArchitecture;
|
||||||
QString symbolFileName;
|
QString symbolFileName;
|
||||||
QString serverStartScript;
|
QString serverStartScript;
|
||||||
QString sysRoot;
|
QString sysRoot;
|
||||||
|
QByteArray remoteDumperLib;
|
||||||
|
QByteArray remoteSourcesDir;
|
||||||
|
Core::SshConnectionParameters connParams;
|
||||||
|
|
||||||
QString debuggerCommand;
|
QString debuggerCommand;
|
||||||
int toolChainType;
|
int toolChainType;
|
||||||
QByteArray remoteDumperLib;
|
|
||||||
QString qtInstallPath;
|
QString qtInstallPath;
|
||||||
|
|
||||||
QString dumperLibrary;
|
QString dumperLibrary;
|
||||||
QStringList dumperLibraryLocations;
|
QStringList dumperLibraryLocations;
|
||||||
Core::SshConnectionParameters connParams;
|
|
||||||
DebuggerStartMode startMode;
|
DebuggerStartMode startMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class AbstractPlainGdbAdapter : public AbstractGdbAdapter
|
|||||||
public:
|
public:
|
||||||
AbstractPlainGdbAdapter(GdbEngine *engine, QObject *parent = 0);
|
AbstractPlainGdbAdapter(GdbEngine *engine, QObject *parent = 0);
|
||||||
|
|
||||||
void setupInferior();
|
virtual void setupInferior();
|
||||||
void runEngine();
|
void runEngine();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -51,6 +51,13 @@ void RemotePlainGdbAdapter::startAdapter()
|
|||||||
emit requestSetup();
|
emit requestSetup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RemotePlainGdbAdapter::setupInferior()
|
||||||
|
{
|
||||||
|
AbstractPlainGdbAdapter::setupInferior();
|
||||||
|
m_engine->postCommand("directory "
|
||||||
|
+ m_engine->startParameters().remoteSourcesDir);
|
||||||
|
}
|
||||||
|
|
||||||
void RemotePlainGdbAdapter::interruptInferior()
|
void RemotePlainGdbAdapter::interruptInferior()
|
||||||
{
|
{
|
||||||
m_gdbProc.interruptInferior();
|
m_gdbProc.interruptInferior();
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void startAdapter();
|
void startAdapter();
|
||||||
|
void setupInferior();
|
||||||
void interruptInferior();
|
void interruptInferior();
|
||||||
void shutdownInferior();
|
void shutdownInferior();
|
||||||
void shutdownAdapter();
|
void shutdownAdapter();
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ static const QLatin1String MountPortsKey(PREFIX ".MountPorts");
|
|||||||
static const QLatin1String HostAddressFromDeviceKey(PREFIX ".HostAddressFromDevice");
|
static const QLatin1String HostAddressFromDeviceKey(PREFIX ".HostAddressFromDevice");
|
||||||
static const QLatin1String BaseEnvironmentBaseKey(PREFIX ".BaseEnvironmentBase");
|
static const QLatin1String BaseEnvironmentBaseKey(PREFIX ".BaseEnvironmentBase");
|
||||||
static const QLatin1String UserEnvironmentChangesKey(PREFIX ".UserEnvironmentChanges");
|
static const QLatin1String UserEnvironmentChangesKey(PREFIX ".UserEnvironmentChanges");
|
||||||
|
static const QLatin1String UseRemoteGdbKey(PREFIX ".UseRemoteGdb");
|
||||||
|
static const QLatin1String GdbMountPortKey(PREFIX ".GdbMountPort");
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
#include <debugger/gdb/remoteplaingdbadapter.h>
|
#include <debugger/gdb/remoteplaingdbadapter.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
|
|
||||||
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
@@ -62,20 +63,28 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
|
|||||||
{
|
{
|
||||||
DebuggerStartParameters params;
|
DebuggerStartParameters params;
|
||||||
const MaemoDeviceConfig &devConf = runConfig->deviceConfig();
|
const MaemoDeviceConfig &devConf = runConfig->deviceConfig();
|
||||||
#ifdef USE_GDBSERVER
|
if (runConfig->useRemoteGdb()) {
|
||||||
params.startMode = AttachToRemote;
|
params.startMode = StartRemoteGdb;
|
||||||
params.executable = runConfig->localExecutableFilePath();
|
params.executable = runConfig->remoteExecutableFilePath();
|
||||||
params.debuggerCommand = runConfig->gdbCmd();
|
params.debuggerCommand
|
||||||
params.remoteChannel = devConf.server.host + QLatin1Char(':')
|
= MaemoGlobal::remoteCommandPrefix(runConfig->remoteExecutableFilePath())
|
||||||
+ gdbServerPort(runConfig, devConf);
|
+ QLatin1String(" /usr/bin/gdb");
|
||||||
params.remoteArchitecture = QLatin1String("arm");
|
params.connParams = devConf.server;
|
||||||
#else
|
const QString execDirAbs
|
||||||
params.startMode = StartRemoteGdb;
|
= QDir::fromNativeSeparators(QFileInfo(runConfig->localExecutableFilePath()).path());
|
||||||
params.executable = runConfig->remoteExecutableFilePath();
|
const QString execDirRel
|
||||||
params.debuggerCommand = MaemoGlobal::remoteCommandPrefix(runConfig->remoteExecutableFilePath())
|
= QDir(runConfig->localDirToMountForRemoteGdb()).relativeFilePath(execDirAbs);
|
||||||
+ QLatin1String(" /usr/bin/gdb");
|
params.remoteSourcesDir
|
||||||
params.connParams = devConf.server;
|
= QString(MaemoGlobal::remoteProjectSourcesMountPoint()
|
||||||
#endif
|
+ QLatin1Char('/') + execDirRel).toUtf8();
|
||||||
|
} else {
|
||||||
|
params.startMode = AttachToRemote;
|
||||||
|
params.executable = runConfig->localExecutableFilePath();
|
||||||
|
params.debuggerCommand = runConfig->gdbCmd();
|
||||||
|
params.remoteChannel = devConf.server.host + QLatin1Char(':')
|
||||||
|
+ gdbServerPort(runConfig, devConf);
|
||||||
|
params.remoteArchitecture = QLatin1String("arm");
|
||||||
|
}
|
||||||
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;
|
||||||
@@ -93,24 +102,22 @@ MaemoDebugSupport::MaemoDebugSupport(MaemoRunConfiguration *runConfig,
|
|||||||
DebuggerRunControl *runControl)
|
DebuggerRunControl *runControl)
|
||||||
: 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))
|
m_runner(new MaemoSshRunner(this, m_runConfig, true))
|
||||||
{
|
{
|
||||||
GdbEngine *engine = qobject_cast<GdbEngine *>(m_runControl->engine());
|
GdbEngine *engine = qobject_cast<GdbEngine *>(m_runControl->engine());
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine);
|
||||||
m_gdbAdapter = qobject_cast<GdbAdapter *>(engine->gdbAdapter());
|
m_gdbAdapter = engine->gdbAdapter();
|
||||||
Q_ASSERT(m_gdbAdapter);
|
Q_ASSERT(m_gdbAdapter);
|
||||||
connect(m_gdbAdapter, SIGNAL(requestSetup()), this,
|
connect(m_gdbAdapter, SIGNAL(requestSetup()), this,
|
||||||
SLOT(handleAdapterSetupRequested()));
|
SLOT(handleAdapterSetupRequested()));
|
||||||
connect(m_runControl, SIGNAL(finished()), this,
|
connect(m_runControl, SIGNAL(finished()), this,
|
||||||
SLOT(handleDebuggingFinished()));
|
SLOT(handleDebuggingFinished()));
|
||||||
#ifdef USE_GDBSERVER
|
|
||||||
m_runner->addProcsToKill(QStringList() << QLatin1String("gdbserver"));
|
|
||||||
#else
|
|
||||||
m_runner->addProcsToKill(QStringList() << QLatin1String("gdb"));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoDebugSupport::~MaemoDebugSupport() {}
|
MaemoDebugSupport::~MaemoDebugSupport()
|
||||||
|
{
|
||||||
|
stopSsh();
|
||||||
|
}
|
||||||
|
|
||||||
void MaemoDebugSupport::handleAdapterSetupRequested()
|
void MaemoDebugSupport::handleAdapterSetupRequested()
|
||||||
{
|
{
|
||||||
@@ -209,23 +216,22 @@ void MaemoDebugSupport::handleSftpJobFinished(Core::SftpJobId job,
|
|||||||
|
|
||||||
void MaemoDebugSupport::startDebugging()
|
void MaemoDebugSupport::startDebugging()
|
||||||
{
|
{
|
||||||
#ifdef USE_GDBSERVER
|
if (useGdb()) {
|
||||||
connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)), this,
|
handleAdapterSetupDone();
|
||||||
SLOT(handleRemoteErrorOutput(QByteArray)));
|
} else {
|
||||||
connect(m_runner, SIGNAL(remoteOutput(QByteArray)), this,
|
connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)), this,
|
||||||
SLOT(handleRemoteOutput(QByteArray)));
|
SLOT(handleRemoteErrorOutput(QByteArray)));
|
||||||
connect(m_runner, SIGNAL(remoteProcessStarted()), this,
|
connect(m_runner, SIGNAL(remoteOutput(QByteArray)), this,
|
||||||
SLOT(handleRemoteProcessStarted()));
|
SLOT(handleRemoteOutput(QByteArray)));
|
||||||
const QString &remoteExe = m_runConfig->remoteExecutableFilePath();
|
connect(m_runner, SIGNAL(remoteProcessStarted()), this,
|
||||||
m_runner->startExecution(QString::fromLocal8Bit("%1 gdbserver :%2 %3 %4")
|
SLOT(handleRemoteProcessStarted()));
|
||||||
.arg(MaemoGlobal::remoteCommandPrefix(remoteExe))
|
const QString &remoteExe = m_runConfig->remoteExecutableFilePath();
|
||||||
.arg(gdbServerPort(m_runConfig, m_deviceConfig))
|
m_runner->startExecution(QString::fromLocal8Bit("%1 gdbserver :%2 %3 %4")
|
||||||
.arg(remoteExe).arg(m_runConfig->arguments()
|
.arg(MaemoGlobal::remoteCommandPrefix(remoteExe))
|
||||||
.join(QLatin1String(" "))).toUtf8());
|
.arg(gdbServerPort(m_runConfig, m_deviceConfig))
|
||||||
#else
|
.arg(remoteExe).arg(m_runConfig->arguments()
|
||||||
stopSsh();
|
.join(QLatin1String(" "))).toUtf8());
|
||||||
handleAdapterSetupDone();
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoDebugSupport::handleRemoteProcessStarted()
|
void MaemoDebugSupport::handleRemoteProcessStarted()
|
||||||
@@ -261,7 +267,11 @@ void MaemoDebugSupport::stopSsh()
|
|||||||
|
|
||||||
void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error)
|
void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error)
|
||||||
{
|
{
|
||||||
m_gdbAdapter->handleSetupFailed(tr("Initial setup failed: %1").arg(error));
|
const QString msg = tr("Initial setup failed: %1").arg(error);
|
||||||
|
if (useGdb())
|
||||||
|
qobject_cast<RemotePlainGdbAdapter *>(m_gdbAdapter)->handleSetupFailed(msg);
|
||||||
|
else
|
||||||
|
qobject_cast<RemoteGdbServerAdapter*>(m_gdbAdapter)->handleSetupFailed(msg);
|
||||||
m_stopped = true;
|
m_stopped = true;
|
||||||
stopSsh();
|
stopSsh();
|
||||||
}
|
}
|
||||||
@@ -269,7 +279,10 @@ void MaemoDebugSupport::handleAdapterSetupFailed(const QString &error)
|
|||||||
void MaemoDebugSupport::handleAdapterSetupDone()
|
void MaemoDebugSupport::handleAdapterSetupDone()
|
||||||
{
|
{
|
||||||
m_adapterStarted = true;
|
m_adapterStarted = true;
|
||||||
m_gdbAdapter->handleSetupDone();
|
if (useGdb())
|
||||||
|
qobject_cast<RemotePlainGdbAdapter *>(m_gdbAdapter)->handleSetupDone();
|
||||||
|
else
|
||||||
|
qobject_cast<RemoteGdbServerAdapter*>(m_gdbAdapter)->handleSetupDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoDebugSupport::gdbServerPort(const MaemoRunConfiguration *rc,
|
QString MaemoDebugSupport::gdbServerPort(const MaemoRunConfiguration *rc,
|
||||||
@@ -288,5 +301,10 @@ QString MaemoDebugSupport::uploadDir(const MaemoDeviceConfig &devConf)
|
|||||||
return MaemoGlobal::homeDirOnDevice(devConf.server.uname);
|
return MaemoGlobal::homeDirOnDevice(devConf.server.uname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MaemoDebugSupport::useGdb() const
|
||||||
|
{
|
||||||
|
return m_runControl->engine()->startParameters().startMode == StartRemoteGdb;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -42,15 +42,12 @@
|
|||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QSharedPointer>
|
#include <QtCore/QSharedPointer>
|
||||||
|
|
||||||
#define USE_GDBSERVER
|
|
||||||
|
|
||||||
namespace Core { class SftpChannel; }
|
namespace Core { class SftpChannel; }
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
class DebuggerRunControl;
|
class DebuggerRunControl;
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class RemoteGdbServerAdapter;
|
class AbstractGdbAdapter;
|
||||||
class RemotePlainGdbAdapter;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,19 +90,14 @@ private:
|
|||||||
void handleAdapterSetupFailed(const QString &error);
|
void handleAdapterSetupFailed(const QString &error);
|
||||||
void handleAdapterSetupDone();
|
void handleAdapterSetupDone();
|
||||||
void startDebugging();
|
void startDebugging();
|
||||||
|
bool useGdb() const;
|
||||||
|
|
||||||
Debugger::DebuggerRunControl *m_runControl;
|
Debugger::DebuggerRunControl *m_runControl;
|
||||||
MaemoRunConfiguration * const m_runConfig;
|
MaemoRunConfiguration * const m_runConfig;
|
||||||
const MaemoDeviceConfig m_deviceConfig;
|
const MaemoDeviceConfig m_deviceConfig;
|
||||||
MaemoSshRunner * const m_runner;
|
MaemoSshRunner * const m_runner;
|
||||||
|
|
||||||
|
Debugger::Internal::AbstractGdbAdapter *m_gdbAdapter;
|
||||||
#ifdef USE_GDBSERVER
|
|
||||||
typedef Debugger::Internal::RemoteGdbServerAdapter GdbAdapter;
|
|
||||||
#else
|
|
||||||
typedef Debugger::Internal::RemotePlainGdbAdapter GdbAdapter;
|
|
||||||
#endif
|
|
||||||
GdbAdapter *m_gdbAdapter;
|
|
||||||
|
|
||||||
QSharedPointer<Core::SftpChannel> m_uploader;
|
QSharedPointer<Core::SftpChannel> m_uploader;
|
||||||
Core::SftpJobId m_uploadJob;
|
Core::SftpJobId m_uploadJob;
|
||||||
|
|||||||
@@ -61,5 +61,10 @@ QString MaemoGlobal::remoteEnvironment(const QList<ProjectExplorer::EnvironmentI
|
|||||||
return env.mid(0, env.size() - 1);
|
return env.mid(0, env.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString MaemoGlobal::remoteProjectSourcesMountPoint()
|
||||||
|
{
|
||||||
|
return QLatin1String("/tmp/gdbSourcesDir");
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public:
|
|||||||
static QString remoteSudo();
|
static QString remoteSudo();
|
||||||
static QString remoteCommandPrefix(const QString &commandFilePath);
|
static QString remoteCommandPrefix(const QString &commandFilePath);
|
||||||
static QString remoteEnvironment(const QList<ProjectExplorer::EnvironmentItem> &list);
|
static QString remoteEnvironment(const QList<ProjectExplorer::EnvironmentItem> &list);
|
||||||
|
static QString remoteProjectSourcesMountPoint();
|
||||||
|
|
||||||
template<class T> static T *buildStep(const ProjectExplorer::BuildConfiguration *bc)
|
template<class T> static T *buildStep(const ProjectExplorer::BuildConfiguration *bc)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,7 +55,11 @@
|
|||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
namespace { const QLatin1String DefaultHostAddress("192.168.2.14"); }
|
namespace {
|
||||||
|
const QLatin1String DefaultHostAddress("192.168.2.14");
|
||||||
|
const bool DefaultUseRemoteGdbValue = false; // TODO: Make true once utfs-server works on Windows.
|
||||||
|
const int DefaultGdbMountPort = 10100;
|
||||||
|
} // anonymous namespace
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
@@ -63,6 +67,9 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
|
|||||||
const QString &proFilePath)
|
const QString &proFilePath)
|
||||||
: RunConfiguration(parent, QLatin1String(MAEMO_RC_ID))
|
: RunConfiguration(parent, QLatin1String(MAEMO_RC_ID))
|
||||||
, m_proFilePath(proFilePath)
|
, m_proFilePath(proFilePath)
|
||||||
|
, m_hostAddressFromDevice(DefaultHostAddress)
|
||||||
|
, m_useRemoteGdb(DefaultUseRemoteGdbValue)
|
||||||
|
, m_gdbMountPort(DefaultGdbMountPort)
|
||||||
, m_baseEnvironmentBase(SystemEnvironmentBase)
|
, m_baseEnvironmentBase(SystemEnvironmentBase)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
@@ -74,6 +81,9 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
|
|||||||
, m_proFilePath(source->m_proFilePath)
|
, m_proFilePath(source->m_proFilePath)
|
||||||
, m_gdbPath(source->m_gdbPath)
|
, m_gdbPath(source->m_gdbPath)
|
||||||
, m_arguments(source->m_arguments)
|
, m_arguments(source->m_arguments)
|
||||||
|
, m_hostAddressFromDevice(source->localHostAddressFromDevice())
|
||||||
|
, m_useRemoteGdb(source->useRemoteGdb())
|
||||||
|
, m_gdbMountPort(source->gdbMountPort())
|
||||||
, m_baseEnvironmentBase(source->m_baseEnvironmentBase)
|
, m_baseEnvironmentBase(source->m_baseEnvironmentBase)
|
||||||
, m_systemEnvironment(source->m_systemEnvironment)
|
, m_systemEnvironment(source->m_systemEnvironment)
|
||||||
, m_userEnvironmentChanges(source->m_userEnvironmentChanges)
|
, m_userEnvironmentChanges(source->m_userEnvironmentChanges)
|
||||||
@@ -85,7 +95,6 @@ void MaemoRunConfiguration::init()
|
|||||||
{
|
{
|
||||||
m_devConfigModel = new MaemoDeviceConfigListModel(this);
|
m_devConfigModel = new MaemoDeviceConfigListModel(this);
|
||||||
m_remoteMounts = new MaemoRemoteMountsModel(this);
|
m_remoteMounts = new MaemoRemoteMountsModel(this);
|
||||||
m_hostAddressFromDevice = DefaultHostAddress;
|
|
||||||
setDisplayName(QFileInfo(m_proFilePath).completeBaseName());
|
setDisplayName(QFileInfo(m_proFilePath).completeBaseName());
|
||||||
|
|
||||||
updateDeviceConfigurations();
|
updateDeviceConfigurations();
|
||||||
@@ -144,6 +153,8 @@ QVariantMap MaemoRunConfiguration::toMap() const
|
|||||||
const QDir dir = QDir(target()->project()->projectDirectory());
|
const QDir dir = QDir(target()->project()->projectDirectory());
|
||||||
map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath));
|
map.insert(ProFileKey, dir.relativeFilePath(m_proFilePath));
|
||||||
map.insert(HostAddressFromDeviceKey, m_hostAddressFromDevice);
|
map.insert(HostAddressFromDeviceKey, m_hostAddressFromDevice);
|
||||||
|
map.insert(UseRemoteGdbKey, useRemoteGdb());
|
||||||
|
map.insert(GdbMountPortKey, gdbMountPort());
|
||||||
map.insert(BaseEnvironmentBaseKey, m_baseEnvironmentBase);
|
map.insert(BaseEnvironmentBaseKey, m_baseEnvironmentBase);
|
||||||
map.insert(UserEnvironmentChangesKey,
|
map.insert(UserEnvironmentChangesKey,
|
||||||
ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
|
ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges));
|
||||||
@@ -162,6 +173,8 @@ bool MaemoRunConfiguration::fromMap(const QVariantMap &map)
|
|||||||
m_proFilePath = dir.filePath(map.value(ProFileKey).toString());
|
m_proFilePath = dir.filePath(map.value(ProFileKey).toString());
|
||||||
m_hostAddressFromDevice = map.value(HostAddressFromDeviceKey,
|
m_hostAddressFromDevice = map.value(HostAddressFromDeviceKey,
|
||||||
DefaultHostAddress).toString();
|
DefaultHostAddress).toString();
|
||||||
|
m_useRemoteGdb = map.value(UseRemoteGdbKey, DefaultUseRemoteGdbValue).toBool();
|
||||||
|
m_gdbMountPort = map.value(GdbMountPortKey, DefaultGdbMountPort).toInt();
|
||||||
m_userEnvironmentChanges =
|
m_userEnvironmentChanges =
|
||||||
ProjectExplorer::EnvironmentItem::fromStringList(map.value(UserEnvironmentChangesKey)
|
ProjectExplorer::EnvironmentItem::fromStringList(map.value(UserEnvironmentChangesKey)
|
||||||
.toStringList());
|
.toStringList());
|
||||||
@@ -250,6 +263,26 @@ const QString MaemoRunConfiguration::dumperLib() const
|
|||||||
return qt4bc->qtVersion()->debuggingHelperLibrary();
|
return qt4bc->qtVersion()->debuggingHelperLibrary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString MaemoRunConfiguration::localDirToMountForRemoteGdb() const
|
||||||
|
{
|
||||||
|
const QString projectDir
|
||||||
|
= QDir::fromNativeSeparators(QDir::cleanPath(activeBuildConfiguration()
|
||||||
|
->target()->project()->projectDirectory()));
|
||||||
|
const QString execDir
|
||||||
|
= QDir::fromNativeSeparators(QFileInfo(localExecutableFilePath()).path());
|
||||||
|
const int length = qMin(projectDir.length(), execDir.length());
|
||||||
|
int lastSeparatorPos = 0;
|
||||||
|
for (int i = 0; i < length; ++i) {
|
||||||
|
if (projectDir.at(i) != execDir.at(i))
|
||||||
|
return projectDir.left(lastSeparatorPos);
|
||||||
|
if (projectDir.at(i) == QLatin1Char('/'))
|
||||||
|
lastSeparatorPos = i;
|
||||||
|
}
|
||||||
|
return projectDir.length() == execDir.length()
|
||||||
|
? projectDir : projectDir.left(lastSeparatorPos);
|
||||||
|
}
|
||||||
|
|
||||||
QString MaemoRunConfiguration::localExecutableFilePath() const
|
QString MaemoRunConfiguration::localExecutableFilePath() const
|
||||||
{
|
{
|
||||||
TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()
|
TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()
|
||||||
|
|||||||
@@ -96,9 +96,14 @@ public:
|
|||||||
MaemoDeviceConfig deviceConfig() const;
|
MaemoDeviceConfig deviceConfig() const;
|
||||||
MaemoDeviceConfigListModel *deviceConfigModel() const;
|
MaemoDeviceConfigListModel *deviceConfigModel() const;
|
||||||
QString runtimeGdbServerPort() const;
|
QString runtimeGdbServerPort() const;
|
||||||
|
bool useRemoteGdb() const { return m_useRemoteGdb; }
|
||||||
|
void setUseRemoteGdb(bool useRemoteGdb) { m_useRemoteGdb = useRemoteGdb; }
|
||||||
|
int gdbMountPort() const { return m_gdbMountPort; }
|
||||||
|
void setGdbMountPort(int port) { m_gdbMountPort = port; }
|
||||||
|
|
||||||
const QString gdbCmd() const;
|
const QString gdbCmd() const;
|
||||||
const QString dumperLib() const;
|
const QString dumperLib() const;
|
||||||
|
QString localDirToMountForRemoteGdb() const;
|
||||||
|
|
||||||
virtual QVariantMap toMap() const;
|
virtual QVariantMap toMap() const;
|
||||||
|
|
||||||
@@ -141,6 +146,8 @@ private:
|
|||||||
MaemoRemoteMountsModel *m_remoteMounts;
|
MaemoRemoteMountsModel *m_remoteMounts;
|
||||||
QStringList m_arguments;
|
QStringList m_arguments;
|
||||||
QString m_hostAddressFromDevice;
|
QString m_hostAddressFromDevice;
|
||||||
|
bool m_useRemoteGdb;
|
||||||
|
int m_gdbMountPort;
|
||||||
|
|
||||||
BaseEnvironmentBase m_baseEnvironmentBase;
|
BaseEnvironmentBase m_baseEnvironmentBase;
|
||||||
ProjectExplorer::Environment m_systemEnvironment;
|
ProjectExplorer::Environment m_systemEnvironment;
|
||||||
|
|||||||
@@ -54,6 +54,8 @@
|
|||||||
#include <QtGui/QLabel>
|
#include <QtGui/QLabel>
|
||||||
#include <QtGui/QLineEdit>
|
#include <QtGui/QLineEdit>
|
||||||
#include <QtGui/QPushButton>
|
#include <QtGui/QPushButton>
|
||||||
|
#include <QtGui/QRadioButton>
|
||||||
|
#include <QtGui/QSpinBox>
|
||||||
#include <QtGui/QTableView>
|
#include <QtGui/QTableView>
|
||||||
#include <QtGui/QToolButton>
|
#include <QtGui/QToolButton>
|
||||||
|
|
||||||
@@ -69,7 +71,15 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|||||||
{
|
{
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
addGenericWidgets(mainLayout);
|
||||||
|
mainLayout->addSpacing(20);
|
||||||
|
addDebuggingWidgets(mainLayout);
|
||||||
|
addMountWidgets(mainLayout);
|
||||||
|
addEnvironmentWidgets(mainLayout);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
||||||
|
{
|
||||||
QFormLayout *formLayout = new QFormLayout;
|
QFormLayout *formLayout = new QFormLayout;
|
||||||
mainLayout->addLayout(formLayout);
|
mainLayout->addLayout(formLayout);
|
||||||
formLayout->setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
formLayout->setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
||||||
@@ -80,7 +90,7 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|||||||
QHBoxLayout *devConfLayout = new QHBoxLayout(devConfWidget);
|
QHBoxLayout *devConfLayout = new QHBoxLayout(devConfWidget);
|
||||||
m_devConfBox = new QComboBox;
|
m_devConfBox = new QComboBox;
|
||||||
m_devConfBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
m_devConfBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||||
m_devConfBox->setModel(runConfiguration->deviceConfigModel());
|
m_devConfBox->setModel(m_runConfiguration->deviceConfigModel());
|
||||||
devConfLayout->setMargin(0);
|
devConfLayout->setMargin(0);
|
||||||
devConfLayout->addWidget(m_devConfBox);
|
devConfLayout->addWidget(m_devConfBox);
|
||||||
QLabel *addDevConfLabel= new QLabel(tr("<a href=\"%1\">Manage device configurations</a>")
|
QLabel *addDevConfLabel= new QLabel(tr("<a href=\"%1\">Manage device configurations</a>")
|
||||||
@@ -99,24 +109,86 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|||||||
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
|
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
|
||||||
formLayout->addRow(tr("Arguments:"), m_argsLineEdit);
|
formLayout->addRow(tr("Arguments:"), m_argsLineEdit);
|
||||||
|
|
||||||
mainLayout->addSpacing(20);
|
connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this,
|
||||||
m_detailsContainer = new Utils::DetailsWidget(this);
|
SLOT(showSettingsDialog(QString)));
|
||||||
QWidget *mountViewWidget = new QWidget;
|
connect(debuggerConfLabel, SIGNAL(linkActivated(QString)), this,
|
||||||
m_detailsContainer->setWidget(mountViewWidget);
|
SLOT(showSettingsDialog(QString)));
|
||||||
|
connect(m_configNameLineEdit, SIGNAL(textEdited(QString)), this,
|
||||||
|
SLOT(configNameEdited(QString)));
|
||||||
|
connect(m_argsLineEdit, SIGNAL(textEdited(QString)), this,
|
||||||
|
SLOT(argumentsEdited(QString)));
|
||||||
|
connect(m_devConfBox, SIGNAL(activated(int)), this,
|
||||||
|
SLOT(setCurrentDeviceConfig(int)));
|
||||||
|
connect(m_runConfiguration->deviceConfigModel(), SIGNAL(currentChanged()),
|
||||||
|
this, SLOT(handleCurrentDeviceConfigChanged()));
|
||||||
|
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
|
||||||
|
SLOT(updateTargetInformation()));
|
||||||
|
handleCurrentDeviceConfigChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfigurationWidget::addDebuggingWidgets(QVBoxLayout *mainLayout)
|
||||||
|
{
|
||||||
|
m_debugDetailsContainer = new Utils::DetailsWidget(this);
|
||||||
|
QWidget *debugWidget = new QWidget;
|
||||||
|
m_debugDetailsContainer->setWidget(debugWidget);
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
mainLayout->addWidget(m_detailsContainer);
|
mainLayout->addWidget(m_debugDetailsContainer);
|
||||||
|
#endif
|
||||||
|
QFormLayout *debugLayout = new QFormLayout(debugWidget);
|
||||||
|
QHBoxLayout *debugRadioButtonsLayout = new QHBoxLayout;
|
||||||
|
debugLayout->addRow(debugRadioButtonsLayout);
|
||||||
|
QRadioButton *gdbButton = new QRadioButton(tr("Use remote gdb"));
|
||||||
|
QRadioButton *gdbServerButton = new QRadioButton(tr("Use remote gdbserver"));
|
||||||
|
debugRadioButtonsLayout->addWidget(gdbButton);
|
||||||
|
debugRadioButtonsLayout->addWidget(gdbServerButton);
|
||||||
|
debugRadioButtonsLayout->addStretch(1);
|
||||||
|
QHBoxLayout *debugHostAddressLayout = new QHBoxLayout;
|
||||||
|
m_hostAddressLineEdit2 = new QLineEdit;
|
||||||
|
debugHostAddressLayout->addWidget(m_hostAddressLineEdit2);
|
||||||
|
debugHostAddressLayout->addStretch(1);
|
||||||
|
debugLayout->addRow(tr("This host's address from the device:"),
|
||||||
|
debugHostAddressLayout);
|
||||||
|
m_hostAddressLineEdit2->setText(m_runConfiguration->localHostAddressFromDevice());
|
||||||
|
gdbButton->setChecked(m_runConfiguration->useRemoteGdb());
|
||||||
|
gdbServerButton->setChecked(!gdbButton->isChecked());
|
||||||
|
connect(m_hostAddressLineEdit2, SIGNAL(textEdited(QString)), this,
|
||||||
|
SLOT(handleHostAddressChanged(QString)));
|
||||||
|
connect(gdbButton, SIGNAL(toggled(bool)), this,
|
||||||
|
SLOT(handleDebuggingTypeChanged(bool)));
|
||||||
|
QHBoxLayout *spinBoxLayout = new QHBoxLayout;
|
||||||
|
m_gdbMountPortSpinBox = new QSpinBox;
|
||||||
|
m_gdbMountPortSpinBox->setMinimum(1024);
|
||||||
|
m_gdbMountPortSpinBox->setMaximum((1 << 16) - 1);
|
||||||
|
spinBoxLayout->addWidget(m_gdbMountPortSpinBox);
|
||||||
|
spinBoxLayout->addStretch(1);
|
||||||
|
debugLayout->addRow(tr("Local port for mounting the project directory:"),
|
||||||
|
spinBoxLayout);
|
||||||
|
m_gdbMountPortSpinBox->setValue(m_runConfiguration->gdbMountPort());
|
||||||
|
connect(m_gdbMountPortSpinBox, SIGNAL(valueChanged(int)), this,
|
||||||
|
SLOT(handleGdbMountPortChanged(int)));
|
||||||
|
handleDebuggingTypeChanged(gdbButton->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfigurationWidget::addMountWidgets(QVBoxLayout *mainLayout)
|
||||||
|
{
|
||||||
|
|
||||||
|
m_mountDetailsContainer = new Utils::DetailsWidget(this);
|
||||||
|
QWidget *mountViewWidget = new QWidget;
|
||||||
|
m_mountDetailsContainer->setWidget(mountViewWidget);
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
|
mainLayout->addWidget(m_mountDetailsContainer);
|
||||||
#endif
|
#endif
|
||||||
QVBoxLayout *mountViewLayout = new QVBoxLayout(mountViewWidget);
|
QVBoxLayout *mountViewLayout = new QVBoxLayout(mountViewWidget);
|
||||||
QHBoxLayout *hostAddressLayout = new QHBoxLayout;
|
QHBoxLayout *hostAddressLayout = new QHBoxLayout;
|
||||||
mountViewLayout->addLayout(hostAddressLayout);
|
mountViewLayout->addLayout(hostAddressLayout);
|
||||||
QLabel *hostNameLabel
|
QLabel *hostNameLabel
|
||||||
= new QLabel(tr("This host's address from the device:"));
|
= new QLabel(tr("This host's address from the device:"));
|
||||||
m_hostAddressLineEdit = new QLineEdit;
|
m_hostAddressLineEdit1 = new QLineEdit;
|
||||||
m_hostAddressLineEdit->setText(m_runConfiguration->localHostAddressFromDevice());
|
m_hostAddressLineEdit1->setText(m_runConfiguration->localHostAddressFromDevice());
|
||||||
connect(m_hostAddressLineEdit, SIGNAL(editingFinished()), this,
|
connect(m_hostAddressLineEdit1, SIGNAL(textEdited(QString)), this,
|
||||||
SLOT(handleHostAddressChanged()));
|
SLOT(handleHostAddressChanged(QString)));
|
||||||
hostAddressLayout->addWidget(hostNameLabel);
|
hostAddressLayout->addWidget(hostNameLabel);
|
||||||
hostAddressLayout->addWidget(m_hostAddressLineEdit);
|
hostAddressLayout->addWidget(m_hostAddressLineEdit1);
|
||||||
hostAddressLayout->addStretch(1);
|
hostAddressLayout->addStretch(1);
|
||||||
QHBoxLayout *tableLayout = new QHBoxLayout;
|
QHBoxLayout *tableLayout = new QHBoxLayout;
|
||||||
mountViewLayout->addLayout(tableLayout);
|
mountViewLayout->addLayout(tableLayout);
|
||||||
@@ -139,10 +211,34 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|||||||
mountViewButtonsLayout->addWidget(m_removeMountButton);
|
mountViewButtonsLayout->addWidget(m_removeMountButton);
|
||||||
mountViewButtonsLayout->addStretch(1);
|
mountViewButtonsLayout->addStretch(1);
|
||||||
|
|
||||||
|
connect(addMountButton, SIGNAL(clicked()), this, SLOT(addMount()));
|
||||||
|
connect(m_removeMountButton, SIGNAL(clicked()), this, SLOT(removeMount()));
|
||||||
|
connect(m_mountView, SIGNAL(doubleClicked(QModelIndex)), this,
|
||||||
|
SLOT(changeLocalMountDir(QModelIndex)));
|
||||||
|
connect(m_mountView->selectionModel(),
|
||||||
|
SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this,
|
||||||
|
SLOT(enableOrDisableRemoveMountSpecButton()));
|
||||||
|
connect(m_runConfiguration->remoteMounts(),
|
||||||
|
SIGNAL(rowsInserted(QModelIndex, int, int)), this,
|
||||||
|
SLOT(handleRemoteMountsChanged()));
|
||||||
|
connect(m_runConfiguration->remoteMounts(),
|
||||||
|
SIGNAL(rowsRemoved(QModelIndex, int, int)), this,
|
||||||
|
SLOT(handleRemoteMountsChanged()));
|
||||||
|
connect(m_runConfiguration->remoteMounts(),
|
||||||
|
SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,
|
||||||
|
SLOT(handleRemoteMountsChanged()));
|
||||||
|
connect(m_runConfiguration->remoteMounts(), SIGNAL(modelReset()), this,
|
||||||
|
SLOT(handleRemoteMountsChanged()));
|
||||||
|
enableOrDisableRemoveMountSpecButton();
|
||||||
|
handleRemoteMountsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfigurationWidget::addEnvironmentWidgets(QVBoxLayout *mainLayout)
|
||||||
|
{
|
||||||
QWidget *baseEnvironmentWidget = new QWidget;
|
QWidget *baseEnvironmentWidget = new QWidget;
|
||||||
QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget);
|
QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget);
|
||||||
baseEnvironmentLayout->setMargin(0);
|
baseEnvironmentLayout->setMargin(0);
|
||||||
QLabel *label = new QLabel(tr("Base environment for this runconfiguration:"), this);
|
QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this);
|
||||||
baseEnvironmentLayout->addWidget(label);
|
baseEnvironmentLayout->addWidget(label);
|
||||||
m_baseEnvironmentComboBox = new QComboBox(this);
|
m_baseEnvironmentComboBox = new QComboBox(this);
|
||||||
m_baseEnvironmentComboBox->addItems(QStringList() << tr("Clean Environment")
|
m_baseEnvironmentComboBox->addItems(QStringList() << tr("Clean Environment")
|
||||||
@@ -160,44 +256,6 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|||||||
m_environmentWidget->setUserChanges(m_runConfiguration->userEnvironmentChanges());
|
m_environmentWidget->setUserChanges(m_runConfiguration->userEnvironmentChanges());
|
||||||
mainLayout->addWidget(m_environmentWidget);
|
mainLayout->addWidget(m_environmentWidget);
|
||||||
|
|
||||||
handleCurrentDeviceConfigChanged();
|
|
||||||
enableOrDisableRemoveButton();
|
|
||||||
handleRemoteMountsChanged();
|
|
||||||
|
|
||||||
connect(m_configNameLineEdit, SIGNAL(textEdited(QString)), this,
|
|
||||||
SLOT(configNameEdited(QString)));
|
|
||||||
connect(m_argsLineEdit, SIGNAL(textEdited(QString)), this,
|
|
||||||
SLOT(argumentsEdited(QString)));
|
|
||||||
connect(m_devConfBox, SIGNAL(activated(int)), this,
|
|
||||||
SLOT(setCurrentDeviceConfig(int)));
|
|
||||||
connect(runConfiguration->deviceConfigModel(), SIGNAL(currentChanged()),
|
|
||||||
this, SLOT(handleCurrentDeviceConfigChanged()));
|
|
||||||
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
|
|
||||||
SLOT(updateTargetInformation()));
|
|
||||||
connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this,
|
|
||||||
SLOT(showSettingsDialog(QString)));
|
|
||||||
connect(debuggerConfLabel, SIGNAL(linkActivated(QString)), this,
|
|
||||||
SLOT(showSettingsDialog(QString)));
|
|
||||||
|
|
||||||
connect(addMountButton, SIGNAL(clicked()), this, SLOT(addMount()));
|
|
||||||
connect(m_removeMountButton, SIGNAL(clicked()), this, SLOT(removeMount()));
|
|
||||||
connect(m_mountView, SIGNAL(doubleClicked(QModelIndex)), this,
|
|
||||||
SLOT(changeLocalMountDir(QModelIndex)));
|
|
||||||
connect(m_mountView->selectionModel(),
|
|
||||||
SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this,
|
|
||||||
SLOT(enableOrDisableRemoveButton()));
|
|
||||||
connect(m_runConfiguration->remoteMounts(),
|
|
||||||
SIGNAL(rowsInserted(QModelIndex, int, int)), this,
|
|
||||||
SLOT(handleRemoteMountsChanged()));
|
|
||||||
connect(m_runConfiguration->remoteMounts(),
|
|
||||||
SIGNAL(rowsRemoved(QModelIndex, int, int)), this,
|
|
||||||
SLOT(handleRemoteMountsChanged()));
|
|
||||||
connect(m_runConfiguration->remoteMounts(),
|
|
||||||
SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,
|
|
||||||
SLOT(handleRemoteMountsChanged()));
|
|
||||||
connect(m_runConfiguration->remoteMounts(), SIGNAL(modelReset()), this,
|
|
||||||
SLOT(handleRemoteMountsChanged()));
|
|
||||||
|
|
||||||
connect(m_environmentWidget, SIGNAL(userChangesChanged()), this,
|
connect(m_environmentWidget, SIGNAL(userChangesChanged()), this,
|
||||||
SLOT(userChangesEdited()));
|
SLOT(userChangesEdited()));
|
||||||
connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)),
|
connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)),
|
||||||
@@ -250,7 +308,7 @@ void MaemoRunConfigurationWidget::setCurrentDeviceConfig(int index)
|
|||||||
m_runConfiguration->deviceConfigModel()->setCurrentIndex(index);
|
m_runConfiguration->deviceConfigModel()->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::enableOrDisableRemoveButton()
|
void MaemoRunConfigurationWidget::enableOrDisableRemoveMountSpecButton()
|
||||||
{
|
{
|
||||||
const QModelIndexList selectedRows
|
const QModelIndexList selectedRows
|
||||||
= m_mountView->selectionModel()->selectedRows();
|
= m_mountView->selectionModel()->selectedRows();
|
||||||
@@ -294,9 +352,26 @@ void MaemoRunConfigurationWidget::changeLocalMountDir(const QModelIndex &index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::handleHostAddressChanged()
|
void MaemoRunConfigurationWidget::handleHostAddressChanged(const QString &newAddress)
|
||||||
{
|
{
|
||||||
m_runConfiguration->setLocalHostAddressFromDevice(m_hostAddressLineEdit->text());
|
m_hostAddressLineEdit1->setText(newAddress);
|
||||||
|
m_hostAddressLineEdit2->setText(newAddress);
|
||||||
|
m_runConfiguration->setLocalHostAddressFromDevice(newAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfigurationWidget::handleDebuggingTypeChanged(bool useGdb)
|
||||||
|
{
|
||||||
|
m_runConfiguration->setUseRemoteGdb(useGdb);
|
||||||
|
const QString detailsText = useGdb ? tr("Use gdb") : tr("Use gdbserver");
|
||||||
|
m_debugDetailsContainer->setSummaryText(tr("<b>Debugging details:</b> ")
|
||||||
|
+ detailsText);
|
||||||
|
m_hostAddressLineEdit2->setEnabled(useGdb);
|
||||||
|
m_gdbMountPortSpinBox->setEnabled(useGdb);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfigurationWidget::handleGdbMountPortChanged(int port)
|
||||||
|
{
|
||||||
|
m_runConfiguration->setGdbMountPort(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::fetchEnvironment()
|
void MaemoRunConfigurationWidget::fetchEnvironment()
|
||||||
@@ -367,7 +442,7 @@ void MaemoRunConfigurationWidget::handleRemoteMountsChanged()
|
|||||||
.arg(mountCount);
|
.arg(mountCount);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_detailsContainer->setSummaryText(QLatin1String("<b>") + text
|
m_mountDetailsContainer->setSummaryText(QLatin1String("<b>") + text
|
||||||
+ QLatin1String("</b>"));
|
+ QLatin1String("</b>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,10 @@ class QLabel;
|
|||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QModelIndex;
|
class QModelIndex;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
|
class QSpinBox;
|
||||||
class QTableView;
|
class QTableView;
|
||||||
class QToolButton;
|
class QToolButton;
|
||||||
|
class QVBoxLayout;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -77,8 +79,10 @@ private slots:
|
|||||||
void addMount();
|
void addMount();
|
||||||
void removeMount();
|
void removeMount();
|
||||||
void changeLocalMountDir(const QModelIndex &index);
|
void changeLocalMountDir(const QModelIndex &index);
|
||||||
void enableOrDisableRemoveButton();
|
void enableOrDisableRemoveMountSpecButton();
|
||||||
void handleHostAddressChanged();
|
void handleHostAddressChanged(const QString &newAddress);
|
||||||
|
void handleDebuggingTypeChanged(bool useGdb);
|
||||||
|
void handleGdbMountPortChanged(int port);
|
||||||
void fetchEnvironment();
|
void fetchEnvironment();
|
||||||
void fetchEnvironmentFinished();
|
void fetchEnvironmentFinished();
|
||||||
void userChangesEdited();
|
void userChangesEdited();
|
||||||
@@ -89,14 +93,22 @@ private slots:
|
|||||||
void handleRemoteMountsChanged();
|
void handleRemoteMountsChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void addGenericWidgets(QVBoxLayout *mainLayout);
|
||||||
|
void addDebuggingWidgets(QVBoxLayout *mainLayout);
|
||||||
|
void addMountWidgets(QVBoxLayout *mainLayout);
|
||||||
|
void addEnvironmentWidgets(QVBoxLayout *mainLayout);
|
||||||
|
|
||||||
QLineEdit *m_configNameLineEdit;
|
QLineEdit *m_configNameLineEdit;
|
||||||
QLineEdit *m_argsLineEdit;
|
QLineEdit *m_argsLineEdit;
|
||||||
QLabel *m_executableLabel;
|
QLabel *m_executableLabel;
|
||||||
QComboBox *m_devConfBox;
|
QComboBox *m_devConfBox;
|
||||||
QLineEdit *m_hostAddressLineEdit;
|
QLineEdit *m_hostAddressLineEdit1;
|
||||||
|
QLineEdit *m_hostAddressLineEdit2;
|
||||||
|
QSpinBox *m_gdbMountPortSpinBox;
|
||||||
QTableView *m_mountView;
|
QTableView *m_mountView;
|
||||||
QToolButton *m_removeMountButton;
|
QToolButton *m_removeMountButton;
|
||||||
Utils::DetailsWidget *m_detailsContainer;
|
Utils::DetailsWidget *m_mountDetailsContainer;
|
||||||
|
Utils::DetailsWidget *m_debugDetailsContainer;
|
||||||
MaemoRunConfiguration *m_runConfiguration;
|
MaemoRunConfiguration *m_runConfiguration;
|
||||||
|
|
||||||
bool m_ignoreChange;
|
bool m_ignoreChange;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ MaemoRunControl::MaemoRunControl(RunConfiguration *rc)
|
|||||||
: RunControl(rc, ProjectExplorer::Constants::RUNMODE)
|
: RunControl(rc, ProjectExplorer::Constants::RUNMODE)
|
||||||
, m_runConfig(qobject_cast<MaemoRunConfiguration *>(rc))
|
, m_runConfig(qobject_cast<MaemoRunConfiguration *>(rc))
|
||||||
, m_devConfig(m_runConfig ? m_runConfig->deviceConfig() : MaemoDeviceConfig())
|
, m_devConfig(m_runConfig ? m_runConfig->deviceConfig() : MaemoDeviceConfig())
|
||||||
, m_runner(new MaemoSshRunner(this, m_runConfig))
|
, m_runner(new MaemoSshRunner(this, m_runConfig, false))
|
||||||
, m_running(false)
|
, m_running(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
|
|
||||||
#include "maemodeviceconfigurations.h"
|
#include "maemodeviceconfigurations.h"
|
||||||
#include "maemoglobal.h"
|
#include "maemoglobal.h"
|
||||||
#include "maemoremotemountsmodel.h"
|
|
||||||
#include "maemorunconfiguration.h"
|
#include "maemorunconfiguration.h"
|
||||||
#include "maemotoolchain.h"
|
#include "maemotoolchain.h"
|
||||||
|
|
||||||
@@ -53,14 +52,17 @@ namespace Qt4ProjectManager {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
MaemoSshRunner::MaemoSshRunner(QObject *parent,
|
MaemoSshRunner::MaemoSshRunner(QObject *parent,
|
||||||
MaemoRunConfiguration *runConfig)
|
MaemoRunConfiguration *runConfig, bool debugging)
|
||||||
: QObject(parent), m_runConfig(runConfig),
|
: QObject(parent), m_runConfig(runConfig),
|
||||||
m_devConfig(runConfig->deviceConfig()),
|
m_devConfig(runConfig->deviceConfig()),
|
||||||
m_uploadJobId(SftpInvalidJob)
|
m_uploadJobId(SftpInvalidJob),
|
||||||
|
m_debugging(debugging)
|
||||||
{
|
{
|
||||||
m_procsToKill
|
m_procsToKill
|
||||||
<< QFileInfo(m_runConfig->localExecutableFilePath()).fileName()
|
<< QFileInfo(m_runConfig->localExecutableFilePath()).fileName()
|
||||||
<< QLatin1String("utfs-client");
|
<< QLatin1String("utfs-client");
|
||||||
|
if (debugging)
|
||||||
|
m_procsToKill << QLatin1String("gdbserver");
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoSshRunner::~MaemoSshRunner() {}
|
MaemoSshRunner::~MaemoSshRunner() {}
|
||||||
@@ -70,13 +72,24 @@ void MaemoSshRunner::setConnection(const QSharedPointer<Core::SshConnection> &co
|
|||||||
m_connection = connection;
|
m_connection = connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoSshRunner::addProcsToKill(const QStringList &appNames)
|
|
||||||
{
|
|
||||||
m_procsToKill << appNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaemoSshRunner::start()
|
void MaemoSshRunner::start()
|
||||||
{
|
{
|
||||||
|
m_mountSpecs.clear();
|
||||||
|
const MaemoRemoteMountsModel * const remoteMounts
|
||||||
|
= m_runConfig->remoteMounts();
|
||||||
|
for (int i = 0; i < remoteMounts->mountSpecificationCount(); ++i) {
|
||||||
|
const MaemoRemoteMountsModel::MountSpecification &mountSpec
|
||||||
|
= remoteMounts->mountSpecificationAt(i);
|
||||||
|
if (mountSpec.isValid())
|
||||||
|
m_mountSpecs << mountSpec;
|
||||||
|
}
|
||||||
|
if (m_debugging && m_runConfig->useRemoteGdb()) {
|
||||||
|
m_mountSpecs << MaemoRemoteMountsModel::MountSpecification(
|
||||||
|
m_runConfig->localDirToMountForRemoteGdb(),
|
||||||
|
MaemoGlobal::remoteProjectSourcesMountPoint(),
|
||||||
|
m_runConfig->gdbMountPort());
|
||||||
|
}
|
||||||
|
|
||||||
m_stop = false;
|
m_stop = false;
|
||||||
if (m_connection)
|
if (m_connection)
|
||||||
disconnect(m_connection.data(), 0, this, 0);
|
disconnect(m_connection.data(), 0, this, 0);
|
||||||
@@ -109,9 +122,11 @@ void MaemoSshRunner::stop()
|
|||||||
disconnect(m_mountProcess.data(), 0, this, 0);
|
disconnect(m_mountProcess.data(), 0, this, 0);
|
||||||
m_mountProcess->closeChannel();
|
m_mountProcess->closeChannel();
|
||||||
}
|
}
|
||||||
if (m_runner) {
|
if (m_debugging || m_runner) {
|
||||||
disconnect(m_runner.data(), 0, this, 0);
|
if (m_runner) {
|
||||||
m_runner->closeChannel();
|
disconnect(m_runner.data(), 0, this, 0);
|
||||||
|
m_runner->closeChannel();
|
||||||
|
}
|
||||||
cleanup(false);
|
cleanup(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -140,18 +155,12 @@ void MaemoSshRunner::cleanup(bool initialCleanup)
|
|||||||
}
|
}
|
||||||
QString remoteCall = niceKill + QLatin1String("sleep 1; ") + brutalKill;
|
QString remoteCall = niceKill + QLatin1String("sleep 1; ") + brutalKill;
|
||||||
|
|
||||||
const MaemoRemoteMountsModel * const remoteMounts
|
for (int i = 0; i < m_mountSpecs.count(); ++i) {
|
||||||
= m_runConfig->remoteMounts();
|
remoteCall += QString::fromLocal8Bit("%1 umount %2;")
|
||||||
for (int i = 0; i < remoteMounts->mountSpecificationCount(); ++i) {
|
.arg(MaemoGlobal::remoteSudo(), m_mountSpecs.at(i).remoteMountPoint);
|
||||||
const MaemoRemoteMountsModel::MountSpecification &mountSpec
|
|
||||||
= remoteMounts->mountSpecificationAt(i);
|
|
||||||
if (mountSpec.isValid()) {
|
|
||||||
remoteCall += QString::fromLocal8Bit("%1 umount %2;")
|
|
||||||
.arg(MaemoGlobal::remoteSudo(), mountSpec.remoteMountPoint);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteCall.remove(remoteCall.count() - 1, 1); // Get rid of trailing semicolon.
|
remoteCall.remove(remoteCall.count() - 1, 1); // Get rid of trailing semicolon.
|
||||||
|
|
||||||
SshRemoteProcess::Ptr proc
|
SshRemoteProcess::Ptr proc
|
||||||
= m_connection->createRemoteProcess(remoteCall.toUtf8());
|
= m_connection->createRemoteProcess(remoteCall.toUtf8());
|
||||||
if (initialCleanup) {
|
if (initialCleanup) {
|
||||||
@@ -180,7 +189,7 @@ void MaemoSshRunner::handleInitialCleanupFinished(int exitStatus)
|
|||||||
if (exitStatus != SshRemoteProcess::ExitedNormally) {
|
if (exitStatus != SshRemoteProcess::ExitedNormally) {
|
||||||
emit error(tr("Initial cleanup failed: %1")
|
emit error(tr("Initial cleanup failed: %1")
|
||||||
.arg(m_initialCleaner->errorString()));
|
.arg(m_initialCleaner->errorString()));
|
||||||
} else if (m_runConfig->remoteMounts()->hasValidMountSpecifications()) {
|
} else if (!m_mountSpecs.isEmpty()) {
|
||||||
deployUtfsClient();
|
deployUtfsClient();
|
||||||
} else {
|
} else {
|
||||||
emit readyForExecution();
|
emit readyForExecution();
|
||||||
@@ -248,20 +257,15 @@ void MaemoSshRunner::handleUploadFinished(Core::SftpJobId jobId,
|
|||||||
|
|
||||||
void MaemoSshRunner::mount()
|
void MaemoSshRunner::mount()
|
||||||
{
|
{
|
||||||
const MaemoRemoteMountsModel * const remoteMounts
|
|
||||||
= m_runConfig->remoteMounts();
|
|
||||||
const QString chmodFuse
|
const QString chmodFuse
|
||||||
= MaemoGlobal::remoteSudo() + QLatin1String(" chmod a+r+w /dev/fuse");
|
= MaemoGlobal::remoteSudo() + QLatin1String(" chmod a+r+w /dev/fuse");
|
||||||
const QString chmodUtfsClient
|
const QString chmodUtfsClient
|
||||||
= QLatin1String("chmod a+x ") + utfsClientOnDevice();
|
= QLatin1String("chmod a+x ") + utfsClientOnDevice();
|
||||||
const QLatin1String andOp(" && ");
|
const QLatin1String andOp(" && ");
|
||||||
QString remoteCall = chmodFuse + andOp + chmodUtfsClient;
|
QString remoteCall = chmodFuse + andOp + chmodUtfsClient;
|
||||||
for (int i = 0; i < remoteMounts->mountSpecificationCount(); ++i) {
|
for (int i = 0; i < m_mountSpecs.count(); ++i) {
|
||||||
const MaemoRemoteMountsModel::MountSpecification &mountSpec
|
const MaemoRemoteMountsModel::MountSpecification &mountSpec
|
||||||
= remoteMounts->mountSpecificationAt(i);
|
= m_mountSpecs.at(i);
|
||||||
if (!mountSpec.isValid())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
QProcess * const utfsServerProc = new QProcess(this);
|
QProcess * const utfsServerProc = new QProcess(this);
|
||||||
connect(utfsServerProc, SIGNAL(readyReadStandardError()), this,
|
connect(utfsServerProc, SIGNAL(readyReadStandardError()), this,
|
||||||
SLOT(handleUtfsServerErrorOutput()));
|
SLOT(handleUtfsServerErrorOutput()));
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include <QtCore/QSharedPointer>
|
#include <QtCore/QSharedPointer>
|
||||||
|
|
||||||
#include "maemodeviceconfigurations.h"
|
#include "maemodeviceconfigurations.h"
|
||||||
|
#include "maemoremotemountsmodel.h"
|
||||||
|
|
||||||
#include <coreplugin/ssh/sftpdefs.h>
|
#include <coreplugin/ssh/sftpdefs.h>
|
||||||
|
|
||||||
@@ -60,11 +61,11 @@ class MaemoSshRunner : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MaemoSshRunner(QObject *parent, MaemoRunConfiguration *runConfig);
|
MaemoSshRunner(QObject *parent, MaemoRunConfiguration *runConfig,
|
||||||
|
bool debugging);
|
||||||
~MaemoSshRunner();
|
~MaemoSshRunner();
|
||||||
|
|
||||||
void setConnection(const QSharedPointer<Core::SshConnection> &connection);
|
void setConnection(const QSharedPointer<Core::SshConnection> &connection);
|
||||||
void addProcsToKill(const QStringList &appNames);
|
|
||||||
|
|
||||||
void start();
|
void start();
|
||||||
void stop();
|
void stop();
|
||||||
@@ -109,9 +110,11 @@ private:
|
|||||||
QSharedPointer<Core::SftpChannel> m_utfsClientUploader;
|
QSharedPointer<Core::SftpChannel> m_utfsClientUploader;
|
||||||
QStringList m_procsToKill;
|
QStringList m_procsToKill;
|
||||||
QList<QProcess *> m_utfsServers;
|
QList<QProcess *> m_utfsServers;
|
||||||
|
QList<MaemoRemoteMountsModel::MountSpecification> m_mountSpecs;
|
||||||
|
|
||||||
Core::SftpJobId m_uploadJobId;
|
Core::SftpJobId m_uploadJobId;
|
||||||
bool m_stop;
|
bool m_stop;
|
||||||
|
const bool m_debugging;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user