Commit 2a9f019e authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

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)
parent a8098cff
......@@ -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);
......
......@@ -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:
......
......@@ -50,6 +50,7 @@ namespace Internal {
enum { winExceptionCppException = 0xe06d7363,
winExceptionStartupCompleteTrap = 0x406d1388,
winExceptionRpcServerUnavailable = 0x6ba,
winExceptionRpcServerInvalid = 0x6a6,
winExceptionDllNotFound = 0xc0000135,
winExceptionDllEntryPointNoFound = 0xc0000139,
winExceptionDllInitFailed = 0xc0000142,
......
......@@ -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);
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment