Commit 10e01db4 authored by hjk's avatar hjk

Debugger: Make autotest pass for LLDB arrays

Change-Id: I1baa4684e85d0ccd677956eeff88b4cc7d807922
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent d5b48c0c
......@@ -293,13 +293,16 @@ def impl_SBValue__int__(self):
def impl_SBValue__long__(self):
return int(self.GetValue(), 0)
def impl_SBValue__getitem__(self, name):
if self.GetType().IsPointerType() and isinstance(name, int):
innertype = self.Dereference().GetType()
address = self.GetValueAsUnsigned() + name * innertype.GetByteSize()
address = address & 0xFFFFFFFFFFFFFFFF # Force unsigned
return self.CreateValueFromAddress(None, address, innertype)
return self.GetChildMemberWithName(name)
def impl_SBValue__getitem__(value, index):
if isinstance(index, int):
type = value.GetType()
if type.IsPointerType():
innertype = value.Dereference().GetType()
address = value.GetValueAsUnsigned() + index * innertype.GetByteSize()
address = address & 0xFFFFFFFFFFFFFFFF # Force unsigned
return value.CreateValueFromAddress(None, address, innertype)
return value.GetChildAtIndex(index)
return value.GetChildMemberWithName(index)
def childAt(value, index):
return value.GetChildAtIndex(index)
......@@ -947,6 +950,11 @@ class Dumper:
# Our turf now.
value.SetPreferSyntheticValue(False)
# Arrays
if value.GetType().GetTypeClass() == lldb.eTypeClassArray:
qdump____c_style_array__(self, value)
return
# References
if value.GetType().IsReferenceType():
type = value.GetType().GetDereferencedType().GetPointerType()
......
......@@ -1981,10 +1981,9 @@ def qdump__QxXmlAttributes(d, value):
def qdump____c_style_array__(d, value):
type = value.type.unqualified()
targetType = type.target()
typeName = str(type)
targetType = value[0].type
#d.putAddress(value.address)
d.putType(typeName)
d.putType(type)
d.putNumChild(1)
format = d.currentItemFormat()
isDefault = format == None and str(targetType.unqualified()) == "char"
......
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