Commit 8510d887 authored by hjk's avatar hjk

debugger: dumper for TBuf<N>

parent b4e99074
......@@ -36,6 +36,15 @@ def cleanAddress(addr):
# that might trigger Unicode encoding errors.
return addr.cast(gdb.lookup_type("void").pointer())
# Workaround for gdb < 7.1
def numericTemplateArgument(type, position):
try:
return int(type.template_argument(position))
except RuntimeError as error:
# ": No type named 30."
msg = str(error)
return int(msg[14:-1])
def parseAndEvaluate(exp):
if isGoodGdb():
return gdb.parse_and_eval(exp)
......
......@@ -1878,3 +1878,24 @@ def qdump__std__basic_string(d, item):
def qdump__wstring(d, item):
qdump__std__string(d, item)
#######################################################################
#
# Symbian
#
#######################################################################
def qdump__TBuf(d, item):
size = item.value["iLength"] & 0xffff
max = numericTemplateArgument(item.value.type, 0)
check(0 <= size and size <= max)
base = item.value["iBuf"]
s = ""
for i in xrange(size):
val = int(base[i])
s += "%02x" % (val % 256)
s += "%02x" % (val / 256)
d.putNumChild(0)
d.putValue(s, "6")
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