Commit eeeefc22 authored by hjk's avatar hjk
Browse files

debugger: transfer simple array contents more directly



Change-Id: I75537b1ef6890767b12968f907348f9d9bb88069
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 1f7ab0df
...@@ -1358,6 +1358,25 @@ class Dumper: ...@@ -1358,6 +1358,25 @@ class Dumper:
self.putName(name) self.putName(name)
self.putItem(value) self.putItem(value)
def tryPutSimple(self, type, base, n):
if isSimpleType(type):
self.put('{value="')
self.put('"},{value="'.join([str((base + i).dereference())
for i in xrange(n)]))
self.put('"}');
return True
return False
def putArrayData(self, type, base, n, maxNumChild = 10000):
charPointer = lookupType("char *")
s = (base+1).cast(charPointer) - base.cast(charPointer)
with Children(self, n, maxNumChild=maxNumChild, childType=type,
addrBase=base, addrStep=s):
if not self.tryPutSimple(type, base, n):
for i in self.childRange():
self.putSubItem(i, (base + i).dereference())
def putCallItem(self, name, value, func, *args): def putCallItem(self, name, value, func, *args):
result = call2(value, func, args) result = call2(value, func, args)
with SubItem(self, name): with SubItem(self, name):
...@@ -1469,7 +1488,7 @@ class Dumper: ...@@ -1469,7 +1488,7 @@ class Dumper:
return return
if type.code == ArrayCode: if type.code == ArrayCode:
targettype = type.target() targetType = type.target()
self.putAddress(value.address) self.putAddress(value.address)
self.putType(typeName) self.putType(typeName)
self.putNumChild(1) self.putNumChild(1)
...@@ -1484,14 +1503,14 @@ class Dumper: ...@@ -1484,14 +1503,14 @@ class Dumper:
# Explicitly requested Local 8-bit formatting. # Explicitly requested Local 8-bit formatting.
self.putValue(encodeCharArray(value, 100), Hex2EncodedLocal8Bit) self.putValue(encodeCharArray(value, 100), Hex2EncodedLocal8Bit)
else: else:
self.putValue("@0x%x" % long(value.cast(targettype.pointer()))) self.putValue("@0x%x" % long(value.cast(targetType.pointer())))
if self.currentIName in self.expandedINames: if self.currentIName in self.expandedINames:
i = 0 p = value.cast(targetType.pointer())
with Children(self, childType=targettype, ts = targetType.sizeof
addrBase=value.cast(targettype.pointer()), with Children(self, childType=targetType,
addrStep=targettype.sizeof): addrBase=p, addrStep=ts):
if not self.tryPutSimple(targetType, p, type.sizeof/ts):
self.putFields(value) self.putFields(value)
i = i + 1
return return
if type.code == PointerCode: if type.code == PointerCode:
......
Supports Markdown
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