Commit 5117f5df authored by hjk's avatar hjk

debugger: add gdb "pretty printers" for D's char[] and string[]

Change-Id: Icf690e0948d5c88b2a59b81258c97a42c5ac5251
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 5b3acc82
......@@ -1689,6 +1689,8 @@ class Dumper:
nsStrippedType = self.stripNamespaceFromType(dtypeName)\
.replace("::", "__")
# The following line is only needed for D:
#nsStrippedType = nsStrippedType.replace(" ", "__")
#warn(" STRIPPED: %s" % nsStrippedType)
#warn(" DUMPERS: %s" % (nsStrippedType in qqDumpers))
if nsStrippedType in qqDumpers:
......
......@@ -2373,6 +2373,37 @@ def qdump__Eigen__Matrix(d, value):
s = s + 1
#######################################################################
#
# D
#
#######################################################################
def qdump___Array_char(d, value):
n = value["length"]
p = value["ptr"]
d.putAddress(value.address)
d.putType("char[%d]" % n)
d.putValue(encodeCharArray(p, 100), Hex2EncodedLocal8Bit)
d.putNumChild(0)
# DMD v2.058 encodes string[] as _Array_uns long long. With spaces.
def qdump___Array_uns__long__long(d, value):
n = value["length"]
p = value["ptr"]
d.putAddress(value.address)
d.putType("string[%d]" % n)
d.putValue(" ")
d.putNumChild(n)
innerType = p.type
if d.isExpanded():
with Children(d, n, childType=innerType):
for i in range(0, n):
d.putSubItem(i, p.dereference())
p = p + 1
#######################################################################
#
# Display Test
......
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