Debugger: Cache reference to an unresolvables type as struct

This fixes throwing an uncaught exception if local variables contain
arrays or pointer to a type that can not be looked up.

Change-Id: If9407e5cf5d86bb89594266d4122a53dd65a80bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2017-03-27 07:59:18 +02:00
parent bb04bbe9d4
commit 767d988891

View File

@@ -153,20 +153,20 @@ class Dumper(DumperBase):
code = nativeType.code()
if code == TypeCodePointer:
if nativeType.name().startswith('<function>'):
code = TypeCodeFunction
else:
if not nativeType.name().startswith('<function>'):
targetType = self.lookupType(nativeType.targetName(), nativeType.moduleId())
return self.createPointerType(targetType)
if targetType is not None:
return self.createPointerType(targetType)
code = TypeCodeFunction
if code == TypeCodeArray:
# cdb reports virtual function tables as arrays those ar handled separetly by
# the DumperBase. Declare those types as structs prevents a lookup to a none existing type
if nativeType.name().startswith('__fptr()') or nativeType.name().startswith('<gentype '):
code = TypeCodeStruct
else:
if not nativeType.name().startswith('__fptr()') and not nativeType.name().startswith('<gentype '):
targetType = self.lookupType(nativeType.targetName(), nativeType.moduleId())
return self.createArrayType(targetType, nativeType.arrayElements())
if targetType is not None:
return self.createArrayType(targetType, nativeType.arrayElements())
code = TypeCodeStruct
tdata = self.TypeData(self)
tdata.name = nativeType.name()