Commit 73ee2610 authored by hjk's avatar hjk

debugger: more robust QDateTime and QFileInfo dumper for gdb versions without

call()
parent 87d13230
......@@ -613,9 +613,13 @@ class Dumper:
self.putField("value", value)
def putStringValue(self, value):
str = encodeString(value)
self.putCommaIfNeeded()
self.put('valueencoded="%d",value="%s"' % (7, str))
if value is None:
self.putCommaIfNeeded()
self.put('value="<not available>"')
else:
str = encodeString(value)
self.putCommaIfNeeded()
self.put('valueencoded="%d",value="%s"' % (7, str))
def putByteArrayValue(self, value):
str = encodeByteArray(value)
......@@ -733,8 +737,11 @@ class Dumper:
self.endHash()
def putCallItem(self, name, item, func):
result = call(item.value, func)
self.putItem(Item(result, item.iname, name, name))
try:
result = call(item.value, func)
self.safePutItem(Item(result, item.iname, name, name))
except:
self.safePutItem(Item(None, item.iname))
def putItemHelper(self, item):
name = getattr(item, "name", None)
......
......@@ -179,27 +179,30 @@ def qdump__QFileInfo(d, item):
#QFile::Permissions permissions () const
perms = call(item.value, "permissions()")
d.beginHash()
d.putName("permissions")
d.putValue(" ")
d.putType(d.ns + "QFile::Permissions")
d.putNumChild(10)
if d.isExpandedIName(item.iname + ".permissions"):
d.beginChildren(10)
d.putBoolItem("ReadOwner", perms & 0x4000)
d.putBoolItem("WriteOwner", perms & 0x2000)
d.putBoolItem("ExeOwner", perms & 0x1000)
d.putBoolItem("ReadUser", perms & 0x0400)
d.putBoolItem("WriteUser", perms & 0x0200)
d.putBoolItem("ExeUser", perms & 0x0100)
d.putBoolItem("ReadGroup", perms & 0x0040)
d.putBoolItem("WriteGroup", perms & 0x0020)
d.putBoolItem("ExeGroup", perms & 0x0010)
d.putBoolItem("ReadOther", perms & 0x0004)
d.putBoolItem("WriteOther", perms & 0x0002)
d.putBoolItem("ExeOther", perms & 0x0001)
d.endChildren()
d.endHash()
if perms is None:
d.putValue("<not available>")
else:
d.beginHash()
d.putName("permissions")
d.putValue(" ")
d.putType(d.ns + "QFile::Permissions")
d.putNumChild(10)
if d.isExpandedIName(item.iname + ".permissions"):
d.beginChildren(10)
d.putBoolItem("ReadOwner", perms & 0x4000)
d.putBoolItem("WriteOwner", perms & 0x2000)
d.putBoolItem("ExeOwner", perms & 0x1000)
d.putBoolItem("ReadUser", perms & 0x0400)
d.putBoolItem("WriteUser", perms & 0x0200)
d.putBoolItem("ExeUser", perms & 0x0100)
d.putBoolItem("ReadGroup", perms & 0x0040)
d.putBoolItem("WriteGroup", perms & 0x0020)
d.putBoolItem("ExeGroup", perms & 0x0010)
d.putBoolItem("ReadOther", perms & 0x0004)
d.putBoolItem("WriteOther", perms & 0x0002)
d.putBoolItem("ExeOther", perms & 0x0001)
d.endChildren()
d.endHash()
#QDir absoluteDir () const
#QDir dir () const
......
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