Commit 67505423 authored by hjk's avatar hjk

Debugger: Dumper code cosmetics

Mostly left-overs from earlier reorganization.

Change-Id: I94f44efa1aab1e17de3c0fec6c230722149a1404
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 75be7de6
......@@ -2947,18 +2947,14 @@ class DumperBase:
else:
self.dumper.check(False)
val.type = None
if fieldType.code == TypeCodeReference:
if val.laddress is not None:
val = self.dumper.createReferenceValue(val.laddress, fieldType.ltarget)
val.name = field.name
if val.type is None:
val.type = fieldType
#warn('GOT VAL %s FOR FIELD %s' % (val, field))
val.check()
val.name = field.name
val.lbitsize = fieldBitsize
val.check()
return val
# This is the generic version for synthetic values.
......@@ -3299,7 +3295,7 @@ class DumperBase:
def unqualified(self):
return self
def templateArgument(self, position, numeric = False):
def templateArgument(self, position):
tdata = self.typeData()
#warn('TDATA: %s' % tdata)
#warn('ID: %s' % self.typeId)
......@@ -3313,11 +3309,7 @@ class DumperBase:
return res
#warn('TA: %s %s' % (position, self.typeId))
#warn('ARGS: %s' % tdata.templateArguments)
res = tdata.templateArguments[position]
#if tdata.templateArguments is not None:
#if numeric:
# return tdata.templateArguments[position].value()
return res
return tdata.templateArguments[position]
def simpleEncoding(self):
res = {
......@@ -3343,7 +3335,7 @@ class DumperBase:
tdata = self.typeData()
if tdata.code == TypeCodeTypedef:
return tdata.ltarget.alignment()
if self.isSimpleType():
if tdata.code in (TypeCodeIntegral, TypeCodeFloat, TypeCodeEnum):
if tdata.name in ('double', 'long long', 'unsigned long long'):
return self.dumper.ptrSize() # Crude approximation.
return self.size()
......@@ -3356,16 +3348,6 @@ class DumperBase:
return tdata.lalignment
return 1
#align = 1
#for field in self.fields():
# #warn(' SUBFIELD: %s TYPE %s' % (field.name, field.fieldType().name))
# a = field.fieldType().alignment()
# #warn(' SUBFIELD: %s ALIGN: %s' % (field.name, a))
# if a is not None and a > align:
# align = a
##warn('COMPUTED ALIGNMENT: %s ' % align)
#return align
def pointer(self):
return self.dumper.createPointerType(self)
......
......@@ -102,10 +102,10 @@ def qdump____m512i(d, value):
# return 'Transposed'
def qdump__Eigen__Matrix(d, value):
innerType = value.type.templateArgument(0, False)
argRow = value.type.templateArgument(1, True)
argCol = value.type.templateArgument(2, True)
options = value.type.templateArgument(3, True)
innerType = value.type[0]
argRow = value.type[1]
argCol = value.type[2]
options = value.type[3]
rowMajor = (int(options) & 0x1)
# The magic dimension value is -1 in Eigen3, but 10000 in Eigen2.
# 10000 x 10000 matrices are rare, vectors of dim 10000 less so.
......
......@@ -1260,7 +1260,7 @@ def qdump__QString(d, value):
d.putArrayData(data, size, d.createType('QChar'))
def qdump__QStaticStringData(d, value):
size = value.type.templateArgument(0, numeric=True)
size = value.type[0]
(ref, size, alloc, pad, offset, data) = value.split('iii@p%ss' % (2 * size))
d.putValue(d.hexencode(data), 'utf16')
d.putPlainChildren(value)
......
......@@ -29,7 +29,7 @@ def qform__std__array():
return arrayForms()
def qdump__std__array(d, value):
size = value.type.templateArgument(1, numeric=True)
size = value.type[1]
d.putItemCount(size)
if d.isExpanded():
d.putPlotData(value.address(), size, value.type[0])
......
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