diff --git a/src/plugins/debugger/cdb/cdbdebugengine.cpp b/src/plugins/debugger/cdb/cdbdebugengine.cpp index 7a801654d77..95a58a2b02e 100644 --- a/src/plugins/debugger/cdb/cdbdebugengine.cpp +++ b/src/plugins/debugger/cdb/cdbdebugengine.cpp @@ -126,7 +126,7 @@ CdbDebugEnginePrivate::CdbDebugEnginePrivate(DebuggerManager *manager, m_hDebuggeeProcess(0), m_hDebuggeeThread(0), m_breakEventMode(BreakEventHandle), - m_dumper(new CdbDumperHelper(manager, this)), + m_dumper(new CdbDumperHelper(engine, this)), m_currentThreadId(-1), m_eventThreadId(-1), m_interruptArticifialThreadId(-1), @@ -328,7 +328,7 @@ void CdbDebugEnginePrivate::checkVersion() } // Compare const double minVersion = 6.11; - showMessage(CdbDebugEngine::tr("Version: %1").arg(version)); + m_engine->showMessage(CdbDebugEngine::tr("Version: %1").arg(version)); if (version.toDouble() < minVersion) { const QString msg = CdbDebugEngine::tr( "The installed version of the Debugging Tools for Windows (%1) " @@ -612,7 +612,7 @@ void CdbDebugEnginePrivate::endDebugging(EndDebuggingMode em) // Need a stopped debuggee to act if (!endInferior(action, &errorMessage)) { errorMessage = QString::fromLatin1("Unable to detach from/end the debuggee: %1").arg(errorMessage); - showMessage(errorMessage, LogError); + m_engine->showMessage(errorMessage, LogError); } errorMessage.clear(); } @@ -623,7 +623,7 @@ void CdbDebugEnginePrivate::endDebugging(EndDebuggingMode em) m_engine->setState(DebuggerNotReady, Q_FUNC_INFO, __LINE__); if (!endedCleanly) { errorMessage = QString::fromLatin1("There were errors trying to end debugging:\n%1").arg(errorMessage); - showMessage(errorMessage, LogError); + m_engine->showMessage(errorMessage, LogError); } } @@ -713,7 +713,7 @@ bool CdbDebugEnginePrivate::executeContinueCommand(const QString &command) clearForRun(); updateCodeLevel(); // Step by instruction m_engine->setState(InferiorRunningRequested, Q_FUNC_INFO, __LINE__); - showMessage(CdbDebugEngine::tr("Continuing with '%1'...").arg(command)); + m_engine->showMessage(CdbDebugEngine::tr("Continuing with '%1'...").arg(command)); QString errorMessage; const bool success = executeDebuggerCommand(command, &errorMessage); if (success) { @@ -1296,7 +1296,7 @@ void CdbDebugEnginePrivate::notifyException(long code, bool fatal, const QString break; case EXCEPTION_BREAKPOINT: if (m_ignoreInitialBreakPoint && !m_inferiorStartupComplete && m_breakEventMode == BreakEventHandle) { - showMessage(CdbDebugEngine::tr("Ignoring initial breakpoint...")); + m_engine->showMessage(CdbDebugEngine::tr("Ignoring initial breakpoint...")); m_breakEventMode = BreakEventIgnoreOnce; } break; @@ -1356,7 +1356,7 @@ void CdbDebugEnginePrivate::handleDebugEvent() const QString msg = m_interrupted ? CdbDebugEngine::tr("Interrupted in thread %1, current thread: %2").arg(m_interruptArticifialThreadId).arg(m_currentThreadId) : CdbDebugEngine::tr("Stopped, current thread: %1").arg(m_currentThreadId); - showMessage(msg); + m_engine->showMessage(msg); const int threadIndex = threadIndexById(threadsHandler, m_currentThreadId); if (threadIndex != -1) threadsHandler->setCurrentThread(threadIndex); diff --git a/src/plugins/debugger/cdb/cdbdebugoutput.cpp b/src/plugins/debugger/cdb/cdbdebugoutput.cpp index c96435e3a3c..fb448b280b0 100644 --- a/src/plugins/debugger/cdb/cdbdebugoutput.cpp +++ b/src/plugins/debugger/cdb/cdbdebugoutput.cpp @@ -51,13 +51,13 @@ static int logChannel(ULONG mask) return LogError; if (mask & DEBUG_OUTPUT_DEBUGGEE) //return DebuggeeOutput; - return AppOut; + return AppOutput; if (mask & DEBUG_OUTPUT_DEBUGGEE_PROMPT) //return DebuggeePromptOutput; - return AppErr; + return AppError; if (mask & DEBUG_OUTPUT_PROMPT) //return DebuggerPromptOutput; - return AppErr; + return AppError; return LogMisc; } diff --git a/src/plugins/debugger/cdb/cdbdumperhelper.cpp b/src/plugins/debugger/cdb/cdbdumperhelper.cpp index 8ece900f1f2..3cd8588c6a1 100644 --- a/src/plugins/debugger/cdb/cdbdumperhelper.cpp +++ b/src/plugins/debugger/cdb/cdbdumperhelper.cpp @@ -29,6 +29,7 @@ #include "cdbdumperhelper.h" #include "cdbmodules.h" +#include "cdbdebugengine.h" #include "cdbdebugengine_p.h" #include "cdbdebugoutput.h" #include "cdbdebugeventcallback.h" @@ -196,7 +197,7 @@ public: virtual void run(); signals: - void logMessage(int channel, const QString &m); + void logMessage(const QString &m, int channel); void statusMessage(const QString &m, int timeOut); private: @@ -233,8 +234,8 @@ bool CdbDumperInitThread::ensureDumperInitialized(CdbDumperHelper &h, QString *e connect(&thread, SIGNAL(statusMessage(QString,int)), h.m_engine, SLOT(showStatusMessage(QString,int)), Qt::QueuedConnection); - connect(&thread, SIGNAL(logMessage(int,QString)), - h.m_engine, SLOT(showMessage(int,QString)), + connect(&thread, SIGNAL(logMessage(QString,int)), + h.m_engine, SLOT(showMessage(QString,int)), Qt::QueuedConnection); QEventLoop eventLoop; connect(&thread, SIGNAL(finished()), &eventLoop, SLOT(quit()), Qt::QueuedConnection); @@ -250,7 +251,7 @@ bool CdbDumperInitThread::ensureDumperInitialized(CdbDumperHelper &h, QString *e h.m_state = CdbDumperHelper::Disabled; // No message here *errorMessage = QCoreApplication::translate("Debugger::Internal::CdbDumperHelper", "The custom dumper library could not be initialized: %1").arg(*errorMessage); h.m_engine->showStatusMessage(*errorMessage, messageTimeOut); - h.m_engine->showQtDumperLibraryWarning(*errorMessage); + h.m_engine->manager()->showQtDumperLibraryWarning(*errorMessage); } if (loadDebug) qDebug() << Q_FUNC_INFO << '\n' << thread.m_ok; @@ -269,7 +270,7 @@ void CdbDumperInitThread ::run() switch (m_helper.initCallLoad(m_errorMessage)) { case CdbDumperHelper::CallLoadOk: case CdbDumperHelper::CallLoadAlreadyLoaded: - emit logMessage(LogMisc, msgLoadSucceeded(m_helper.m_library, false)); + emit logMessage(msgLoadSucceeded(m_helper.m_library, false), LogMisc); m_helper.m_state = CdbDumperHelper::Loaded; break; case CdbDumperHelper::CallLoadError: @@ -277,7 +278,7 @@ void CdbDumperInitThread ::run() m_ok = false; return; case CdbDumperHelper::CallLoadNoQtApp: - emit logMessage(LogMisc, QCoreApplication::translate("Debugger::Internal::CdbDumperHelper", "The debuggee does not appear to be Qt application.")); + emit logMessage(QCoreApplication::translate("Debugger::Internal::CdbDumperHelper", "The debuggee does not appear to be Qt application."), LogMisc); m_helper.m_state = CdbDumperHelper::Disabled; // No message here m_ok = true; return; diff --git a/src/plugins/debugger/cdb/cdbdumperhelper.h b/src/plugins/debugger/cdb/cdbdumperhelper.h index 916d168428c..be9b10adb16 100644 --- a/src/plugins/debugger/cdb/cdbdumperhelper.h +++ b/src/plugins/debugger/cdb/cdbdumperhelper.h @@ -46,6 +46,7 @@ class DebuggerManager; namespace Internal { class CdbDumperInitThread; +class CdbDebugEngine; /* For code clarity, all the stuff related to custom dumpers goes here. * "Custom dumper" is a library compiled against the current diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index ade13b87325..a5f66a99854 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -332,6 +332,7 @@ DebuggerManagerPrivate::DebuggerManagerPrivate(DebuggerManager *manager) : m_disassemblerViewAgent(manager), m_engine(0) { + m_runControl = 0; m_interruptIcon.addFile(":/debugger/images/debugger_interrupt.png"); m_stopIcon.addFile(":/debugger/images/debugger_stop.png"); } diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 9d7b7a8738e..f5b0a34e296 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -199,6 +199,8 @@ void DebuggerRunControl::start() void DebuggerRunControl::showMessage(const QString &msg, int channel, int timeout) { + if (!m_manager) + return; DebuggerOutputWindow *ow = m_manager->debuggerOutputWindow(); QTC_ASSERT(ow, return); switch (channel) { diff --git a/src/plugins/debugger/idebuggerengine.h b/src/plugins/debugger/idebuggerengine.h index bb636b7964d..2ad5024c2c9 100644 --- a/src/plugins/debugger/idebuggerengine.h +++ b/src/plugins/debugger/idebuggerengine.h @@ -136,11 +136,11 @@ public: void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1) const; void showStatusMessage(const QString &msg, int timeout = -1) const { showMessage(msg, StatusBar, timeout); } + DebuggerManager *manager() const { return m_manager; } protected: DebuggerState state() const; void setState(DebuggerState state, bool forced = false); - DebuggerManager *manager() const { return m_manager; } DebuggerManager *m_manager; DebuggerRunControl *m_runControl;