Commit 3fd1e5b2 authored by Friedemann Kleint's avatar Friedemann Kleint

Debugger: Fix exit crash, dump QVariantList with gdb

Handle QVariantList within dumpers, as gdb does not resolve
typedefs. Disconnect the gdb process on exit, one more round
of event loop when quitting.
parent f244008a
......@@ -3590,10 +3590,16 @@ static void handleProtocolVersion2and3(QDumper &d)
break;
case 'V':
#ifndef QT_BOOTSTRAPPED
if (isEqual(type, "QVariant"))
if (isEqual(type, "QVariantList")) { // resolve typedef
d.outerType = "QList";
d.innerType = "QVariant";
d.extraInt[0] = sizeof(QVariant);
qDumpQList(d);
} else if (isEqual(type, "QVariant")) {
qDumpQVariant(d);
else if (isEqual(type, "QVector"))
} else if (isEqual(type, "QVector")) {
qDumpQVector(d);
}
#endif
break;
case 'W':
......@@ -3801,6 +3807,7 @@ void *qDumpObjectData440(
"\""NS"QStringList\","
"\""NS"QTextCodec\","
"\""NS"QVariant\","
"\""NS"QVariantList\","
"\""NS"QVector\","
#if QT_VERSION >= 0x040500
"\""NS"QMultiMap\","
......
......@@ -280,6 +280,27 @@ static int dumpQVariant()
return 0;
}
static int dumpQVariantList()
{
QVariantList test;
if (!optEmptyContainers) {
test.push_back(QVariant(QLatin1String("hallo")));
test.push_back(QVariant(42));
test.push_back(QVariant(3.141));
}
// As a list
prepareInBuffer("QList", "local.qvariantlist", "local.qvariantlist", "QVariant");
qDumpObjectData440(2, 42, testAddress(&test), 1, sizeof(QVariant), 0,0 ,0);
fputs(qDumpOutBuffer, stdout);
// As typedef
fputs("\n\n", stdout);
prepareInBuffer("QVariantList", "local.qvariantlist", "local.qvariantlist", "");
qDumpObjectData440(2, 42, testAddress(&test), 1, 0, 0,0 ,0);
fputs(qDumpOutBuffer, stdout);
fputc('\n', stdout);
return 0;
}
// --------------- std types
static int dumpStdString()
......@@ -548,6 +569,7 @@ static TypeDumpFunctionMap registerTypes()
rc.insert("QObject", dumpQObject);
rc.insert("QObjectList", dumpQObjectList);
rc.insert("QVariant", dumpQVariant);
rc.insert("QVariantList", dumpQVariantList);
return rc;
}
......
......@@ -256,6 +256,7 @@ bool DebuggerListener::coreAboutToClose()
if (answer == QMessageBox::No)
return false;
mgr->exitDebugger();
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
return true;
}
......
......@@ -225,7 +225,7 @@ QMainWindow *GdbEngine::mainWindow() const
GdbEngine::~GdbEngine()
{
// prevent sending error messages afterwards
disconnect(&m_gdbProc);
disconnect(&m_gdbProc, 0, this, 0);
delete m_gdbAdapter;
m_gdbAdapter = 0;
}
......
Markdown is supported
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