Commit a4501441 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Fix debugger race condition.

"gdbserver started" does not necessarily mean "gdbserver has opened its port".

Reviewed-by: Tobias Hunger
parent 6b47a0f2
......@@ -230,12 +230,11 @@ void MaemoDebugSupport::startDebugging()
if (useGdb()) {
handleAdapterSetupDone();
} else {
m_gdbserverOutput.clear();
connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)), this,
SLOT(handleRemoteErrorOutput(QByteArray)));
connect(m_runner, SIGNAL(remoteOutput(QByteArray)), this,
SLOT(handleRemoteOutput(QByteArray)));
connect(m_runner, SIGNAL(remoteProcessStarted()), this,
SLOT(handleRemoteProcessStarted()));
const QString &remoteExe = m_runConfig->remoteExecutableFilePath();
const QString cmdPrefix = MaemoGlobal::remoteCommandPrefix(remoteExe);
const QString env = environment(m_runConfig);
......@@ -250,11 +249,6 @@ void MaemoDebugSupport::startDebugging()
}
}
void MaemoDebugSupport::handleRemoteProcessStarted()
{
handleAdapterSetupDone();
}
void MaemoDebugSupport::handleDebuggingFinished()
{
m_stopped = true;
......@@ -269,6 +263,13 @@ void MaemoDebugSupport::handleRemoteOutput(const QByteArray &output)
void MaemoDebugSupport::handleRemoteErrorOutput(const QByteArray &output)
{
m_runControl->showMessage(QString::fromUtf8(output), AppOutput);
if (!m_adapterStarted && !useGdb() && !m_qmlOnlyDebugging) {
m_gdbserverOutput += output;
if (m_gdbserverOutput.contains("Listening on port")) {
handleAdapterSetupDone();
m_gdbserverOutput.clear();
}
}
}
void MaemoDebugSupport::handleProgressReport(const QString &progressOutput)
......
......@@ -75,7 +75,6 @@ private slots:
void handleSftpChannelInitialized();
void handleSftpChannelInitializationFailed(const QString &error);
void handleSftpJobFinished(Core::SftpJobId job, const QString &error);
void handleRemoteProcessStarted();
void handleDebuggingFinished();
void handleRemoteOutput(const QByteArray &output);
void handleRemoteErrorOutput(const QByteArray &output);
......@@ -102,6 +101,7 @@ private:
Core::SftpJobId m_uploadJob;
bool m_adapterStarted;
bool m_stopped;
QByteArray m_gdbserverOutput;
};
} // namespace Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment