forked from qt-creator/qt-creator
RemoteLinuxRunSupport: Fix broken code
Fix broken debug and profiling support on remote linux. Change-Id: Ic4173a47b8fd450a92407a66fa338c18f7062736 Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
@@ -123,29 +123,10 @@ void AbstractRemoteLinuxRunSupport::handlePortListReady()
|
||||
startExecution();
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxRunSupport::handleAppRunnerError(const QString &)
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxRunSupport::handleRemoteOutput(const QByteArray &)
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxRunSupport::handleRemoteErrorOutput(const QByteArray &)
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxRunSupport::handleAppRunnerFinished(bool)
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxRunSupport::handleProgressReport(const QString &)
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxRunSupport::handleAdapterSetupFailed(const QString &)
|
||||
{
|
||||
setFinished();
|
||||
reset();
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxRunSupport::handleAdapterSetupDone()
|
||||
@@ -157,8 +138,6 @@ void AbstractRemoteLinuxRunSupport::setFinished()
|
||||
{
|
||||
if (d->state == Inactive)
|
||||
return;
|
||||
d->portsGatherer.disconnect(this);
|
||||
d->appRunner.disconnect(this);
|
||||
if (d->state == Running) {
|
||||
const QString stopCommand
|
||||
= d->device->processSupport()->killProcessByNameCommandLine(d->remoteFilePath);
|
||||
@@ -197,6 +176,13 @@ const IDevice::ConstPtr AbstractRemoteLinuxRunSupport::device() const
|
||||
return d->device;
|
||||
}
|
||||
|
||||
void AbstractRemoteLinuxRunSupport::reset()
|
||||
{
|
||||
d->portsGatherer.disconnect(this);
|
||||
d->appRunner.disconnect(this);
|
||||
d->state = Inactive;
|
||||
}
|
||||
|
||||
DeviceApplicationRunner *AbstractRemoteLinuxRunSupport::appRunner() const
|
||||
{
|
||||
return &d->appRunner;
|
||||
|
||||
@@ -84,13 +84,15 @@ protected:
|
||||
QString remoteFilePath() const;
|
||||
const ProjectExplorer::IDevice::ConstPtr device() const;
|
||||
|
||||
void reset();
|
||||
|
||||
protected slots:
|
||||
virtual void handleRemoteSetupRequested();
|
||||
virtual void handleAppRunnerError(const QString &error);
|
||||
virtual void handleRemoteOutput(const QByteArray &output);
|
||||
virtual void handleRemoteErrorOutput(const QByteArray &output);
|
||||
virtual void handleAppRunnerFinished(bool success);
|
||||
virtual void handleProgressReport(const QString &progressOutput);
|
||||
virtual void handleAppRunnerError(const QString &error) = 0;
|
||||
virtual void handleRemoteOutput(const QByteArray &output) = 0;
|
||||
virtual void handleRemoteErrorOutput(const QByteArray &output) = 0;
|
||||
virtual void handleAppRunnerFinished(bool success) = 0;
|
||||
virtual void handleProgressReport(const QString &progressOutput) = 0;
|
||||
|
||||
private slots:
|
||||
void handlePortsGathererError(const QString &message);
|
||||
|
||||
@@ -95,7 +95,6 @@ RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(RemoteLinuxRunConfiguration
|
||||
{
|
||||
connect(d->engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
|
||||
SLOT(handleRemoteSetupRequested()));
|
||||
connect(d->engine, SIGNAL(finished()), SLOT(handleProfilingFinished()));
|
||||
}
|
||||
|
||||
RemoteLinuxAnalyzeSupport::~RemoteLinuxAnalyzeSupport()
|
||||
@@ -111,6 +110,9 @@ void RemoteLinuxAnalyzeSupport::showMessage(const QString &msg, Utils::OutputFor
|
||||
|
||||
void RemoteLinuxAnalyzeSupport::handleRemoteSetupRequested()
|
||||
{
|
||||
if (d->engine->mode() != Analyzer::StartQmlRemote)
|
||||
return;
|
||||
|
||||
QTC_ASSERT(state() == Inactive, return);
|
||||
|
||||
showMessage(tr("Checking available ports...\n"), Utils::NormalMessageFormat);
|
||||
@@ -154,12 +156,17 @@ void RemoteLinuxAnalyzeSupport::handleAppRunnerError(const QString &error)
|
||||
|
||||
void RemoteLinuxAnalyzeSupport::handleAppRunnerFinished(bool success)
|
||||
{
|
||||
// reset needs to be called first to ensure that the correct state is set.
|
||||
reset();
|
||||
if (!success)
|
||||
showMessage(tr("Failure running remote process."), Utils::NormalMessageFormat);
|
||||
d->engine->notifyRemoteFinished(success);
|
||||
}
|
||||
|
||||
void RemoteLinuxAnalyzeSupport::handleProfilingFinished()
|
||||
{
|
||||
if (d->engine->mode() != Analyzer::StartQmlRemote)
|
||||
return;
|
||||
setFinished();
|
||||
}
|
||||
|
||||
|
||||
@@ -198,14 +198,16 @@ void LinuxDeviceDebugSupport::handleAppRunnerFinished(bool success)
|
||||
else if (!success)
|
||||
d->engine->notifyInferiorIll();
|
||||
|
||||
} else {
|
||||
} else if (state() == StartingRunner){
|
||||
d->engine->notifyEngineRemoteSetupFailed(tr("Debugging failed."));
|
||||
}
|
||||
reset();
|
||||
}
|
||||
|
||||
void LinuxDeviceDebugSupport::handleDebuggingFinished()
|
||||
{
|
||||
setFinished();
|
||||
reset();
|
||||
}
|
||||
|
||||
void LinuxDeviceDebugSupport::handleRemoteOutput(const QByteArray &output)
|
||||
|
||||
Reference in New Issue
Block a user