Dumper: Fix padding handling (32bit)

This also reverts 3d68a8d0de.

Change-Id: I3e527096b4d36a102f010e538e428654cc3b783c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2016-10-13 12:41:31 +02:00
parent b0ea129299
commit e0a6b45f22
2 changed files with 7 additions and 7 deletions

View File

@@ -2999,6 +2999,8 @@ class DumperBase:
return self.code in (TypeCodeIntegral, TypeCodeFloat, TypeCodeEnum) return self.code in (TypeCodeIntegral, TypeCodeFloat, TypeCodeEnum)
def alignment(self): def alignment(self):
if self.code == TypeCodeTypedef:
return self.stripTypedefs().alignment()
if self.isSimpleType(): if self.isSimpleType():
if self.name == 'double': if self.name == 'double':
return self.dumper.ptrSize() # Crude approximation. return self.dumper.ptrSize() # Crude approximation.
@@ -3371,7 +3373,9 @@ class DumperBase:
builder.addField(ptrSize, 'Q' if ptrSize == 8 else 'I') builder.addField(ptrSize, 'Q' if ptrSize == 8 else 'I')
elif c == 'P': # Pointer as Value elif c == 'P': # Pointer as Value
builder.addField(ptrSize, '%ss' % ptrSize) builder.addField(ptrSize, '%ss' % ptrSize)
elif c in ('q', 'Q', 'd'): elif c in ('d'):
builder.addField(8, c, fieldType = 'double')
elif c in ('q', 'Q'):
builder.addField(8, c) builder.addField(8, c)
elif c in ('i', 'I', 'f'): elif c in ('i', 'I', 'f'):
builder.addField(4, c) builder.addField(4, c)

View File

@@ -821,12 +821,8 @@ def qdump__QImage(d, value):
d.putValue('(invalid)') d.putValue('(invalid)')
return return
if d.ptrSize() == 8: (ref, width, height, depth, nbytes, padding, devicePixelRatio, colorTable,
(ref, width, height, depth, nbytes, padding, devicePixelRatio, colorTable, bits, iformat) = d.split('iiiii@dppi', imageData)
bits, iformat) = d.split('iiiii@dppi', imageData)
else:
(ref, width, height, depth, nbytes, devicePixelRatio, colorTable,
bits, iformat) = d.split('iiiiidppi', imageData)
d.putValue('(%dx%d)' % (width, height)) d.putValue('(%dx%d)' % (width, height))
d.putNumChild(1) d.putNumChild(1)