Commit 21ba1f7b authored by hjk's avatar hjk

Debugger: Allow explicit padding in patterns

Change-Id: I6f2302649cdbcbb9052a6898841c21301dace9e6
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 10ca8716
......@@ -3341,8 +3341,20 @@ class DumperBase:
elif c == '{':
readingTypeName = True
typeName = ""
elif c == '@': # Automatic padding.
builder.autoPadNext = True
elif c == '@':
if n is None:
# Automatic padding depending on next item
builder.autoPadNext = True
else:
# Explicit padding.
builder.currentBitsize = 8 * ((builder.currentBitsize + 7) >> 3)
padding = (int(n) - (builder.currentBitsize >> 3)) % int(n)
field = self.Field(self)
field.code = None
builder.pattern += "%ds" % padding
builder.currentBitsize += padding * 8
builder.fields.append(field)
n = None
else:
error("UNKNOWN STRUCT CODE: %s" % c)
pp = builder.pattern
......
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