Compile fixes

Wrote down what hjk told me.
This commit is contained in:
Robert Loehning
2010-06-14 19:09:18 +02:00
parent d26b53e1b9
commit 5b30072731
7 changed files with 22 additions and 17 deletions

View File

@@ -126,7 +126,7 @@ CdbDebugEnginePrivate::CdbDebugEnginePrivate(DebuggerManager *manager,
m_hDebuggeeProcess(0), m_hDebuggeeProcess(0),
m_hDebuggeeThread(0), m_hDebuggeeThread(0),
m_breakEventMode(BreakEventHandle), m_breakEventMode(BreakEventHandle),
m_dumper(new CdbDumperHelper(manager, this)), m_dumper(new CdbDumperHelper(engine, this)),
m_currentThreadId(-1), m_currentThreadId(-1),
m_eventThreadId(-1), m_eventThreadId(-1),
m_interruptArticifialThreadId(-1), m_interruptArticifialThreadId(-1),
@@ -328,7 +328,7 @@ void CdbDebugEnginePrivate::checkVersion()
} }
// Compare // Compare
const double minVersion = 6.11; 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) { if (version.toDouble() < minVersion) {
const QString msg = CdbDebugEngine::tr( const QString msg = CdbDebugEngine::tr(
"<html>The installed version of the <i>Debugging Tools for Windows</i> (%1) " "<html>The installed version of the <i>Debugging Tools for Windows</i> (%1) "
@@ -612,7 +612,7 @@ void CdbDebugEnginePrivate::endDebugging(EndDebuggingMode em)
// Need a stopped debuggee to act // Need a stopped debuggee to act
if (!endInferior(action, &errorMessage)) { if (!endInferior(action, &errorMessage)) {
errorMessage = QString::fromLatin1("Unable to detach from/end the debuggee: %1").arg(errorMessage); errorMessage = QString::fromLatin1("Unable to detach from/end the debuggee: %1").arg(errorMessage);
showMessage(errorMessage, LogError); m_engine->showMessage(errorMessage, LogError);
} }
errorMessage.clear(); errorMessage.clear();
} }
@@ -623,7 +623,7 @@ void CdbDebugEnginePrivate::endDebugging(EndDebuggingMode em)
m_engine->setState(DebuggerNotReady, Q_FUNC_INFO, __LINE__); m_engine->setState(DebuggerNotReady, Q_FUNC_INFO, __LINE__);
if (!endedCleanly) { if (!endedCleanly) {
errorMessage = QString::fromLatin1("There were errors trying to end debugging:\n%1").arg(errorMessage); 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(); clearForRun();
updateCodeLevel(); // Step by instruction updateCodeLevel(); // Step by instruction
m_engine->setState(InferiorRunningRequested, Q_FUNC_INFO, __LINE__); 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; QString errorMessage;
const bool success = executeDebuggerCommand(command, &errorMessage); const bool success = executeDebuggerCommand(command, &errorMessage);
if (success) { if (success) {
@@ -1296,7 +1296,7 @@ void CdbDebugEnginePrivate::notifyException(long code, bool fatal, const QString
break; break;
case EXCEPTION_BREAKPOINT: case EXCEPTION_BREAKPOINT:
if (m_ignoreInitialBreakPoint && !m_inferiorStartupComplete && m_breakEventMode == BreakEventHandle) { 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; m_breakEventMode = BreakEventIgnoreOnce;
} }
break; break;
@@ -1356,7 +1356,7 @@ void CdbDebugEnginePrivate::handleDebugEvent()
const QString msg = m_interrupted ? const QString msg = m_interrupted ?
CdbDebugEngine::tr("Interrupted in thread %1, current thread: %2").arg(m_interruptArticifialThreadId).arg(m_currentThreadId) : CdbDebugEngine::tr("Interrupted in thread %1, current thread: %2").arg(m_interruptArticifialThreadId).arg(m_currentThreadId) :
CdbDebugEngine::tr("Stopped, current thread: %1").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); const int threadIndex = threadIndexById(threadsHandler, m_currentThreadId);
if (threadIndex != -1) if (threadIndex != -1)
threadsHandler->setCurrentThread(threadIndex); threadsHandler->setCurrentThread(threadIndex);

View File

@@ -51,13 +51,13 @@ static int logChannel(ULONG mask)
return LogError; return LogError;
if (mask & DEBUG_OUTPUT_DEBUGGEE) if (mask & DEBUG_OUTPUT_DEBUGGEE)
//return DebuggeeOutput; //return DebuggeeOutput;
return AppOut; return AppOutput;
if (mask & DEBUG_OUTPUT_DEBUGGEE_PROMPT) if (mask & DEBUG_OUTPUT_DEBUGGEE_PROMPT)
//return DebuggeePromptOutput; //return DebuggeePromptOutput;
return AppErr; return AppError;
if (mask & DEBUG_OUTPUT_PROMPT) if (mask & DEBUG_OUTPUT_PROMPT)
//return DebuggerPromptOutput; //return DebuggerPromptOutput;
return AppErr; return AppError;
return LogMisc; return LogMisc;
} }

View File

@@ -29,6 +29,7 @@
#include "cdbdumperhelper.h" #include "cdbdumperhelper.h"
#include "cdbmodules.h" #include "cdbmodules.h"
#include "cdbdebugengine.h"
#include "cdbdebugengine_p.h" #include "cdbdebugengine_p.h"
#include "cdbdebugoutput.h" #include "cdbdebugoutput.h"
#include "cdbdebugeventcallback.h" #include "cdbdebugeventcallback.h"
@@ -196,7 +197,7 @@ public:
virtual void run(); virtual void run();
signals: signals:
void logMessage(int channel, const QString &m); void logMessage(const QString &m, int channel);
void statusMessage(const QString &m, int timeOut); void statusMessage(const QString &m, int timeOut);
private: private:
@@ -233,8 +234,8 @@ bool CdbDumperInitThread::ensureDumperInitialized(CdbDumperHelper &h, QString *e
connect(&thread, SIGNAL(statusMessage(QString,int)), connect(&thread, SIGNAL(statusMessage(QString,int)),
h.m_engine, SLOT(showStatusMessage(QString,int)), h.m_engine, SLOT(showStatusMessage(QString,int)),
Qt::QueuedConnection); Qt::QueuedConnection);
connect(&thread, SIGNAL(logMessage(int,QString)), connect(&thread, SIGNAL(logMessage(QString,int)),
h.m_engine, SLOT(showMessage(int,QString)), h.m_engine, SLOT(showMessage(QString,int)),
Qt::QueuedConnection); Qt::QueuedConnection);
QEventLoop eventLoop; QEventLoop eventLoop;
connect(&thread, SIGNAL(finished()), &eventLoop, SLOT(quit()), Qt::QueuedConnection); 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 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); *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->showStatusMessage(*errorMessage, messageTimeOut);
h.m_engine->showQtDumperLibraryWarning(*errorMessage); h.m_engine->manager()->showQtDumperLibraryWarning(*errorMessage);
} }
if (loadDebug) if (loadDebug)
qDebug() << Q_FUNC_INFO << '\n' << thread.m_ok; qDebug() << Q_FUNC_INFO << '\n' << thread.m_ok;
@@ -269,7 +270,7 @@ void CdbDumperInitThread ::run()
switch (m_helper.initCallLoad(m_errorMessage)) { switch (m_helper.initCallLoad(m_errorMessage)) {
case CdbDumperHelper::CallLoadOk: case CdbDumperHelper::CallLoadOk:
case CdbDumperHelper::CallLoadAlreadyLoaded: 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; m_helper.m_state = CdbDumperHelper::Loaded;
break; break;
case CdbDumperHelper::CallLoadError: case CdbDumperHelper::CallLoadError:
@@ -277,7 +278,7 @@ void CdbDumperInitThread ::run()
m_ok = false; m_ok = false;
return; return;
case CdbDumperHelper::CallLoadNoQtApp: 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_helper.m_state = CdbDumperHelper::Disabled; // No message here
m_ok = true; m_ok = true;
return; return;

View File

@@ -46,6 +46,7 @@ class DebuggerManager;
namespace Internal { namespace Internal {
class CdbDumperInitThread; class CdbDumperInitThread;
class CdbDebugEngine;
/* For code clarity, all the stuff related to custom dumpers goes here. /* For code clarity, all the stuff related to custom dumpers goes here.
* "Custom dumper" is a library compiled against the current * "Custom dumper" is a library compiled against the current

View File

@@ -332,6 +332,7 @@ DebuggerManagerPrivate::DebuggerManagerPrivate(DebuggerManager *manager) :
m_disassemblerViewAgent(manager), m_disassemblerViewAgent(manager),
m_engine(0) m_engine(0)
{ {
m_runControl = 0;
m_interruptIcon.addFile(":/debugger/images/debugger_interrupt.png"); m_interruptIcon.addFile(":/debugger/images/debugger_interrupt.png");
m_stopIcon.addFile(":/debugger/images/debugger_stop.png"); m_stopIcon.addFile(":/debugger/images/debugger_stop.png");
} }

View File

@@ -199,6 +199,8 @@ void DebuggerRunControl::start()
void DebuggerRunControl::showMessage(const QString &msg, int channel, void DebuggerRunControl::showMessage(const QString &msg, int channel,
int timeout) int timeout)
{ {
if (!m_manager)
return;
DebuggerOutputWindow *ow = m_manager->debuggerOutputWindow(); DebuggerOutputWindow *ow = m_manager->debuggerOutputWindow();
QTC_ASSERT(ow, return); QTC_ASSERT(ow, return);
switch (channel) { switch (channel) {

View File

@@ -136,11 +136,11 @@ public:
void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1) const; void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1) const;
void showStatusMessage(const QString &msg, int timeout = -1) const void showStatusMessage(const QString &msg, int timeout = -1) const
{ showMessage(msg, StatusBar, timeout); } { showMessage(msg, StatusBar, timeout); }
DebuggerManager *manager() const { return m_manager; }
protected: protected:
DebuggerState state() const; DebuggerState state() const;
void setState(DebuggerState state, bool forced = false); void setState(DebuggerState state, bool forced = false);
DebuggerManager *manager() const { return m_manager; }
DebuggerManager *m_manager; DebuggerManager *m_manager;
DebuggerRunControl *m_runControl; DebuggerRunControl *m_runControl;