forked from qt-creator/qt-creator
Fix up Debugger helpers to be able to dump QObject's with CDB.
- Make container dumper routines set "childnumchild" when known in order to avoid roundtrips; avoid repeated invocations of container.end(). - Completed dumper information in some places to avoid roundtrips. - Extended QVariant helpers by dumpers for common GUI types (rectangles, points, sizes, fonts, size policies). - Introduced artificial QObjectChildList/QObjectProperty types to be able to dump QObject children and properties without using gdb expressions. - Fixed dumping of Signal/Slot list to pass on correct types. Avoid recursions if signal is connected to self. - Replaced expressions by addresses in the dumpers to it make work for CDB. - Reworked dumper test program to have -a, making it usable for tests, add further types. - Gdb: Clear output buffer before calling dumpers, avoiding mixups in case evaluation of expression fails. - Fix the dumper parser used by CDB, do not be fooled by "<synthetic>" addresses, etc. - Pass on a "dumperVersion" in initial query.
This commit is contained in:
@@ -3192,24 +3192,36 @@ void GdbEngine::handleQueryDebuggingHelper(const GdbResultRecord &record, const
|
||||
//qDebug() << m_availableSimpleDebuggingHelpers << "DATA DUMPERS AVAILABLE";
|
||||
}
|
||||
|
||||
void GdbEngine::sendWatchParameters(const QByteArray ¶ms0)
|
||||
static inline QString arrayFillCommand(const char *array, const QByteArray ¶ms)
|
||||
{
|
||||
QByteArray params = params0;
|
||||
params.append('\0');
|
||||
char buf[50];
|
||||
sprintf(buf, "set {char[%d]} &qDumpInBuffer = {", params.size());
|
||||
sprintf(buf, "set {char[%d]} &%s = {", params.size(), array);
|
||||
QByteArray encoded;
|
||||
encoded.append(buf);
|
||||
for (int i = 0; i != params.size(); ++i) {
|
||||
const int size = params.size();
|
||||
for (int i = 0; i != size; ++i) {
|
||||
sprintf(buf, "%d,", int(params[i]));
|
||||
encoded.append(buf);
|
||||
}
|
||||
encoded[encoded.size() - 1] = '}';
|
||||
return _(encoded);
|
||||
}
|
||||
|
||||
void GdbEngine::sendWatchParameters(const QByteArray ¶ms0)
|
||||
{
|
||||
QByteArray params = params0;
|
||||
params.append('\0');
|
||||
const QString inBufferCmd = arrayFillCommand("qDumpInBuffer", params);
|
||||
|
||||
params.replace('\0','!');
|
||||
emit gdbInputAvailable(LogMisc, QString::fromUtf8(params));
|
||||
|
||||
postCommand(_(encoded));
|
||||
params.clear();
|
||||
params.append('\0');
|
||||
const QString outBufferCmd = arrayFillCommand("qDumpOutBuffer", params);
|
||||
|
||||
postCommand(inBufferCmd);
|
||||
postCommand(outBufferCmd);
|
||||
}
|
||||
|
||||
void GdbEngine::handleVarAssign(const GdbResultRecord &, const QVariant &)
|
||||
|
||||
Reference in New Issue
Block a user