forked from qt-creator/qt-creator
debugger: more message channeling
This commit is contained in:
@@ -328,7 +328,7 @@ void CdbDebugEnginePrivate::checkVersion()
|
|||||||
}
|
}
|
||||||
// Compare
|
// Compare
|
||||||
const double minVersion = 6.11;
|
const double minVersion = 6.11;
|
||||||
manager()->showDebuggerOutput(LogMisc, CdbDebugEngine::tr("Version: %1").arg(version));
|
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) "
|
||||||
@@ -410,7 +410,7 @@ void CdbDebugEngine::startDebugger()
|
|||||||
// Options
|
// Options
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!m_d->setBreakOnThrow(theDebuggerBoolSetting(BreakOnThrow), &errorMessage))
|
if (!m_d->setBreakOnThrow(theDebuggerBoolSetting(BreakOnThrow), &errorMessage))
|
||||||
manager()->showDebuggerOutput(LogWarning, errorMessage);
|
showMessage(errorMessage, LogWarning);
|
||||||
m_d->setVerboseSymbolLoading(m_d->m_options->verboseSymbolLoading);
|
m_d->setVerboseSymbolLoading(m_d->m_options->verboseSymbolLoading);
|
||||||
// Figure out dumper. @TODO: same in gdb...
|
// Figure out dumper. @TODO: same in gdb...
|
||||||
const QString dumperLibName = QDir::toNativeSeparators(manager()->qtDumperLibraryName());
|
const QString dumperLibName = QDir::toNativeSeparators(manager()->qtDumperLibraryName());
|
||||||
@@ -532,7 +532,7 @@ void CdbDebugEnginePrivate::processCreatedAttached(ULONG64 processHandle, ULONG6
|
|||||||
|
|
||||||
void CdbDebugEngine::processTerminated(unsigned long exitCode)
|
void CdbDebugEngine::processTerminated(unsigned long exitCode)
|
||||||
{
|
{
|
||||||
manager()->showDebuggerOutput(LogMisc, tr("The process exited with exit code %1.").arg(exitCode));
|
showMessage(tr("The process exited with exit code %1.").arg(exitCode));
|
||||||
if (state() != InferiorStopping)
|
if (state() != InferiorStopping)
|
||||||
setState(InferiorStopping, Q_FUNC_INFO, __LINE__);
|
setState(InferiorStopping, Q_FUNC_INFO, __LINE__);
|
||||||
setState(InferiorStopped, Q_FUNC_INFO, __LINE__);
|
setState(InferiorStopped, Q_FUNC_INFO, __LINE__);
|
||||||
@@ -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);
|
||||||
manager()->showDebuggerOutput(LogError, errorMessage);
|
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);
|
||||||
manager()->showDebuggerOutput(LogError, errorMessage);
|
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__);
|
||||||
manager()->showDebuggerOutput(LogMisc, CdbDebugEngine::tr("Continuing with '%1'...").arg(command));
|
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) {
|
||||||
@@ -795,7 +795,7 @@ bool CdbDebugEngine::step(unsigned long executionStatus)
|
|||||||
str << "gu";
|
str << "gu";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
manager()->showDebuggerOutput(tr("Stepping %1").arg(command));
|
showMessage(tr("Stepping %1").arg(command));
|
||||||
const HRESULT hr = m_d->interfaces().debugControl->Execute(DEBUG_OUTCTL_THIS_CLIENT, command.toLatin1().constData(), DEBUG_EXECUTE_ECHO);
|
const HRESULT hr = m_d->interfaces().debugControl->Execute(DEBUG_OUTCTL_THIS_CLIENT, command.toLatin1().constData(), DEBUG_EXECUTE_ECHO);
|
||||||
success = SUCCEEDED(hr);
|
success = SUCCEEDED(hr);
|
||||||
if (!success)
|
if (!success)
|
||||||
@@ -931,7 +931,7 @@ void CdbDebugEngine::slotBreakAttachToCrashed()
|
|||||||
// Force a break when attaching to crashed process (if Creator was not spawned
|
// Force a break when attaching to crashed process (if Creator was not spawned
|
||||||
// from handler).
|
// from handler).
|
||||||
if (state() != InferiorStopped) {
|
if (state() != InferiorStopped) {
|
||||||
manager()->showDebuggerOutput(LogMisc, QLatin1String("Forcing break..."));
|
showMessage(QLatin1String("Forcing break..."));
|
||||||
m_d->m_dumper->disable();
|
m_d->m_dumper->disable();
|
||||||
interruptInferior();
|
interruptInferior();
|
||||||
}
|
}
|
||||||
@@ -952,7 +952,7 @@ void CdbDebugEngine::interruptInferior()
|
|||||||
|
|
||||||
void CdbDebugEngine::executeRunToLine(const QString &fileName, int lineNumber)
|
void CdbDebugEngine::executeRunToLine(const QString &fileName, int lineNumber)
|
||||||
{
|
{
|
||||||
manager()->showDebuggerOutput(LogMisc, tr("Running up to %1:%2...").arg(fileName).arg(lineNumber));
|
showMessage(tr("Running up to %1:%2...").arg(fileName).arg(lineNumber));
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
CdbCore::BreakPoint tempBreakPoint;
|
CdbCore::BreakPoint tempBreakPoint;
|
||||||
tempBreakPoint.fileName = fileName;
|
tempBreakPoint.fileName = fileName;
|
||||||
@@ -966,7 +966,7 @@ void CdbDebugEngine::executeRunToLine(const QString &fileName, int lineNumber)
|
|||||||
|
|
||||||
void CdbDebugEngine::executeRunToFunction(const QString &functionName)
|
void CdbDebugEngine::executeRunToFunction(const QString &functionName)
|
||||||
{
|
{
|
||||||
manager()->showDebuggerOutput(LogMisc, tr("Running up to function '%1()'...").arg(functionName));
|
showMessage(tr("Running up to function '%1()'...").arg(functionName));
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
CdbCore::BreakPoint tempBreakPoint;
|
CdbCore::BreakPoint tempBreakPoint;
|
||||||
tempBreakPoint.funcName = functionName;
|
tempBreakPoint.funcName = functionName;
|
||||||
@@ -1277,10 +1277,10 @@ void CdbDebugEngine::slotConsoleStubTerminated()
|
|||||||
exitDebugger();
|
exitDebugger();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbDebugEngine::warning(const QString &w)
|
void CdbDebugEngine::warning(const QString &msg)
|
||||||
{
|
{
|
||||||
manager()->showDebuggerOutput(LogWarning, w);
|
showMessage(msg, LogWarning);
|
||||||
qWarning("%s\n", qPrintable(w));
|
qWarning("%s\n", qPrintable(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbDebugEnginePrivate::notifyException(long code, bool fatal, const QString &message)
|
void CdbDebugEnginePrivate::notifyException(long code, bool fatal, const QString &message)
|
||||||
@@ -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) {
|
||||||
manager()->showDebuggerOutput(LogMisc, CdbDebugEngine::tr("Ignoring initial breakpoint..."));
|
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);
|
||||||
manager()->showDebuggerOutput(LogMisc, msg);
|
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);
|
||||||
|
@@ -79,8 +79,8 @@ STDMETHODIMP CdbDebugEventCallback::Exception(
|
|||||||
const bool fatal = isFatalException(Exception->ExceptionCode);
|
const bool fatal = isFatalException(Exception->ExceptionCode);
|
||||||
if (debugCDB)
|
if (debugCDB)
|
||||||
qDebug() << Q_FUNC_INFO << "\nex=" << Exception->ExceptionCode << " fatal=" << fatal << msg;
|
qDebug() << Q_FUNC_INFO << "\nex=" << Exception->ExceptionCode << " fatal=" << fatal << msg;
|
||||||
m_pEngine->manager()->showApplicationOutput(msg, true);
|
m_pEngine->showMessage(msg, AppError);
|
||||||
m_pEngine->manager()->showDebuggerOutput(LogMisc, msg);
|
m_pEngine->showMessage(msg, LogMisc);
|
||||||
m_pEngine->m_d->notifyException(Exception->ExceptionCode, fatal, msg);
|
m_pEngine->m_d->notifyException(Exception->ExceptionCode, fatal, msg);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
@@ -207,11 +207,10 @@ STDMETHODIMP CdbDebugEventCallback::SystemError(
|
|||||||
|
|
||||||
// -----------ExceptionLoggerEventCallback
|
// -----------ExceptionLoggerEventCallback
|
||||||
CdbExceptionLoggerEventCallback::CdbExceptionLoggerEventCallback(int logChannel,
|
CdbExceptionLoggerEventCallback::CdbExceptionLoggerEventCallback(int logChannel,
|
||||||
bool skipNonFatalExceptions,
|
bool skipNonFatalExceptions, CdbDebugEngine *engine) :
|
||||||
DebuggerManager *manager) :
|
|
||||||
m_logChannel(logChannel),
|
m_logChannel(logChannel),
|
||||||
m_skipNonFatalExceptions(skipNonFatalExceptions),
|
m_skipNonFatalExceptions(skipNonFatalExceptions),
|
||||||
m_manager(manager)
|
m_engine(engine)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,15 +227,15 @@ STDMETHODIMP CdbExceptionLoggerEventCallback::Exception(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const bool recordException = !m_skipNonFatalExceptions || isFatalException(Exception->ExceptionCode);
|
const bool recordException = !m_skipNonFatalExceptions || isFatalException(Exception->ExceptionCode);
|
||||||
QString message;
|
QString msg;
|
||||||
formatException(Exception, QTextStream(&message));
|
formatException(Exception, QTextStream(&msg));
|
||||||
if (recordException) {
|
if (recordException) {
|
||||||
m_exceptionCodes.push_back(Exception->ExceptionCode);
|
m_exceptionCodes.push_back(Exception->ExceptionCode);
|
||||||
m_exceptionMessages.push_back(message);
|
m_exceptionMessages.push_back(msg);
|
||||||
}
|
}
|
||||||
if (debugCDB)
|
if (debugCDB)
|
||||||
qDebug() << Q_FUNC_INFO << '\n' << message;
|
qDebug() << Q_FUNC_INFO << '\n' << msg;
|
||||||
m_manager->showDebuggerOutput(m_logChannel, message);
|
m_engine->showMessage(msg, m_logChannel);
|
||||||
if (recordException)
|
if (recordException)
|
||||||
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@@ -35,8 +35,6 @@
|
|||||||
#include <QtCore/QStringList>
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
class DebuggerManager;
|
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class CdbDebugEngine;
|
class CdbDebugEngine;
|
||||||
@@ -129,7 +127,7 @@ class CdbExceptionLoggerEventCallback : public CdbCore::DebugEventCallbackBase
|
|||||||
public:
|
public:
|
||||||
CdbExceptionLoggerEventCallback(int logChannel,
|
CdbExceptionLoggerEventCallback(int logChannel,
|
||||||
bool skipNonFatalExceptions,
|
bool skipNonFatalExceptions,
|
||||||
DebuggerManager *access);
|
CdbDebugEngine *engine);
|
||||||
|
|
||||||
STDMETHOD(GetInterestMask)(
|
STDMETHOD(GetInterestMask)(
|
||||||
THIS_
|
THIS_
|
||||||
@@ -149,7 +147,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
const int m_logChannel;
|
const int m_logChannel;
|
||||||
const bool m_skipNonFatalExceptions;
|
const bool m_skipNonFatalExceptions;
|
||||||
DebuggerManager *m_manager;
|
CdbDebugEngine *m_engine;
|
||||||
QList<ULONG> m_exceptionCodes;
|
QList<ULONG> m_exceptionCodes;
|
||||||
QStringList m_exceptionMessages;
|
QStringList m_exceptionMessages;
|
||||||
};
|
};
|
||||||
|
@@ -99,7 +99,7 @@ namespace Internal {
|
|||||||
// the QtCored4.pdb file to be present as we need "qstrdup"
|
// the QtCored4.pdb file to be present as we need "qstrdup"
|
||||||
// as dummy symbol. This is ok ATM since dumpers only
|
// as dummy symbol. This is ok ATM since dumpers only
|
||||||
// make sense for Qt apps.
|
// make sense for Qt apps.
|
||||||
static bool debuggeeLoadLibrary(DebuggerManager *manager,
|
static bool debuggeeLoadLibrary(CdbDebugEngine *manager,
|
||||||
CdbCore::CoreEngine *engine,
|
CdbCore::CoreEngine *engine,
|
||||||
unsigned long threadId,
|
unsigned long threadId,
|
||||||
const QString &moduleName,
|
const QString &moduleName,
|
||||||
@@ -231,10 +231,10 @@ bool CdbDumperInitThread::ensureDumperInitialized(CdbDumperHelper &h, QString *e
|
|||||||
QApplication::setOverrideCursor(Qt::BusyCursor);
|
QApplication::setOverrideCursor(Qt::BusyCursor);
|
||||||
CdbDumperInitThread thread(h, errorMessage);
|
CdbDumperInitThread thread(h, errorMessage);
|
||||||
connect(&thread, SIGNAL(statusMessage(QString,int)),
|
connect(&thread, SIGNAL(statusMessage(QString,int)),
|
||||||
h.m_manager, 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(int,QString)),
|
||||||
h.m_manager, SLOT(showDebuggerOutput(int,QString)),
|
h.m_engine, SLOT(showMessage(int,QString)),
|
||||||
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);
|
||||||
@@ -243,14 +243,14 @@ bool CdbDumperInitThread::ensureDumperInitialized(CdbDumperHelper &h, QString *e
|
|||||||
eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
|
eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
if (thread.m_ok) {
|
if (thread.m_ok) {
|
||||||
h.m_manager->showStatusMessage(QCoreApplication::translate("Debugger::Internal::CdbDumperHelper", "Stopped / Custom dumper library initialized."), messageTimeOut);
|
h.m_engine->showStatusMessage(QCoreApplication::translate("Debugger::Internal::CdbDumperHelper", "Stopped / Custom dumper library initialized."), messageTimeOut);
|
||||||
h.m_manager->showDebuggerOutput(LogMisc, h.m_helper.toString());
|
h.m_engine->showMessage(h.m_helper.toString());
|
||||||
h.m_state = CdbDumperHelper::Initialized;
|
h.m_state = CdbDumperHelper::Initialized;
|
||||||
} else {
|
} else {
|
||||||
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_manager->showStatusMessage(*errorMessage, messageTimeOut);
|
h.m_engine->showStatusMessage(*errorMessage, messageTimeOut);
|
||||||
h.m_manager->showQtDumperLibraryWarning(*errorMessage);
|
h.m_engine->showQtDumperLibraryWarning(*errorMessage);
|
||||||
}
|
}
|
||||||
if (loadDebug)
|
if (loadDebug)
|
||||||
qDebug() << Q_FUNC_INFO << '\n' << thread.m_ok;
|
qDebug() << Q_FUNC_INFO << '\n' << thread.m_ok;
|
||||||
@@ -293,13 +293,13 @@ void CdbDumperInitThread ::run()
|
|||||||
|
|
||||||
// ------------------- CdbDumperHelper
|
// ------------------- CdbDumperHelper
|
||||||
|
|
||||||
CdbDumperHelper::CdbDumperHelper(DebuggerManager *manager,
|
CdbDumperHelper::CdbDumperHelper(CdbDebugEngine *engine,
|
||||||
CdbCore::CoreEngine *coreEngine) :
|
CdbCore::CoreEngine *coreEngine) :
|
||||||
m_tryInjectLoad(true),
|
m_tryInjectLoad(true),
|
||||||
m_msgDisabled(QLatin1String("Dumpers are disabled")),
|
m_msgDisabled(QLatin1String("Dumpers are disabled")),
|
||||||
m_msgNotInScope(QLatin1String("Data not in scope")),
|
m_msgNotInScope(QLatin1String("Data not in scope")),
|
||||||
m_state(NotLoaded),
|
m_state(NotLoaded),
|
||||||
m_manager(manager),
|
m_engine(engine),
|
||||||
m_coreEngine(coreEngine),
|
m_coreEngine(coreEngine),
|
||||||
m_inBufferAddress(0),
|
m_inBufferAddress(0),
|
||||||
m_inBufferSize(0),
|
m_inBufferSize(0),
|
||||||
@@ -320,7 +320,7 @@ void CdbDumperHelper::disable()
|
|||||||
{
|
{
|
||||||
if (loadDebug)
|
if (loadDebug)
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
m_manager->showDebuggerOutput(LogMisc, QCoreApplication::translate("Debugger::Internal::CdbDumperHelper", "Disabling dumpers due to debuggee crash..."));
|
m_engine->showMessage(QCoreApplication::translate("Debugger::Internal::CdbDumperHelper", "Disabling dumpers due to debuggee crash..."));
|
||||||
m_state = Disabled;
|
m_state = Disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,7 +359,7 @@ void CdbDumperHelper::moduleLoadHook(const QString &module, HANDLE debuggeeHandl
|
|||||||
// for the thread to finish as this would lock up.
|
// for the thread to finish as this would lock up.
|
||||||
if (m_tryInjectLoad && module.contains(QLatin1String("Qt"), Qt::CaseInsensitive)) {
|
if (m_tryInjectLoad && module.contains(QLatin1String("Qt"), Qt::CaseInsensitive)) {
|
||||||
// Also shows up in the log window.
|
// Also shows up in the log window.
|
||||||
m_manager->showStatusMessage(msgLoading(m_library, true), messageTimeOut);
|
m_engine->showMessage(msgLoading(m_library, true), StatusBar, messageTimeOut);
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
SharedLibraryInjector sh(GetProcessId(debuggeeHandle));
|
SharedLibraryInjector sh(GetProcessId(debuggeeHandle));
|
||||||
if (sh.remoteInject(m_library, false, &errorMessage)) {
|
if (sh.remoteInject(m_library, false, &errorMessage)) {
|
||||||
@@ -367,7 +367,7 @@ void CdbDumperHelper::moduleLoadHook(const QString &module, HANDLE debuggeeHandl
|
|||||||
} else {
|
} else {
|
||||||
m_state = InjectLoadFailed;
|
m_state = InjectLoadFailed;
|
||||||
// Ok, try call loading...
|
// Ok, try call loading...
|
||||||
m_manager->showDebuggerOutput(LogMisc, msgLoadFailed(m_library, true, errorMessage));
|
m_engine->showMessage(msgLoadFailed(m_library, true, errorMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -375,7 +375,7 @@ void CdbDumperHelper::moduleLoadHook(const QString &module, HANDLE debuggeeHandl
|
|||||||
// check if gdbmacros.dll loaded
|
// check if gdbmacros.dll loaded
|
||||||
if (module.contains(QLatin1String(dumperModuleNameC), Qt::CaseInsensitive)) {
|
if (module.contains(QLatin1String(dumperModuleNameC), Qt::CaseInsensitive)) {
|
||||||
m_state = Loaded;
|
m_state = Loaded;
|
||||||
m_manager->showDebuggerOutput(LogMisc, msgLoadSucceeded(m_library, true));
|
m_engine->showMessage(msgLoadSucceeded(m_library, true));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,7 @@ CdbDumperHelper::CallLoadResult CdbDumperHelper::initCallLoad(QString *errorMess
|
|||||||
if (modules.filter(QLatin1String(qtCoreModuleNameC), Qt::CaseInsensitive).isEmpty())
|
if (modules.filter(QLatin1String(qtCoreModuleNameC), Qt::CaseInsensitive).isEmpty())
|
||||||
return CallLoadNoQtApp;
|
return CallLoadNoQtApp;
|
||||||
// Try to load
|
// Try to load
|
||||||
if (!debuggeeLoadLibrary(m_manager, m_coreEngine, m_dumperCallThread, m_library, errorMessage))
|
if (!debuggeeLoadLibrary(m_engine, m_coreEngine, m_dumperCallThread, m_library, errorMessage))
|
||||||
return CallLoadError;
|
return CallLoadError;
|
||||||
return CallLoadOk;
|
return CallLoadOk;
|
||||||
}
|
}
|
||||||
@@ -493,7 +493,8 @@ CdbDumperHelper::CallResult
|
|||||||
{
|
{
|
||||||
*outDataPtr = 0;
|
*outDataPtr = 0;
|
||||||
// Skip stray startup-complete trap exceptions.
|
// Skip stray startup-complete trap exceptions.
|
||||||
QSharedPointer<CdbExceptionLoggerEventCallback> exLogger(new CdbExceptionLoggerEventCallback(LogWarning, true, m_manager));
|
QSharedPointer<CdbExceptionLoggerEventCallback> exLogger(new
|
||||||
|
CdbExceptionLoggerEventCallback(LogWarning, true, m_engine));
|
||||||
CdbCore::EventCallbackRedirector eventRedir(m_coreEngine, exLogger);
|
CdbCore::EventCallbackRedirector eventRedir(m_coreEngine, exLogger);
|
||||||
Q_UNUSED(eventRedir)
|
Q_UNUSED(eventRedir)
|
||||||
// write input buffer
|
// write input buffer
|
||||||
@@ -630,7 +631,7 @@ CdbDumperHelper::DumpResult CdbDumperHelper::dumpTypeI(const WatchData &wd, bool
|
|||||||
// Ensure types are parsed and known.
|
// Ensure types are parsed and known.
|
||||||
if (!CdbDumperInitThread::ensureDumperInitialized(*this, errorMessage)) {
|
if (!CdbDumperInitThread::ensureDumperInitialized(*this, errorMessage)) {
|
||||||
*errorMessage = msgDumpFailed(wd, errorMessage);
|
*errorMessage = msgDumpFailed(wd, errorMessage);
|
||||||
m_manager->showDebuggerOutput(LogError, *errorMessage);
|
m_engine->showMessage(*errorMessage, LogError);
|
||||||
return DumpError;
|
return DumpError;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -647,7 +648,7 @@ CdbDumperHelper::DumpResult CdbDumperHelper::dumpTypeI(const WatchData &wd, bool
|
|||||||
const QString message = QCoreApplication::translate("Debugger::Internal::CdbDumperHelper",
|
const QString message = QCoreApplication::translate("Debugger::Internal::CdbDumperHelper",
|
||||||
"Querying dumpers for '%1'/'%2' (%3)").
|
"Querying dumpers for '%1'/'%2' (%3)").
|
||||||
arg(QString::fromLatin1(wd.iname), wd.exp, wd.type);
|
arg(QString::fromLatin1(wd.iname), wd.exp, wd.type);
|
||||||
m_manager->showDebuggerOutput(LogMisc, message);
|
m_engine->showMessage(message);
|
||||||
|
|
||||||
const DumpExecuteResult der = executeDump(wd, td, dumpChildren, result, errorMessage);
|
const DumpExecuteResult der = executeDump(wd, td, dumpChildren, result, errorMessage);
|
||||||
if (der == DumpExecuteOk)
|
if (der == DumpExecuteOk)
|
||||||
@@ -659,7 +660,7 @@ CdbDumperHelper::DumpResult CdbDumperHelper::dumpTypeI(const WatchData &wd, bool
|
|||||||
}
|
}
|
||||||
// log error
|
// log error
|
||||||
*errorMessage = msgDumpFailed(wd, errorMessage);
|
*errorMessage = msgDumpFailed(wd, errorMessage);
|
||||||
m_manager->showDebuggerOutput(LogWarning, *errorMessage);
|
m_engine->showMessage(*errorMessage, LogWarning);
|
||||||
return DumpError;
|
return DumpError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,7 +85,7 @@ public:
|
|||||||
Initialized, // List of types, etc. retrieved
|
Initialized, // List of types, etc. retrieved
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit CdbDumperHelper(DebuggerManager *manager,
|
explicit CdbDumperHelper(CdbDebugEngine *engine,
|
||||||
CdbCore::CoreEngine *coreEngine);
|
CdbCore::CoreEngine *coreEngine);
|
||||||
~CdbDumperHelper();
|
~CdbDumperHelper();
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ private:
|
|||||||
const QString m_msgDisabled;
|
const QString m_msgDisabled;
|
||||||
const QString m_msgNotInScope;
|
const QString m_msgNotInScope;
|
||||||
State m_state;
|
State m_state;
|
||||||
DebuggerManager *m_manager;
|
CdbDebugEngine *m_engine;
|
||||||
CdbCore::CoreEngine *m_coreEngine;
|
CdbCore::CoreEngine *m_coreEngine;
|
||||||
|
|
||||||
QString m_library;
|
QString m_library;
|
||||||
|
Reference in New Issue
Block a user