Commit e6f407be authored by hjk's avatar hjk
Browse files

Debugger: Display QImage size without debug info



Change-Id: I1f7b57385c77c4cd6bae9cf033bec91eeb984ac6
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent f332d007
...@@ -711,20 +711,12 @@ def qform__QImage(): ...@@ -711,20 +711,12 @@ def qform__QImage():
return "Normal,Displayed" return "Normal,Displayed"
def qdump__QImage(d, value): def qdump__QImage(d, value):
try: # This relies on current QImage layout
painters = int(value["painters"]) intPtrType = d.lookupType("int").pointer()
except: base = createReferenceValue(value, d.addressOf(value) + 3 * intPtrType.sizeof, intPtrType)
d.putPlainChildren(value) width = int(base[1])
return height = int(base[2])
check(0 <= painters and painters < 1000) d.putValue("(%dx%d)" % (width, height))
d_ptr = value["d"]
if isNull(d_ptr):
d.putValue("(null)")
else:
checkSimpleRef(d_ptr["ref"])
d.putValue("(%dx%d)" % (d_ptr["width"], d_ptr["height"]))
bits = d_ptr["data"]
nbytes = d_ptr["nbytes"]
d.putNumChild(0) d.putNumChild(0)
#d.putNumChild(1) #d.putNumChild(1)
if d.isExpanded(): if d.isExpanded():
...@@ -737,13 +729,16 @@ def qdump__QImage(d, value): ...@@ -737,13 +729,16 @@ def qdump__QImage(d, value):
if format == 1: if format == 1:
d.putDisplay(StopDisplay) d.putDisplay(StopDisplay)
elif format == 2: elif format == 2:
d_ptr = value["d"]
bits = d_ptr["data"]
nbytes = d_ptr["nbytes"]
if False: if False:
# Take four bytes at a time, this is critical for performance. # Take four bytes at a time, this is critical for performance.
# In fact, even four at a time is too slow beyond 100x100 or so. # In fact, even four at a time is too slow beyond 100x100 or so.
d.putField("editformat", DisplayImageData) d.putField("editformat", DisplayImageData)
d.put('%s="' % name) d.put('%s="' % name)
d.put("%08x" % int(d_ptr["width"])) d.put("%08x" % width)
d.put("%08x" % int(d_ptr["height"])) d.put("%08x" % height)
d.put("%08x" % int(d_ptr["format"])) d.put("%08x" % int(d_ptr["format"]))
p = bits.cast(d.intType().pointer()) p = bits.cast(d.intType().pointer())
for i in xrange(nbytes / 4): for i in xrange(nbytes / 4):
...@@ -758,7 +753,7 @@ def qdump__QImage(d, value): ...@@ -758,7 +753,7 @@ def qdump__QImage(d, value):
gdb.execute("dump binary memory %s %s %s" % gdb.execute("dump binary memory %s %s %s" %
(filename, cleanAddress(p), cleanAddress(p + nbytes))) (filename, cleanAddress(p), cleanAddress(p + nbytes)))
d.putDisplay(DisplayImageFile, " %d %d %d %s" d.putDisplay(DisplayImageFile, " %d %d %d %s"
% (d_ptr["width"], d_ptr["height"], d_ptr["format"], filename)) % (width, height, d_ptr["format"], filename))
def qdump__QLinkedList(d, value): def qdump__QLinkedList(d, value):
......
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