From 2a9f019e7290f5bcc8cc01afddbbc17fe7feee6b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint <Friedemann.Kleint@nokia.com> Date: Thu, 25 Feb 2010 16:18:52 +0100 Subject: [PATCH] CDB: Bug fixing round. - Do not handle RPC_INVALID_SERVER as fatal exception - Do not expand internally dumped types (strings) - Expand pointers correctly (use correct type names for dumpers) --- src/plugins/debugger/cdb/cdbdumperhelper.cpp | 10 ++++++---- src/plugins/debugger/cdb/cdbexceptionutils.cpp | 8 ++++++++ src/plugins/debugger/cdb/cdbexceptionutils.h | 1 + src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp | 5 +++-- src/plugins/debugger/cdb/symbolgroupcontext.cpp | 9 ++++++--- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/plugins/debugger/cdb/cdbdumperhelper.cpp b/src/plugins/debugger/cdb/cdbdumperhelper.cpp index 164b0ad3cc1..cf2014ef277 100644 --- a/src/plugins/debugger/cdb/cdbdumperhelper.cpp +++ b/src/plugins/debugger/cdb/cdbdumperhelper.cpp @@ -570,7 +570,7 @@ CdbDumperHelper::CallResult static inline QString msgDumpFailed(const WatchData &wd, const QString *why) { - return QString::fromLatin1("Unable to dump '%1' (%2): %3").arg(wd.name, wd.type, *why); + return QString::fromLatin1("Unable to dump '%1' (%2): %3").arg(QString::fromLatin1(wd.iname), wd.type, *why); } static inline QString msgNotHandled(const QString &type) @@ -582,10 +582,12 @@ CdbDumperHelper::DumpResult CdbDumperHelper::dumpType(const WatchData &wd, bool QList<WatchData> *result, QString *errorMessage) { if (dumpDebug || debugCDBExecution) - qDebug() << ">dumpType() thread: " << m_dumperCallThread << " state: " << m_state << wd.type << QTime::currentTime().toString(); + qDebug() << ">dumpType() thread: " << m_dumperCallThread << " state: " << m_state + << wd.iname << wd.type << QTime::currentTime().toString(); const CdbDumperHelper::DumpResult rc = dumpTypeI(wd, dumpChildren, result, errorMessage); if (dumpDebug) - qDebug() << "<dumpType() state: " << m_state << wd.type << " returns " << rc << *errorMessage << QTime::currentTime().toString(); + qDebug() << "<dumpType() state: " << m_state << wd.iname + << wd.type << " returns " << rc << *errorMessage << QTime::currentTime().toString(); return rc; } @@ -644,7 +646,7 @@ CdbDumperHelper::DumpResult CdbDumperHelper::dumpTypeI(const WatchData &wd, bool // Now evaluate const QString message = QCoreApplication::translate("Debugger::Internal::CdbDumperHelper", "Querying dumpers for '%1'/'%2' (%3)"). - arg(wd.name, wd.exp, wd.type); + arg(QString::fromLatin1(wd.iname), wd.exp, wd.type); m_manager->showDebuggerOutput(LogMisc, message); const DumpExecuteResult der = executeDump(wd, td, dumpChildren, result, errorMessage); diff --git a/src/plugins/debugger/cdb/cdbexceptionutils.cpp b/src/plugins/debugger/cdb/cdbexceptionutils.cpp index 774ee3624df..7bcebf3ad1e 100644 --- a/src/plugins/debugger/cdb/cdbexceptionutils.cpp +++ b/src/plugins/debugger/cdb/cdbexceptionutils.cpp @@ -165,6 +165,7 @@ void formatException(const EXCEPTION_RECORD64 *e, QTextStream &str) break; case winExceptionDllNotFound: str << "DLL not found"; + break; case winExceptionDllEntryPointNoFound: str << "DLL entry point not found"; break; @@ -174,6 +175,12 @@ void formatException(const EXCEPTION_RECORD64 *e, QTextStream &str) case winExceptionMissingSystemFile: str << "System file is missing"; break; + case winExceptionRpcServerUnavailable: + str << "RPC server unavailable"; + break; + case winExceptionRpcServerInvalid: + str << "Invalid RPC server"; + break; case EXCEPTION_ACCESS_VIOLATION: { const bool writeOperation = e->ExceptionInformation[0]; str << (writeOperation ? "write" : "read") @@ -270,6 +277,7 @@ bool isFatalException(LONG code) case EXCEPTION_SINGLE_STEP: case winExceptionStartupCompleteTrap: // Mysterious exception at start of application case winExceptionRpcServerUnavailable: + case winExceptionRpcServerInvalid: case winExceptionDllNotFound: case winExceptionDllEntryPointNoFound: case winExceptionCppException: diff --git a/src/plugins/debugger/cdb/cdbexceptionutils.h b/src/plugins/debugger/cdb/cdbexceptionutils.h index a8456209a1c..8c6fb2174d6 100644 --- a/src/plugins/debugger/cdb/cdbexceptionutils.h +++ b/src/plugins/debugger/cdb/cdbexceptionutils.h @@ -50,6 +50,7 @@ namespace Internal { enum { winExceptionCppException = 0xe06d7363, winExceptionStartupCompleteTrap = 0x406d1388, winExceptionRpcServerUnavailable = 0x6ba, + winExceptionRpcServerInvalid = 0x6a6, winExceptionDllNotFound = 0xc0000135, winExceptionDllEntryPointNoFound = 0xc0000139, winExceptionDllInitFailed = 0xc0000142, diff --git a/src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp b/src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp index b4bc8492c8d..a1a7f526840 100644 --- a/src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp +++ b/src/plugins/debugger/cdb/cdbsymbolgroupcontext.cpp @@ -231,7 +231,7 @@ bool WatchHandleDumperInserter::expandPointerToDumpable(const WatchData &wd, QSt const QString hexAddrS = wd.value.mid(0, classPos); if (m_hexNullPattern.exactMatch(hexAddrS)) break; - const QString type = stripPointerType(wd.value.mid(classPos + 7)); + const QString type = stripPointerType(wd.type); WatchData derefedWd; derefedWd.setType(type); derefedWd.setAddress(hexAddrS); @@ -395,7 +395,8 @@ unsigned CdbSymbolGroupContext::watchDataAt(unsigned long index, WatchData *wd) bool CdbSymbolGroupContext::populateModelInitially(WatchHandler *wh, QString *errorMessage) { if (debugCDBWatchHandling) - qDebug() << "populateModelInitially dumpers=" << m_useDumpers; + qDebug() << "populateModelInitially dumpers=" << m_useDumpers + << toString(); // Recurse down items that are initially expanded in the view, stop processing for // dumper items. const CdbSymbolGroupRecursionContext rctx(this, OwnerSymbolGroupDumper); diff --git a/src/plugins/debugger/cdb/symbolgroupcontext.cpp b/src/plugins/debugger/cdb/symbolgroupcontext.cpp index 1f6c383286b..92c5a2099f1 100644 --- a/src/plugins/debugger/cdb/symbolgroupcontext.cpp +++ b/src/plugins/debugger/cdb/symbolgroupcontext.cpp @@ -37,7 +37,7 @@ #include <QtCore/QDebug> enum { debug = 0 }; -enum { debugInternalDumpers = 0 }; +enum { debugInternalDumpers = 1 }; // name separator for shadowed variables static const char iNameShadowDelimiter = '#'; @@ -578,6 +578,7 @@ unsigned SymbolGroupContext::dumpValue(unsigned long index, switch (drc) { case 0: rc |= InternalDumperSucceeded; + rc &= ~HasChildren; break; case 1: rc |= InternalDumperError; @@ -594,6 +595,7 @@ unsigned SymbolGroupContext::dumpValue(unsigned long index, switch (drc) { case 0: rc |= InternalDumperSucceeded; + rc &= ~HasChildren; break; case 1: rc |= InternalDumperError; @@ -610,9 +612,10 @@ unsigned SymbolGroupContext::dumpValue(unsigned long index, QString msg; QTextStream str(&msg); str.setIntegerBase(16); - str << "SymbolGroupContext::dump rc=0x" << rc << ' ' << *typeNameIn; + str << "SymbolGroupContext::dump rc=0x" << rc; str.setIntegerBase(10); - str << " (" << *typeIdIn << ") '" << *nameIn << "' '" << *valueIn << '\''; + str << " Type='" << *typeNameIn; + str << " (" << *typeIdIn << ") Name='" << *nameIn << "' Value='" << *valueIn << '\''; qDebug("%s", qPrintable(msg)); } return rc; -- GitLab