Debugger: Check type cache before creating array/pointer type

Change-Id: I334c8d9a7ae365f28a8b070b0ccef943b5db3c59
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2017-02-27 12:36:48 +01:00
parent de1cd79546
commit 327341b917

View File

@@ -140,19 +140,20 @@ class Dumper(DumperBase):
def fromNativeType(self, nativeType):
self.check(isinstance(nativeType, cdbext.Type))
code = nativeType.code()
typeId = self.nativeTypeId(nativeType)
if self.typeData.get(typeId, None) is not None:
return self.Type(self, typeId)
if nativeType.name().startswith('void'):
nativeType = FakeVoidType(nativeType.name(), self)
code = nativeType.code()
if code == TypeCodePointer:
return self.createPointerType(self.lookupType(nativeType.targetName(), nativeType.moduleId()))
if code == TypeCodeArray:
return self.createArrayType(self.lookupType(nativeType.targetName(), nativeType.moduleId()), nativeType.arrayElements())
typeId = self.nativeTypeId(nativeType)
if self.typeData.get(typeId, None) is None:
tdata = self.TypeData(self)
tdata.name = nativeType.name()
tdata.typeId = typeId