Commit 7a1b22c8 authored by hjk's avatar hjk Committed by hjk

debugger: fix extractCharArray for e.g. empty strings

Change-Id: I00b0dab800c2587b5f947f52f96595eefc6ca218
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 9a191b5b
......@@ -615,16 +615,17 @@ def findFirstZero(p, maximum):
return maximum + 1
def extractCharArray(p, maxsize):
t = lookupType("unsigned char").pointer()
p = p.cast(t)
limit = findFirstZero(p, maxsize)
p = p.cast(lookupType("unsigned char").pointer())
s = ""
for i in xrange(limit):
s += "%c" % int(p.dereference())
i = 0
while i < maxsize:
c = int(p.dereference())
if c == 0:
return s
s += "%c" % c
p += 1
if i > maxsize:
s += "..."
return s
i += 1
return s + "..."
def extractByteArray(value):
d_ptr = value['d'].dereference()
......
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