ri = makeValue(d.ns + "QModelIndex", "-1, -1, 0, 0")
this_ = makeExpression(item.value)
ri_ = makeExpression(ri)
- rowCount = int(parseAndEvaluate("%s.rowCount(%s)" % (this_, ri_)))
- columnCount = int(parseAndEvaluate("%s.columnCount(%s)" % (this_, ri_)))
+ try:
+ rowCount = int(parseAndEvaluate("%s.rowCount(%s)" % (this_, ri_)))
+ columnCount = int(parseAndEvaluate("%s.columnCount(%s)" % (this_, ri_)))
+ except:
+ d.putPlainChildren(item)
+ return
d.putValue("%d x %d" % (rowCount, columnCount))
d.putNumChild(rowCount * columnCount)
if d.isExpanded(item):
mi = makeValue(d.ns + "QModelIndex", "%s,%s,%s,%s" % (r, c, p, m))
mm_ = makeExpression(mm)
mi_ = makeExpression(mi)
- rowCount = int(parseAndEvaluate("%s.rowCount(%s)" % (mm_, mi_)))
- columnCount = int(parseAndEvaluate("%s.columnCount(%s)" % (mm_, mi_)))
+ try:
+ rowCount = int(parseAndEvaluate("%s.rowCount(%s)" % (mm_, mi_)))
+ columnCount = int(parseAndEvaluate("%s.columnCount(%s)" % (mm_, mi_)))
+ except:
+ d.putPlainChildren(item)
+ return
try:
# Access DisplayRole as value
def qdump__QDateTime(d, item):
- if int(item.value["d"]["d"].dereference()["time"]["mds"]) == -1:
- d.putValue("(null)")
- d.putNumChild(0)
+ try:
+ # Fails without debug info.
+ if int(item.value["d"]["d"].dereference()["time"]["mds"]) == -1:
+ d.putValue("(null)")
+ d.putNumChild(0)
+ return
+ except:
+ d.putPlainChildren(item)
return
+
d.putStringValue(call(item.value, "toString('%sQt::TextDate')" % d.ns))
d.putNumChild(1)
if d.isExpanded(item):
def qdump__QFileInfo(d, item):
- d.putStringValue(item.value["d_ptr"]["d"].dereference()["fileName"])
+ try:
+ d.putStringValue(item.value["d_ptr"]["d"].dereference()["fileName"])
+ except:
+ d.putPlainChildren(item)
+ return
d.putNumChild(3)
if d.isExpanded(item):
with Children(d, 10, lookupType(d.ns + "QString")):
return "Normal,Displayed"
def qdump__QImage(d, item):
- painters = item.value["painters"]
+ try:
+ painters = item.value["painters"]
+ except:
+ d.putPlainChildren(item)
+ return
check(0 <= painters and painters < 1000)
d_ptr = item.value["d"]
if isNull(d_ptr):
def qdump__QObject(d, item):
#warn("OBJECT: %s " % item.value)
- staticMetaObject = item.value["staticMetaObject"]
+ try:
+ staticMetaObject = item.value["staticMetaObject"]
+ except:
+ d.putPlainChildren(item)
+ return
#warn("SMO: %s " % staticMetaObject)
#warn("SMO DATA: %s " % staticMetaObject["d"]["stringdata"])
superData = staticMetaObject["d"]["superdata"]
with Children(d):
d.putFields(Item(p.dereference(), item.iname))
except:
- d.putValue(" ")
- d.putNumChild(1)
- if d.isExpanded(item):
- with Children(d):
- d.putFields(item)
+ d.putValue(p)
+ d.putPlainChildren(item)
# qt_rgn might be 0
# gdb.parse_and_eval("region")["d"].dereference()["qt_rgn"].dereference()
else:
# This replaces the pointer by the pointee, making the
# pointer transparent.
- innerType = item.value.type.template_argument(0)
+ try:
+ innerType = item.value.type.template_argument(0)
+ except:
+ d.putValue(d_ptr)
+ d.putPlainChildren(item)
+ return
value = gdb.Value(d_ptr.cast(innerType.pointer()))
d.putType(d.currentType, d.currentTypePriority + 1)
d.putItem(Item(value.dereference(), item.iname, None))
def qdump__QStandardItem(d, item):
d.putType(d.currentType, d.currentTypePriority + 1)
- d.putItem(Item(item.value["d_ptr"], item.iname, None, None))
+ try:
+ d.putItem(Item(item.value["d_ptr"], item.iname, None, None))
+ except:
+ d.putPlainChildren(item)
def qform__QString():
d.putValue("(invalid)")
d.putNumChild(0)
else:
- p = dd.dereference()
- d.putValue(p["position"])
+ try:
+ p = dd.dereference()
+ d.putValue(p["position"])
+ except:
+ d.putPlainChildren(item)
+ return
d.putNumChild(1)
if d.isExpanded(item):
with Children(d):
def qdump__QUrl(d, item):
- data = item.value["d"].dereference()
- d.putStringValue(data["encodedOriginal"])
+ try:
+ data = item.value["d"].dereference()
+ d.putStringValue(data["encodedOriginal"])
+ except:
+ d.putPlainChildren(item)
+ return
d.putNumChild(1)
if d.isExpanded(item):
with Children(d):