Commit fa3a7126 authored by David Schulz's avatar David Schulz

Cdbext: Add Dumper for QRegion.

Change-Id: I968b2a5a7d3d00998a7074fe36d99cced64c089c
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 9ed467e5
......@@ -78,6 +78,7 @@ enum KnownType
KT_QWindow = KT_Qt_Type + KT_HasSimpleDumper + KT_HasComplexDumper + 21,
KT_QWidget = KT_Qt_Type + KT_HasSimpleDumper + KT_HasComplexDumper + 22,
KT_QSharedPointer = KT_Qt_Type + KT_HasSimpleDumper + KT_HasComplexDumper + 23,
KT_QRegion = KT_Qt_Type + KT_HasSimpleDumper + KT_HasComplexDumper + 24,
// Types: Various QT movable types
KT_QPen = KT_Qt_Type + KT_Qt_MovableType + 30,
KT_QUrl = KT_Qt_Type + KT_Qt_MovableType + 31 + KT_HasSimpleDumper,
......
......@@ -1246,6 +1246,8 @@ static KnownType knownClassTypeHelper(const std::string &type,
return KT_QMatrix;
if (!type.compare(qPos, 7, "QRegExp"))
return KT_QRegExp;
if (!type.compare(qPos, 7, "QRegion"))
return KT_QRegion;
if (!type.compare(qPos, 7, "QPixmap"))
return KT_QPixmap;
break;
......@@ -1882,6 +1884,33 @@ static inline bool dumpQRegExp(const SymbolGroupValue &v, std::wostream &str)
return dumpQStringFromQPrivateClass(v, QPDM_qSharedDataPadded, 0, str);
}
static inline bool dumpQRegion(const SymbolGroupValue &v, std::wostream &str, void **specialInfo)
{
const QtInfo info = QtInfo::get(v.context());
SymbolGroupValue d = v["d"]["qt_rgn"];
std::ostringstream namestr;
namestr << "(" << info.prependQtGuiModule("QRegionPrivate *") << ")("
<< std::showbase << std::hex << d.pointerValue() << ')';
SymbolGroupNode *qRegionPrivateNode
= v.node()->symbolGroup()->addSymbol(v.module(), namestr.str(), std::string(), &std::string());
if (!qRegionPrivateNode)
return false;
const SymbolGroupValue qRegionPrivateValue = SymbolGroupValue(qRegionPrivateNode, v.context());
if (!qRegionPrivateValue)
return false;
const int size = containerSize(KT_QVector, qRegionPrivateValue["rects"]);
if (size == -1)
return false;
str << L'<' << size << L" items>";
if (specialInfo)
*specialInfo = qRegionPrivateNode;
return true;
}
/* Dump QFile, for whose private class no debugging information is available.
* Dump the 1st string first past its QIODevicePrivate base class. */
static inline bool dumpQFile(const SymbolGroupValue &v, std::wostream &str)
......@@ -2839,6 +2868,9 @@ unsigned dumpSimpleType(SymbolGroupNode *n, const SymbolGroupValueContext &ctx,
case KT_QRegExp:
rc = dumpQRegExp(v, str) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
break;
case KT_QRegion:
rc = dumpQRegion(v, str, specialInfoIn) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
break;
case KT_QUrl:
rc = dumpQUrl(v, str) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
break;
......@@ -3318,6 +3350,17 @@ std::vector<AbstractSymbolGroupNode *>
case KT_QByteArray:
rc = complexDumpQByteArray(n, ctx);
break;
case KT_QRegion:
if (specialInfo) {
typedef AbstractSymbolGroupNode::AbstractSymbolGroupNodePtrVector NodeVector;
NodeVector children =
reinterpret_cast<SymbolGroupNode *>(specialInfo)->children();
for (NodeVector::iterator it = children.begin(); it != children.end(); ++it) {
if (SymbolGroupNode *node = (*it)->asSymbolGroupNode())
rc.push_back(new ReferenceSymbolGroupNode(node->name(), node->iName(), node));
}
}
break;
case KT_QWidget: // Special info by simple dumper is the QWidgetPrivate node
case KT_QWindow: // Special info by simple dumper is the QWindowPrivate node
case KT_QObject: // Special info by simple dumper is the QObjectPrivate node
......@@ -3342,7 +3385,7 @@ std::vector<AbstractSymbolGroupNode *>
}
if (SymbolGroupValue::verbose) {
DebugPrint dp;
dp << "<dumpComplexType" << rc.size() << ' ';
dp << "<dumpComplexType" << rc.size() << ' ' << specialInfo << ' ';
for (VectorIndexType i = 0; i < rc.size() ; ++i)
dp << i << ' ' << rc.at(i)->name();
}
......
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