Commit 7ba0a4de authored by hjk's avatar hjk
Browse files

debugger: add dumper for Core::Id



Change-Id: Ibcc5b0e80acf037ed87b79ae4f52a1b0677388eb
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent de9ad595
...@@ -2420,6 +2420,18 @@ def qdump__QScriptValue(d, value): ...@@ -2420,6 +2420,18 @@ def qdump__QScriptValue(d, value):
# #
####################################################################### #######################################################################
def qdump__Core__Id(d, value):
try:
name = parseAndEvaluate("Core::nameForId(%d)" % value["m_id"])
d.putValue(encodeCharArray(name), Hex2EncodedLatin1)
d.putNumChild(1)
if d.isExpanded():
with Children(d):
d.putFields(value)
except:
d.putValue(value["m_id"])
d.putNumChild(0)
def qdump__Debugger__Internal__GdbMi(d, value): def qdump__Debugger__Internal__GdbMi(d, value):
d.putByteArrayValue(value["m_data"]) d.putByteArrayValue(value["m_data"])
d.putPlainChildren(value) d.putPlainChildren(value)
......
...@@ -134,4 +134,10 @@ QString Id::toString() const ...@@ -134,4 +134,10 @@ QString Id::toString() const
return QString::fromUtf8(stringFromId[m_id]); return QString::fromUtf8(stringFromId[m_id]);
} }
// For debugging purposes
CORE_EXPORT const char *nameForId(int id)
{
return (stringFromId.constData() + id)->constData();
}
} // namespace Core } // namespace Core
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