Commit 1ae7f13d authored by hjk's avatar hjk

debugger: more general support for D arrays

Change-Id: Id8c4e585aa92616c40b9953be5bb9c3d121272b7
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 5117f5df
......@@ -1689,8 +1689,18 @@ class Dumper:
nsStrippedType = self.stripNamespaceFromType(dtypeName)\
.replace("::", "__")
# The following line is only needed for D:
#nsStrippedType = nsStrippedType.replace(" ", "__")
# The following block is only needed for D.
if nsStrippedType.startswith("_A"):
# DMD v2.058 encodes string[] as _Array_uns long long.
# With spaces.
if nsStrippedType.startswith("_Array_"):
qdump_Array(self, value)
return
if nsStrippedType.startswith("_AArray_"):
qdump_AArray(self, value)
return
#warn(" STRIPPED: %s" % nsStrippedType)
#warn(" DUMPERS: %s" % (nsStrippedType in qqDumpers))
if nsStrippedType in qqDumpers:
......
......@@ -2379,21 +2379,19 @@ def qdump__Eigen__Matrix(d, value):
#
#######################################################################
def cleanDType(type):
return stripClassTag(str(type)).replace("uns long long", "string")
def qdump___Array_char(d, value):
def qdump_Array(d, value):
n = value["length"]
p = value["ptr"]
t = cleanDType(value.type)[7:]
d.putAddress(value.address)
d.putType("char[%d]" % n)
d.putType("%s[%d]" % (t, n))
if t == "char":
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)
else:
d.putValue(" ")
d.putNumChild(n)
innerType = p.type
......@@ -2404,6 +2402,21 @@ def qdump___Array_uns__long__long(d, value):
p = p + 1
def qdump_AArray(d, value):
#n = value["length"]
# This ends up as _AArray_<key>_<value> with a single .ptr
# member of type void *. Not much that can be done here.
p = value["ptr"]
t = cleanDType(value.type)[8:]
d.putAddress(value.address)
d.putType("%s]" % t.replace("_", "["))
d.putValue(" ")
d.putNumChild(1)
if d.isExpanded():
with Children(d, 1):
d.putSubItem("ptr", p)
#######################################################################
#
# 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