From 1f445b2dffdcb9880ef686d969253d51ea0ce05f Mon Sep 17 00:00:00 2001 From: Pawel Polanski Date: Fri, 1 Apr 2011 16:52:57 +0200 Subject: [PATCH] Symbian: Fixed the 'Adapter start failed' bug Task-number: QTCREATORBUG-4325 Reviewed-by: Friedemann Kleint --- src/plugins/debugger/gdb/codagdbadapter.cpp | 11 ++++++++--- src/plugins/debugger/gdb/codagdbadapter.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/gdb/codagdbadapter.cpp b/src/plugins/debugger/gdb/codagdbadapter.cpp index 69dfaff8888..76892af8e91 100644 --- a/src/plugins/debugger/gdb/codagdbadapter.cpp +++ b/src/plugins/debugger/gdb/codagdbadapter.cpp @@ -127,7 +127,8 @@ CodaGdbAdapter::CodaGdbAdapter(GdbEngine *engine) : m_uid(0), m_verbose(0), m_firstResumableExeLoadedEvent(false), - m_registerRequestPending(false) + m_registerRequestPending(false), + m_firstHelloEvent(true) { m_bufferedMemoryRead = true; // Disable buffering if gdb's dcache is used. @@ -316,8 +317,11 @@ void CodaGdbAdapter::codaEvent(const CodaEvent &e) switch (e.type()) { case CodaEvent::LocatorHello: - m_codaDevice->sendLoggingAddListenerCommand(CodaCallback()); - startGdb(); // Commands are only accepted after hello + if (state() == EngineSetupRequested && m_firstHelloEvent) { + m_firstHelloEvent = false; + m_codaDevice->sendLoggingAddListenerCommand(CodaCallback()); + startGdb(); // Commands are only accepted after hello + } break; case CodaEvent::RunControlModuleLoadSuspended: // A module was loaded handleCodaRunControlModuleLoadContextSuspendedEvent( @@ -1027,6 +1031,7 @@ void CodaGdbAdapter::startAdapter() m_session.reset(); m_firstResumableExeLoadedEvent = true; m_tcfProcessId.clear(); + m_firstHelloEvent = true; // Retrieve parameters. const DebuggerStartParameters ¶meters = startParameters(); diff --git a/src/plugins/debugger/gdb/codagdbadapter.h b/src/plugins/debugger/gdb/codagdbadapter.h index 2af60e7bc5d..0e8c75c2e9a 100644 --- a/src/plugins/debugger/gdb/codagdbadapter.h +++ b/src/plugins/debugger/gdb/codagdbadapter.h @@ -199,6 +199,7 @@ private: bool m_registerRequestPending; QByteArray m_tcfProcessId; LocalGdbProcess m_gdbProc; + bool m_firstHelloEvent; }; } // namespace Internal