summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2010-10-21 11:35:18 +0200
committerChristian Kandeler <christian.kandeler@nokia.com>2010-10-21 11:36:54 +0200
commita4501441cb8fbfac38d5ed88cd83cfa332eb1b42 (patch)
treedae8013b070d4aaf5399164dd077bc7960276978
parent6b47a0f2773f9043c9e4bb75478794f6aa9936be (diff)
downloadqt-creator-a4501441cb8fbfac38d5ed88cd83cfa332eb1b42.tar.gz
Maemo: Fix debugger race condition.
"gdbserver started" does not necessarily mean "gdbserver has opened its port". Reviewed-by: Tobias Hunger
-rw-r--r--src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp15
-rw-r--r--src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.h2
2 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp
index d67de573fd..abac864fa0 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.cpp
@@ -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)
diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.h b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.h
index a53ae20857..d4849aa659 100644
--- a/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.h
+++ b/src/plugins/qt4projectmanager/qt-maemo/maemodebugsupport.h
@@ -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