forked from qt-creator/qt-creator
Dumper: avoid redundant labeling
Change-Id: I85581cfe34a60e7f8a3e3590358443a15b7d2d4c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -50,19 +50,19 @@ class FakeVoidType(cdbext.Type):
|
||||
|
||||
def code(self):
|
||||
if self.typeName.endswith('*'):
|
||||
return TypeCode.TypeCodePointer
|
||||
return TypeCode.Pointer
|
||||
if self.typeName.endswith(']'):
|
||||
return TypeCode.TypeCodeArray
|
||||
return TypeCode.TypeCodeVoid
|
||||
return TypeCode.Array
|
||||
return TypeCode.Void
|
||||
|
||||
def unqualified(self):
|
||||
return self
|
||||
|
||||
def target(self):
|
||||
code = self.code()
|
||||
if code == TypeCode.TypeCodePointer:
|
||||
if code == TypeCode.Pointer:
|
||||
return FakeVoidType(self.typeName[:-1], self.dumper)
|
||||
if code == TypeCode.TypeCodeVoid:
|
||||
if code == TypeCode.Void:
|
||||
return self
|
||||
try:
|
||||
return FakeVoidType(self.typeName[:self.typeName.rindex('[')], self.dumper)
|
||||
@@ -109,7 +109,7 @@ class Dumper(DumperBase):
|
||||
val.type = self.fromNativeType(nativeValue.type())
|
||||
# There is no cdb api for the size of bitfields.
|
||||
# Workaround this issue by parsing the native debugger text for integral types.
|
||||
if val.type.code == TypeCode.TypeCodeIntegral:
|
||||
if val.type.code == TypeCode.Integral:
|
||||
integerString = nativeValue.nativeDebuggerValue()
|
||||
if integerString == 'true':
|
||||
val.ldata = int(1).to_bytes(1, byteorder='little')
|
||||
@@ -132,7 +132,7 @@ class Dumper(DumperBase):
|
||||
except:
|
||||
# read raw memory in case the integerString can not be interpreted
|
||||
pass
|
||||
if val.type.code == TypeCode.TypeCodeEnum:
|
||||
if val.type.code == TypeCode.Enum:
|
||||
val.ldisplay = self.enumValue(nativeValue)
|
||||
val.isBaseClass = val.name == val.type.name
|
||||
val.nativeValue = nativeValue
|
||||
@@ -164,14 +164,14 @@ class Dumper(DumperBase):
|
||||
nativeType = FakeVoidType(nativeType.name(), self)
|
||||
|
||||
code = nativeType.code()
|
||||
if code == TypeCode.TypeCodePointer:
|
||||
if code == TypeCode.Pointer:
|
||||
if not nativeType.name().startswith('<function>'):
|
||||
targetType = self.lookupType(nativeType.targetName(), nativeType.moduleId())
|
||||
if targetType is not None:
|
||||
return self.createPointerType(targetType)
|
||||
code = TypeCode.TypeCodeFunction
|
||||
code = TypeCode.Function
|
||||
|
||||
if code == TypeCode.TypeCodeArray:
|
||||
if code == TypeCode.Array:
|
||||
# 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
|
||||
@@ -179,7 +179,7 @@ class Dumper(DumperBase):
|
||||
targetType = self.lookupType(nativeType.targetName(), nativeType.moduleId())
|
||||
if targetType is not None:
|
||||
return self.createArrayType(targetType, nativeType.arrayElements())
|
||||
code = TypeCode.TypeCodeStruct
|
||||
code = TypeCode.Struct
|
||||
|
||||
tdata = self.TypeData(self)
|
||||
tdata.name = nativeType.name()
|
||||
@@ -188,12 +188,12 @@ class Dumper(DumperBase):
|
||||
tdata.code = code
|
||||
tdata.moduleName = nativeType.module()
|
||||
self.registerType(typeId, tdata) # Prevent recursion in fields.
|
||||
if code == TypeCode.TypeCodeStruct:
|
||||
if code == TypeCode.Struct:
|
||||
tdata.lfields = lambda value: \
|
||||
self.listFields(nativeType, value)
|
||||
tdata.lalignment = lambda: \
|
||||
self.nativeStructAlignment(nativeType)
|
||||
if code == TypeCode.TypeCodeEnum:
|
||||
if code == TypeCode.Enum:
|
||||
tdata.enumDisplay = lambda intval, addr, form: \
|
||||
self.nativeTypeEnumDisplay(nativeType, intval, form)
|
||||
tdata.templateArguments = self.listTemplateParameters(nativeType.name())
|
||||
|
@@ -261,7 +261,7 @@ class DumperBase():
|
||||
|
||||
def resetCaches(self):
|
||||
# This is a cache mapping from 'type name' to 'display alternatives'.
|
||||
self.qqFormats = {'QVariant (QVariantMap)': [DisplayFormat.CompactMapFormat]}
|
||||
self.qqFormats = {'QVariant (QVariantMap)': [DisplayFormat.CompactMap]}
|
||||
|
||||
# This is a cache of all known dumpers.
|
||||
self.qqDumpers = {} # Direct type match
|
||||
@@ -439,7 +439,7 @@ class DumperBase():
|
||||
tdata.name = typeId
|
||||
tdata.typeId = typeId
|
||||
tdata.lbitsize = 16
|
||||
tdata.code = TypeCode.TypeCodeIntegral
|
||||
tdata.code = TypeCode.Integral
|
||||
self.registerType(typeId, tdata)
|
||||
|
||||
typeId = 'QChar'
|
||||
@@ -447,7 +447,7 @@ class DumperBase():
|
||||
tdata.name = typeId
|
||||
tdata.typeId = typeId
|
||||
tdata.lbitsize = 16
|
||||
tdata.code = TypeCode.TypeCodeStruct
|
||||
tdata.code = TypeCode.Struct
|
||||
tdata.lfields = [self.Field(dumper=self, name='ucs',
|
||||
type='unsigned short', bitsize=16, bitpos=0)]
|
||||
tdata.lalignment = 2
|
||||
@@ -628,14 +628,12 @@ class DumperBase():
|
||||
return elided, self.readMemory(data, shown)
|
||||
|
||||
def putCharArrayValue(self, data, size, charSize,
|
||||
displayFormat=DisplayFormat.AutomaticFormat):
|
||||
displayFormat=DisplayFormat.Automatic):
|
||||
bytelen = size * charSize
|
||||
elided, shown = self.computeLimit(bytelen, self.displayStringLimit)
|
||||
mem = self.readMemory(data, shown)
|
||||
if charSize == 1:
|
||||
if displayFormat in (
|
||||
DisplayFormat.Latin1StringFormat,
|
||||
DisplayFormat.SeparateLatin1StringFormat):
|
||||
if displayFormat in (DisplayFormat.Latin1String, DisplayFormat.SeparateLatin1String):
|
||||
encodingType = 'latin1'
|
||||
else:
|
||||
encodingType = 'utf8'
|
||||
@@ -650,14 +648,14 @@ class DumperBase():
|
||||
self.putValue(mem, encodingType, elided=elided)
|
||||
|
||||
if displayFormat in (
|
||||
DisplayFormat.SeparateLatin1StringFormat,
|
||||
DisplayFormat.SeparateUtf8StringFormat,
|
||||
DisplayFormat.SeparateFormat):
|
||||
DisplayFormat.SeparateLatin1String,
|
||||
DisplayFormat.SeparateUtf8String,
|
||||
DisplayFormat.Separate):
|
||||
elided, shown = self.computeLimit(bytelen, 100000)
|
||||
self.putDisplay(encodingType + ':separate', self.readMemory(data, shown))
|
||||
|
||||
def putCharArrayHelper(self, data, size, charType,
|
||||
displayFormat=DisplayFormat.AutomaticFormat,
|
||||
displayFormat=DisplayFormat.Automatic,
|
||||
makeExpandable=True):
|
||||
charSize = charType.size()
|
||||
self.putCharArrayValue(data, size, charSize, displayFormat=displayFormat)
|
||||
@@ -1117,7 +1115,7 @@ class DumperBase():
|
||||
|
||||
n = arrayByteSize // innerType.size()
|
||||
p = value.address()
|
||||
if displayFormat != DisplayFormat.RawFormat and p:
|
||||
if displayFormat != DisplayFormat.Raw and p:
|
||||
if innerType.name in (
|
||||
'char',
|
||||
'wchar_t',
|
||||
@@ -1173,7 +1171,7 @@ class DumperBase():
|
||||
|
||||
def tryPutPrettyItem(self, typeName, value):
|
||||
value.check()
|
||||
if self.useFancy and self.currentItemFormat() != DisplayFormat.RawFormat:
|
||||
if self.useFancy and self.currentItemFormat() != DisplayFormat.Raw:
|
||||
self.putType(typeName)
|
||||
|
||||
nsStrippedType = self.stripNamespaceFromType(typeName)\
|
||||
@@ -1219,7 +1217,7 @@ class DumperBase():
|
||||
|
||||
# This is shared by pointer and array formatting.
|
||||
def tryPutSimpleFormattedPointer(self, ptr, typeName, innerType, displayFormat, limit):
|
||||
if displayFormat == DisplayFormat.AutomaticFormat:
|
||||
if displayFormat == DisplayFormat.Automatic:
|
||||
if innerType.name in ('char', 'signed char', 'unsigned char', 'CHAR'):
|
||||
# Use UTF-8 as default for char *.
|
||||
self.putType(typeName)
|
||||
@@ -1239,45 +1237,45 @@ class DumperBase():
|
||||
self.putValue(data, 'ucs4', elided=elided)
|
||||
return True
|
||||
|
||||
if displayFormat == DisplayFormat.Latin1StringFormat:
|
||||
if displayFormat == DisplayFormat.Latin1String:
|
||||
self.putType(typeName)
|
||||
(elided, data) = self.encodeCArray(ptr, 1, limit)
|
||||
self.putValue(data, 'latin1', elided=elided)
|
||||
return True
|
||||
|
||||
if displayFormat == DisplayFormat.SeparateLatin1StringFormat:
|
||||
if displayFormat == DisplayFormat.SeparateLatin1String:
|
||||
self.putType(typeName)
|
||||
(elided, data) = self.encodeCArray(ptr, 1, limit)
|
||||
self.putValue(data, 'latin1', elided=elided)
|
||||
self.putDisplay('latin1:separate', data)
|
||||
return True
|
||||
|
||||
if displayFormat == DisplayFormat.Utf8StringFormat:
|
||||
if displayFormat == DisplayFormat.Utf8String:
|
||||
self.putType(typeName)
|
||||
(elided, data) = self.encodeCArray(ptr, 1, limit)
|
||||
self.putValue(data, 'utf8', elided=elided)
|
||||
return True
|
||||
|
||||
if displayFormat == DisplayFormat.SeparateUtf8StringFormat:
|
||||
if displayFormat == DisplayFormat.SeparateUtf8String:
|
||||
self.putType(typeName)
|
||||
(elided, data) = self.encodeCArray(ptr, 1, limit)
|
||||
self.putValue(data, 'utf8', elided=elided)
|
||||
self.putDisplay('utf8:separate', data)
|
||||
return True
|
||||
|
||||
if displayFormat == DisplayFormat.Local8BitStringFormat:
|
||||
if displayFormat == DisplayFormat.Local8BitString:
|
||||
self.putType(typeName)
|
||||
(elided, data) = self.encodeCArray(ptr, 1, limit)
|
||||
self.putValue(data, 'local8bit', elided=elided)
|
||||
return True
|
||||
|
||||
if displayFormat == DisplayFormat.Utf16StringFormat:
|
||||
if displayFormat == DisplayFormat.Utf16String:
|
||||
self.putType(typeName)
|
||||
(elided, data) = self.encodeCArray(ptr, 2, limit)
|
||||
self.putValue(data, 'utf16', elided=elided)
|
||||
return True
|
||||
|
||||
if displayFormat == DisplayFormat.Ucs4StringFormat:
|
||||
if displayFormat == DisplayFormat.Ucs4String:
|
||||
self.putType(typeName)
|
||||
(elided, data) = self.encodeCArray(ptr, 4, limit)
|
||||
self.putValue(data, 'ucs4', elided=elided)
|
||||
@@ -1339,7 +1337,7 @@ class DumperBase():
|
||||
self.putNumChild(0)
|
||||
return
|
||||
|
||||
if displayFormat == DisplayFormat.RawFormat:
|
||||
if displayFormat == DisplayFormat.Raw:
|
||||
# Explicitly requested bald pointer.
|
||||
#DumperBase.warn('RAW')
|
||||
self.putType(typeName)
|
||||
@@ -1352,23 +1350,21 @@ class DumperBase():
|
||||
return
|
||||
|
||||
limit = self.displayStringLimit
|
||||
if displayFormat in (
|
||||
DisplayFormat.SeparateLatin1StringFormat,
|
||||
DisplayFormat.SeparateUtf8StringFormat):
|
||||
if displayFormat in (DisplayFormat.SeparateLatin1String, DisplayFormat.SeparateUtf8String):
|
||||
limit = 1000000
|
||||
if self.tryPutSimpleFormattedPointer(pointer, typeName,
|
||||
innerType, displayFormat, limit):
|
||||
self.putNumChild(1)
|
||||
return
|
||||
|
||||
if DisplayFormat.Array10Format <= displayFormat and displayFormat <= DisplayFormat.Array1000Format:
|
||||
n = (10, 100, 1000, 10000)[displayFormat - DisplayFormat.Array10Format]
|
||||
if DisplayFormat.Array10 <= displayFormat and displayFormat <= DisplayFormat.Array1000:
|
||||
n = (10, 100, 1000, 10000)[displayFormat - DisplayFormat.Array10]
|
||||
self.putType(typeName)
|
||||
self.putItemCount(n)
|
||||
self.putArrayData(value.pointer(), n, innerType)
|
||||
return
|
||||
|
||||
if innerType.code == TypeCode.TypeCodeFunction:
|
||||
if innerType.code == TypeCode.Function:
|
||||
# A function pointer.
|
||||
self.putSymbolValue(pointer)
|
||||
self.putType(typeName)
|
||||
@@ -2124,12 +2120,12 @@ class DumperBase():
|
||||
break
|
||||
|
||||
def currentItemFormat(self, typeName=None):
|
||||
displayFormat = self.formats.get(self.currentIName, DisplayFormat.AutomaticFormat)
|
||||
if displayFormat == DisplayFormat.AutomaticFormat:
|
||||
displayFormat = self.formats.get(self.currentIName, DisplayFormat.Automatic)
|
||||
if displayFormat == DisplayFormat.Automatic:
|
||||
if typeName is None:
|
||||
typeName = self.currentType.value
|
||||
needle = None if typeName is None else self.stripForFormat(typeName)
|
||||
displayFormat = self.typeformats.get(needle, DisplayFormat.AutomaticFormat)
|
||||
displayFormat = self.typeformats.get(needle, DisplayFormat.Automatic)
|
||||
return displayFormat
|
||||
|
||||
def putSubItem(self, component, value): # -> ReportItem
|
||||
@@ -2181,7 +2177,7 @@ class DumperBase():
|
||||
if n > maxNumChild:
|
||||
self.putField('plotelided', n) # FIXME: Act on that in frontend
|
||||
n = maxNumChild
|
||||
if self.currentItemFormat() == DisplayFormat.ArrayPlotFormat and innerType.isSimpleType():
|
||||
if self.currentItemFormat() == DisplayFormat.ArrayPlot and innerType.isSimpleType():
|
||||
enc = innerType.simpleEncoding()
|
||||
if enc:
|
||||
self.putField('editencoding', enc)
|
||||
@@ -2221,7 +2217,7 @@ class DumperBase():
|
||||
|
||||
def extractPointer(self, value):
|
||||
try:
|
||||
if value.type.code == TypeCode.TypeCodeArray:
|
||||
if value.type.code == TypeCode.Array:
|
||||
return value.address()
|
||||
except:
|
||||
pass
|
||||
@@ -2318,8 +2314,8 @@ class DumperBase():
|
||||
shadowed = {}
|
||||
for value in variables:
|
||||
if value.name == 'argv':
|
||||
if value.type.code == TypeCode.TypeCodePointer:
|
||||
if value.type.ltarget.code == TypeCode.TypeCodePointer:
|
||||
if value.type.code == TypeCode.Pointer:
|
||||
if value.type.ltarget.code == TypeCode.Pointer:
|
||||
if value.type.ltarget.ltarget.name == 'char':
|
||||
self.putSpecialArgv(value)
|
||||
continue
|
||||
@@ -2676,19 +2672,19 @@ class DumperBase():
|
||||
|
||||
# Try on possibly typedefed type first.
|
||||
if self.tryPutPrettyItem(typeName, value):
|
||||
if typeobj.code == TypeCode.TypeCodePointer:
|
||||
if typeobj.code == TypeCode.Pointer:
|
||||
self.putOriginalAddress(value.address())
|
||||
else:
|
||||
self.putAddress(value.address())
|
||||
return
|
||||
|
||||
if typeobj.code == TypeCode.TypeCodeTypedef:
|
||||
if typeobj.code == TypeCode.Typedef:
|
||||
#DumperBase.warn('TYPEDEF VALUE: %s' % value.stringify())
|
||||
self.putItem(value.detypedef())
|
||||
self.putBetterType(typeName)
|
||||
return
|
||||
|
||||
if typeobj.code == TypeCode.TypeCodePointer:
|
||||
if typeobj.code == TypeCode.Pointer:
|
||||
self.putFormattedPointer(value)
|
||||
if value.summary and self.useFancy:
|
||||
self.putValue(self.hexencode(value.summary), 'utf8:1:0')
|
||||
@@ -2696,26 +2692,26 @@ class DumperBase():
|
||||
|
||||
self.putAddress(value.address())
|
||||
|
||||
if typeobj.code == TypeCode.TypeCodeFunction:
|
||||
if typeobj.code == TypeCode.Function:
|
||||
#DumperBase.warn('FUNCTION VALUE: %s' % value)
|
||||
self.putType(typeobj)
|
||||
self.putSymbolValue(value.pointer())
|
||||
self.putNumChild(0)
|
||||
return
|
||||
|
||||
if typeobj.code == TypeCode.TypeCodeEnum:
|
||||
if typeobj.code == TypeCode.Enum:
|
||||
#DumperBase.warn('ENUM VALUE: %s' % value.stringify())
|
||||
self.putType(typeobj.name)
|
||||
self.putValue(value.display())
|
||||
self.putNumChild(0)
|
||||
return
|
||||
|
||||
if typeobj.code == TypeCode.TypeCodeArray:
|
||||
if typeobj.code == TypeCode.Array:
|
||||
#DumperBase.warn('ARRAY VALUE: %s' % value)
|
||||
self.putCStyleArray(value)
|
||||
return
|
||||
|
||||
if typeobj.code == TypeCode.TypeCodeBitfield:
|
||||
if typeobj.code == TypeCode.Bitfield:
|
||||
#DumperBase.warn('BITFIELD VALUE: %s %d %s' % (value.name, value.lvalue, typeName))
|
||||
self.putNumChild(0)
|
||||
dd = typeobj.ltarget.typeData().enumDisplay
|
||||
@@ -2724,7 +2720,7 @@ class DumperBase():
|
||||
self.putType(typeName)
|
||||
return
|
||||
|
||||
if typeobj.code == TypeCode.TypeCodeIntegral:
|
||||
if typeobj.code == TypeCode.Integral:
|
||||
#DumperBase.warn('INTEGER: %s %s' % (value.name, value))
|
||||
val = value.value()
|
||||
self.putNumChild(0)
|
||||
@@ -2732,14 +2728,14 @@ class DumperBase():
|
||||
self.putType(typeName)
|
||||
return
|
||||
|
||||
if typeobj.code == TypeCode.TypeCodeFloat:
|
||||
if typeobj.code == TypeCode.Float:
|
||||
#DumperBase.warn('FLOAT VALUE: %s' % value)
|
||||
self.putValue(value.value())
|
||||
self.putNumChild(0)
|
||||
self.putType(typeobj.name)
|
||||
return
|
||||
|
||||
if typeobj.code in (TypeCode.TypeCodeReference, TypeCode.TypeCodeRValueReference):
|
||||
if typeobj.code in (TypeCode.Reference, TypeCode.RValueReference):
|
||||
#DumperBase.warn('REFERENCE VALUE: %s' % value)
|
||||
val = value.dereference()
|
||||
if val.laddress != 0:
|
||||
@@ -2749,13 +2745,13 @@ class DumperBase():
|
||||
self.putBetterType(typeName)
|
||||
return
|
||||
|
||||
if typeobj.code == TypeCode.TypeCodeComplex:
|
||||
if typeobj.code == TypeCode.Complex:
|
||||
self.putType(typeobj)
|
||||
self.putValue(value.display())
|
||||
self.putNumChild(0)
|
||||
return
|
||||
|
||||
if typeobj.code == TypeCode.TypeCodeFortranString:
|
||||
if typeobj.code == TypeCode.FortranString:
|
||||
self.putValue(self.hexencode(value.data()), 'latin1')
|
||||
self.putNumChild(0)
|
||||
self.putType(typeobj)
|
||||
@@ -2907,14 +2903,14 @@ class DumperBase():
|
||||
return '<unknown data>'
|
||||
|
||||
def pointer(self):
|
||||
if self.type.code == TypeCode.TypeCodeTypedef:
|
||||
if self.type.code == TypeCode.Typedef:
|
||||
return self.detypedef().pointer()
|
||||
return self.extractInteger(self.dumper.ptrSize() * 8, True)
|
||||
|
||||
def integer(self, bitsize=None):
|
||||
if self.type.code == TypeCode.TypeCodeTypedef:
|
||||
if self.type.code == TypeCode.Typedef:
|
||||
return self.detypedef().integer()
|
||||
elif self.type.code == TypeCode.TypeCodeBitfield:
|
||||
elif self.type.code == TypeCode.Bitfield:
|
||||
return self.lvalue
|
||||
# Could be something like 'short unsigned int'
|
||||
unsigned = self.type.name == 'unsigned' \
|
||||
@@ -2927,7 +2923,7 @@ class DumperBase():
|
||||
def floatingPoint(self):
|
||||
if self.nativeValue is not None and not self.dumper.isCdb:
|
||||
return str(self.nativeValue)
|
||||
if self.type.code == TypeCode.TypeCodeTypedef:
|
||||
if self.type.code == TypeCode.Typedef:
|
||||
return self.detypedef().floatingPoint()
|
||||
if self.type.size() == 8:
|
||||
return self.extractSomething('d', 64)
|
||||
@@ -2973,17 +2969,17 @@ class DumperBase():
|
||||
|
||||
def value(self):
|
||||
if self.type is not None:
|
||||
if self.type.code == TypeCode.TypeCodeEnum:
|
||||
if self.type.code == TypeCode.Enum:
|
||||
return self.displayEnum()
|
||||
if self.type.code == TypeCode.TypeCodeTypedef:
|
||||
if self.type.code == TypeCode.Typedef:
|
||||
return self.detypedef().value()
|
||||
if self.type.code == TypeCode.TypeCodeIntegral:
|
||||
if self.type.code == TypeCode.Integral:
|
||||
return self.integer()
|
||||
if self.type.code == TypeCode.TypeCodeBitfield:
|
||||
if self.type.code == TypeCode.Bitfield:
|
||||
return self.integer()
|
||||
if self.type.code == TypeCode.TypeCodeFloat:
|
||||
if self.type.code == TypeCode.Float:
|
||||
return self.floatingPoint()
|
||||
if self.type.code == TypeCode.TypeCodePointer:
|
||||
if self.type.code == TypeCode.Pointer:
|
||||
return self.pointer()
|
||||
return None
|
||||
|
||||
@@ -2992,31 +2988,31 @@ class DumperBase():
|
||||
|
||||
def findMemberByName(self, name):
|
||||
self.check()
|
||||
if self.type.code == TypeCode.TypeCodeTypedef:
|
||||
if self.type.code == TypeCode.Typedef:
|
||||
return self.findMemberByName(self.detypedef())
|
||||
if self.type.code in (
|
||||
TypeCode.TypeCodePointer,
|
||||
TypeCode.TypeCodeReference,
|
||||
TypeCode.TypeCodeRValueReference):
|
||||
TypeCode.Pointer,
|
||||
TypeCode.Reference,
|
||||
TypeCode.RValueReference):
|
||||
res = self.dereference().findMemberByName(name)
|
||||
if res is not None:
|
||||
return res
|
||||
if self.type.code == TypeCode.TypeCodeStruct:
|
||||
if self.type.code == TypeCode.Struct:
|
||||
#DumperBase.warn('SEARCHING FOR MEMBER: %s IN %s' % (name, self.type.name))
|
||||
members = self.members(True)
|
||||
#DumperBase.warn('MEMBERS: %s' % members)
|
||||
for member in members:
|
||||
#DumperBase.warn('CHECKING FIELD %s' % member.name)
|
||||
if member.type.code == TypeCode.TypeCodeTypedef:
|
||||
if member.type.code == TypeCode.Typedef:
|
||||
member = member.detypedef()
|
||||
if member.name == name:
|
||||
return member
|
||||
for member in members:
|
||||
if member.type.code == TypeCode.TypeCodeTypedef:
|
||||
if member.type.code == TypeCode.Typedef:
|
||||
member = member.detypedef()
|
||||
if member.name == name: # Could be base class.
|
||||
return member
|
||||
if member.type.code == TypeCode.TypeCodeStruct:
|
||||
if member.type.code == TypeCode.Struct:
|
||||
res = member.findMemberByName(name)
|
||||
if res is not None:
|
||||
return res
|
||||
@@ -3025,11 +3021,11 @@ class DumperBase():
|
||||
def __getitem__(self, index):
|
||||
#DumperBase.warn('GET ITEM %s %s' % (self, index))
|
||||
self.check()
|
||||
if self.type.code == TypeCode.TypeCodeTypedef:
|
||||
if self.type.code == TypeCode.Typedef:
|
||||
#DumperBase.warn('GET ITEM STRIP TYPEDEFS TO %s' % self.type.ltarget)
|
||||
return self.cast(self.type.ltarget).__getitem__(index)
|
||||
if isinstance(index, str):
|
||||
if self.type.code == TypeCode.TypeCodePointer:
|
||||
if self.type.code == TypeCode.Pointer:
|
||||
#DumperBase.warn('GET ITEM %s DEREFERENCE TO %s' % (self, self.dereference()))
|
||||
return self.dereference().__getitem__(index)
|
||||
res = self.findMemberByName(index)
|
||||
@@ -3040,10 +3036,10 @@ class DumperBase():
|
||||
elif isinstance(index, self.dumper.Field):
|
||||
field = index
|
||||
elif self.dumper.isInt(index):
|
||||
if self.type.code == TypeCode.TypeCodeArray:
|
||||
if self.type.code == TypeCode.Array:
|
||||
addr = self.laddress + int(index) * self.type.ltarget.size()
|
||||
return self.dumper.createValue(addr, self.type.ltarget)
|
||||
if self.type.code == TypeCode.TypeCodePointer:
|
||||
if self.type.code == TypeCode.Pointer:
|
||||
addr = self.pointer() + int(index) * self.type.ltarget.size()
|
||||
return self.dumper.createValue(addr, self.type.ltarget)
|
||||
return self.members(False)[index]
|
||||
@@ -3052,7 +3048,7 @@ class DumperBase():
|
||||
field.check()
|
||||
|
||||
#DumperBase.warn('EXTRACT FIELD: %s, BASE 0x%x' % (field, self.address()))
|
||||
if self.type.code == TypeCode.TypeCodePointer:
|
||||
if self.type.code == TypeCode.Pointer:
|
||||
#DumperBase.warn('IS TYPEDEFED POINTER!')
|
||||
res = self.dereference()
|
||||
#DumperBase.warn('WAS POINTER: %s' % res)
|
||||
@@ -3069,9 +3065,9 @@ class DumperBase():
|
||||
#DumperBase.warn('EXTRACTOR SUCCEEDED: %s ' % val)
|
||||
return val
|
||||
|
||||
if self.type.code == TypeCode.TypeCodeTypedef:
|
||||
if self.type.code == TypeCode.Typedef:
|
||||
return self.cast(self.type.ltarget).extractField(field)
|
||||
if self.type.code in (TypeCode.TypeCodeReference, TypeCode.TypeCodeRValueReference):
|
||||
if self.type.code in (TypeCode.Reference, TypeCode.RValueReference):
|
||||
return self.dereference().extractField(field)
|
||||
#DumperBase.warn('FIELD: %s ' % field)
|
||||
val = self.dumper.Value(self.dumper)
|
||||
@@ -3092,7 +3088,7 @@ class DumperBase():
|
||||
fieldOffset = fieldBitpos // 8
|
||||
fieldType = field.fieldType()
|
||||
|
||||
if fieldType.code == TypeCode.TypeCodeBitfield:
|
||||
if fieldType.code == TypeCode.Bitfield:
|
||||
fieldBitpos -= fieldOffset * 8
|
||||
ldata = self.data()
|
||||
data = 0
|
||||
@@ -3116,7 +3112,7 @@ class DumperBase():
|
||||
else:
|
||||
self.dumper.check(False)
|
||||
|
||||
if fieldType.code in (TypeCode.TypeCodeReference, TypeCode.TypeCodeRValueReference):
|
||||
if fieldType.code in (TypeCode.Reference, TypeCode.RValueReference):
|
||||
if val.laddress is not None:
|
||||
val = self.dumper.createReferenceValue(val.laddress, fieldType.ltarget)
|
||||
val.name = field.name
|
||||
@@ -3131,7 +3127,7 @@ class DumperBase():
|
||||
# implementations.
|
||||
def members(self, includeBases):
|
||||
#DumperBase.warn("LISTING MEMBERS OF %s" % self)
|
||||
if self.type.code == TypeCode.TypeCodeTypedef:
|
||||
if self.type.code == TypeCode.Typedef:
|
||||
return self.detypedef().members(includeBases)
|
||||
|
||||
tdata = self.type.typeData()
|
||||
@@ -3163,7 +3159,7 @@ class DumperBase():
|
||||
self.check()
|
||||
if self.dumper.isInt(other):
|
||||
stripped = self.type.stripTypedefs()
|
||||
if stripped.code == TypeCode.TypeCodePointer:
|
||||
if stripped.code == TypeCode.Pointer:
|
||||
address = self.pointer() + stripped.dereference().size() * other
|
||||
val = self.dumper.Value(self.dumper)
|
||||
val.laddress = None
|
||||
@@ -3176,16 +3172,16 @@ class DumperBase():
|
||||
self.check()
|
||||
if self.type.name == other.type.name:
|
||||
stripped = self.type.stripTypedefs()
|
||||
if stripped.code == TypeCode.TypeCodePointer:
|
||||
if stripped.code == TypeCode.Pointer:
|
||||
return (self.pointer() - other.pointer()) // stripped.dereference().size()
|
||||
raise RuntimeError('BAD DATA TO SUB TO: %s %s' % (self.type, other))
|
||||
|
||||
def dereference(self):
|
||||
self.check()
|
||||
if self.type.code == TypeCode.TypeCodeTypedef:
|
||||
if self.type.code == TypeCode.Typedef:
|
||||
return self.detypedef().dereference()
|
||||
val = self.dumper.Value(self.dumper)
|
||||
if self.type.code in (TypeCode.TypeCodeReference, TypeCode.TypeCodeRValueReference):
|
||||
if self.type.code in (TypeCode.Reference, TypeCode.RValueReference):
|
||||
val.summary = self.summary
|
||||
if self.nativeValue is None:
|
||||
val.laddress = self.pointer()
|
||||
@@ -3194,7 +3190,7 @@ class DumperBase():
|
||||
val.type = self.dumper.nativeDynamicType(val.laddress, self.type.dereference())
|
||||
else:
|
||||
val = self.dumper.nativeValueDereferenceReference(self)
|
||||
elif self.type.code == TypeCode.TypeCodePointer:
|
||||
elif self.type.code == TypeCode.Pointer:
|
||||
if self.nativeValue is None:
|
||||
val.laddress = self.pointer()
|
||||
val.type = self.dumper.nativeDynamicType(val.laddress, self.type.dereference())
|
||||
@@ -3211,7 +3207,7 @@ class DumperBase():
|
||||
|
||||
def detypedef(self):
|
||||
self.check()
|
||||
if self.type.code != TypeCode.TypeCodeTypedef:
|
||||
if self.type.code != TypeCode.Typedef:
|
||||
raise RuntimeError("WRONG")
|
||||
val = self.copy()
|
||||
val.type = self.type.ltarget
|
||||
@@ -3452,7 +3448,7 @@ class DumperBase():
|
||||
tdata = self.typeData()
|
||||
if tdata is None:
|
||||
return None
|
||||
if tdata.code != TypeCode.TypeCodeStruct:
|
||||
if tdata.code != TypeCode.Struct:
|
||||
return None
|
||||
try:
|
||||
vtbl = self.dumper.extractPointer(address)
|
||||
@@ -3482,7 +3478,7 @@ class DumperBase():
|
||||
raise RuntimeError('TYPE WITHOUT NAME: %s' % self.typeId)
|
||||
|
||||
def dereference(self):
|
||||
if self.code == TypeCode.TypeCodeTypedef:
|
||||
if self.code == TypeCode.Typedef:
|
||||
return self.ltarget.dereference()
|
||||
self.check()
|
||||
return self.ltarget
|
||||
@@ -3530,27 +3526,18 @@ class DumperBase():
|
||||
return res
|
||||
|
||||
def isSimpleType(self):
|
||||
return self.code in (
|
||||
TypeCode.TypeCodeIntegral,
|
||||
TypeCode.TypeCodeFloat,
|
||||
TypeCode.TypeCodeEnum)
|
||||
return self.code in (TypeCode.Integral, TypeCode.Float, TypeCode.Enum)
|
||||
|
||||
def alignment(self):
|
||||
tdata = self.typeData()
|
||||
if tdata.code == TypeCode.TypeCodeTypedef:
|
||||
if tdata.code == TypeCode.Typedef:
|
||||
return tdata.ltarget.alignment()
|
||||
if tdata.code in (
|
||||
TypeCode.TypeCodeIntegral,
|
||||
TypeCode.TypeCodeFloat,
|
||||
TypeCode.TypeCodeEnum):
|
||||
if tdata.code in (TypeCode.Integral, TypeCode.Float, TypeCode.Enum):
|
||||
if tdata.name in ('double', 'long long', 'unsigned long long'):
|
||||
# Crude approximation.
|
||||
return 8 if self.dumper.isWindowsTarget() else self.dumper.ptrSize()
|
||||
return self.size()
|
||||
if tdata.code in (
|
||||
TypeCode.TypeCodePointer,
|
||||
TypeCode.TypeCodeReference,
|
||||
TypeCode.TypeCodeRValueReference):
|
||||
if tdata.code in (TypeCode.Pointer, TypeCode.Reference, TypeCode.RValueReference):
|
||||
return self.dumper.ptrSize()
|
||||
if tdata.lalignment is not None:
|
||||
#if isinstance(tdata.lalignment, function): # Does not work that way.
|
||||
@@ -3566,7 +3553,7 @@ class DumperBase():
|
||||
return self.typeData().ltarget
|
||||
|
||||
def stripTypedefs(self):
|
||||
if isinstance(self, self.dumper.Type) and self.code != TypeCode.TypeCodeTypedef:
|
||||
if isinstance(self, self.dumper.Type) and self.code != TypeCode.Typedef:
|
||||
#DumperBase.warn('NO TYPEDEF: %s' % self)
|
||||
return self
|
||||
return self.ltarget
|
||||
@@ -3583,10 +3570,7 @@ class DumperBase():
|
||||
raise RuntimeError('DONT KNOW SIZE: %s' % self)
|
||||
|
||||
def isMovableType(self):
|
||||
if self.code in (
|
||||
TypeCode.TypeCodePointer,
|
||||
TypeCode.TypeCodeIntegral,
|
||||
TypeCode.TypeCodeFloat):
|
||||
if self.code in (TypeCode.Pointer, TypeCode.Integral, TypeCode.Float):
|
||||
return True
|
||||
strippedName = self.dumper.stripNamespaceFromType(self.name)
|
||||
if strippedName in (
|
||||
@@ -3690,7 +3674,7 @@ class DumperBase():
|
||||
tdata.name = targetType.name + '*'
|
||||
tdata.typeId = typeId
|
||||
tdata.lbitsize = 8 * self.ptrSize()
|
||||
tdata.code = TypeCode.TypeCodePointer
|
||||
tdata.code = TypeCode.Pointer
|
||||
tdata.ltarget = targetType
|
||||
self.registerType(typeId, tdata)
|
||||
return self.Type(self, typeId)
|
||||
@@ -3703,7 +3687,7 @@ class DumperBase():
|
||||
tdata = self.TypeData(self)
|
||||
tdata.name = targetType.name + ' &'
|
||||
tdata.typeId = typeId
|
||||
tdata.code = TypeCode.TypeCodeReference
|
||||
tdata.code = TypeCode.Reference
|
||||
tdata.ltarget = targetType
|
||||
tdata.lbitsize = 8 * self.ptrSize() # Needed for Gdb13393 test.
|
||||
#tdata.lbitsize = None
|
||||
@@ -3718,7 +3702,7 @@ class DumperBase():
|
||||
tdata = self.TypeData(self)
|
||||
tdata.name = targetType.name + ' &&'
|
||||
tdata.typeId = typeId
|
||||
tdata.code = TypeCode.TypeCodeRValueReference
|
||||
tdata.code = TypeCode.RValueReference
|
||||
tdata.ltarget = targetType
|
||||
tdata.lbitsize = None
|
||||
self.registerType(typeId, tdata)
|
||||
@@ -3741,7 +3725,7 @@ class DumperBase():
|
||||
tdata = self.TypeData(self)
|
||||
tdata.name = type_name
|
||||
tdata.typeId = type_id
|
||||
tdata.code = TypeCode.TypeCodeArray
|
||||
tdata.code = TypeCode.Array
|
||||
tdata.ltarget = targetType
|
||||
tdata.lbitsize = targetType.lbitsize * count
|
||||
self.registerType(type_id, tdata)
|
||||
@@ -3755,7 +3739,7 @@ class DumperBase():
|
||||
tdata = self.TypeData(self)
|
||||
tdata.name = '%s : %d' % (targetType.typeId, bitsize)
|
||||
tdata.typeId = typeId
|
||||
tdata.code = TypeCode.TypeCodeBitfield
|
||||
tdata.code = TypeCode.Bitfield
|
||||
tdata.ltarget = targetType
|
||||
tdata.lbitsize = bitsize
|
||||
self.registerType(typeId, tdata)
|
||||
@@ -3773,7 +3757,7 @@ class DumperBase():
|
||||
tdata = self.TypeData(self)
|
||||
tdata.name = typeName
|
||||
tdata.typeId = typeId
|
||||
tdata.code = TypeCode.TypeCodeTypedef
|
||||
tdata.code = TypeCode.Typedef
|
||||
tdata.ltarget = targetType
|
||||
tdata.lbitsize = targetType.lbitsize
|
||||
#tdata.lfields = targetType.lfields
|
||||
|
@@ -365,29 +365,29 @@ class Dumper(DumperBase):
|
||||
tdata.typeId = typeId
|
||||
tdata.lbitsize = nativeType.sizeof * 8
|
||||
tdata.code = {
|
||||
#gdb.TYPE_CODE_TYPEDEF : TypeCodeTypedef, # Handled above.
|
||||
gdb.TYPE_CODE_METHOD: TypeCode.TypeCodeFunction,
|
||||
gdb.TYPE_CODE_VOID: TypeCode.TypeCodeVoid,
|
||||
gdb.TYPE_CODE_FUNC: TypeCode.TypeCodeFunction,
|
||||
gdb.TYPE_CODE_METHODPTR: TypeCode.TypeCodeFunction,
|
||||
gdb.TYPE_CODE_MEMBERPTR: TypeCode.TypeCodeFunction,
|
||||
#gdb.TYPE_CODE_PTR : TypeCode.TypeCodePointer, # Handled above.
|
||||
#gdb.TYPE_CODE_REF : TypeCode.TypeCodeReference, # Handled above.
|
||||
gdb.TYPE_CODE_BOOL: TypeCode.TypeCodeIntegral,
|
||||
gdb.TYPE_CODE_CHAR: TypeCode.TypeCodeIntegral,
|
||||
gdb.TYPE_CODE_INT: TypeCode.TypeCodeIntegral,
|
||||
gdb.TYPE_CODE_FLT: TypeCode.TypeCodeFloat,
|
||||
gdb.TYPE_CODE_ENUM: TypeCode.TypeCodeEnum,
|
||||
#gdb.TYPE_CODE_ARRAY : TypeCode.TypeCodeArray,
|
||||
gdb.TYPE_CODE_STRUCT: TypeCode.TypeCodeStruct,
|
||||
gdb.TYPE_CODE_UNION: TypeCode.TypeCodeStruct,
|
||||
gdb.TYPE_CODE_COMPLEX: TypeCode.TypeCodeComplex,
|
||||
gdb.TYPE_CODE_STRING: TypeCode.TypeCodeFortranString,
|
||||
#gdb.TYPE_CODE_TYPEDEF : TypeCode.Typedef, # Handled above.
|
||||
gdb.TYPE_CODE_METHOD: TypeCode.Function,
|
||||
gdb.TYPE_CODE_VOID: TypeCode.Void,
|
||||
gdb.TYPE_CODE_FUNC: TypeCode.Function,
|
||||
gdb.TYPE_CODE_METHODPTR: TypeCode.Function,
|
||||
gdb.TYPE_CODE_MEMBERPTR: TypeCode.Function,
|
||||
#gdb.TYPE_CODE_PTR : TypeCode.Pointer, # Handled above.
|
||||
#gdb.TYPE_CODE_REF : TypeCode.Reference, # Handled above.
|
||||
gdb.TYPE_CODE_BOOL: TypeCode.Integral,
|
||||
gdb.TYPE_CODE_CHAR: TypeCode.Integral,
|
||||
gdb.TYPE_CODE_INT: TypeCode.Integral,
|
||||
gdb.TYPE_CODE_FLT: TypeCode.Float,
|
||||
gdb.TYPE_CODE_ENUM: TypeCode.Enum,
|
||||
#gdb.TYPE_CODE_ARRAY : TypeCode.Array,
|
||||
gdb.TYPE_CODE_STRUCT: TypeCode.Struct,
|
||||
gdb.TYPE_CODE_UNION: TypeCode.Struct,
|
||||
gdb.TYPE_CODE_COMPLEX: TypeCode.Complex,
|
||||
gdb.TYPE_CODE_STRING: TypeCode.FortranString,
|
||||
}[code]
|
||||
if tdata.code == TypeCode.TypeCodeEnum:
|
||||
if tdata.code == TypeCode.Enum:
|
||||
tdata.enumDisplay = lambda intval, addr, form: \
|
||||
self.nativeTypeEnumDisplay(nativeType, intval, form)
|
||||
if tdata.code == TypeCode.TypeCodeStruct:
|
||||
if tdata.code == TypeCode.Struct:
|
||||
tdata.lalignment = lambda: \
|
||||
self.nativeStructAlignment(nativeType)
|
||||
tdata.lfields = lambda value: \
|
||||
|
@@ -436,32 +436,32 @@ class Dumper(DumperBase):
|
||||
tdata.lbitsize = nativeType.GetByteSize() * 8
|
||||
if code == lldb.eTypeClassBuiltin:
|
||||
if utils.isFloatingPointTypeName(typeName):
|
||||
tdata.code = TypeCode.TypeCodeFloat
|
||||
tdata.code = TypeCode.Float
|
||||
elif utils.isIntegralTypeName(typeName):
|
||||
tdata.code = TypeCode.TypeCodeIntegral
|
||||
tdata.code = TypeCode.Integral
|
||||
elif typeName in ('__int128', 'unsigned __int128'):
|
||||
tdata.code = TypeCode.TypeCodeIntegral
|
||||
tdata.code = TypeCode.Integral
|
||||
elif typeName == 'void':
|
||||
tdata.code = TypeCode.TypeCodeVoid
|
||||
tdata.code = TypeCode.Void
|
||||
else:
|
||||
self.warn('UNKNOWN TYPE KEY: %s: %s' % (typeName, code))
|
||||
elif code == lldb.eTypeClassEnumeration:
|
||||
tdata.code = TypeCode.TypeCodeEnum
|
||||
tdata.code = TypeCode.Enum
|
||||
tdata.enumDisplay = lambda intval, addr, form: \
|
||||
self.nativeTypeEnumDisplay(nativeType, intval, form)
|
||||
elif code in (lldb.eTypeClassComplexInteger, lldb.eTypeClassComplexFloat):
|
||||
tdata.code = TypeCode.TypeCodeComplex
|
||||
tdata.code = TypeCode.Complex
|
||||
elif code in (lldb.eTypeClassClass, lldb.eTypeClassStruct, lldb.eTypeClassUnion):
|
||||
tdata.code = TypeCode.TypeCodeStruct
|
||||
tdata.code = TypeCode.Struct
|
||||
tdata.lalignment = lambda: \
|
||||
self.nativeStructAlignment(nativeType)
|
||||
tdata.lfields = lambda value: \
|
||||
self.listMembers(value, nativeType)
|
||||
tdata.templateArguments = self.listTemplateParametersHelper(nativeType)
|
||||
elif code == lldb.eTypeClassFunction:
|
||||
tdata.code = TypeCode.TypeCodeFunction
|
||||
tdata.code = TypeCode.Function
|
||||
elif code == lldb.eTypeClassMemberPointer:
|
||||
tdata.code = TypeCode.TypeCodeMemberPointer
|
||||
tdata.code = TypeCode.MemberPointer
|
||||
|
||||
self.registerType(typeId, tdata) # Fix up fields and template args
|
||||
# warn('CREATE TYPE: %s' % typeId)
|
||||
|
@@ -111,7 +111,7 @@ def qdump____m512i(d, value):
|
||||
|
||||
|
||||
def qform__std__array():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qdump__gsl__span(d, value):
|
||||
@@ -201,7 +201,7 @@ def qdump__NimStringDesc(d, value):
|
||||
|
||||
def qdump__NimGenericSequence__(d, value, regex=r'^TY[\d]+$'):
|
||||
code = value.type.stripTypedefs().code
|
||||
if code == TypeCode.TypeCodeStruct:
|
||||
if code == TypeCode.Struct:
|
||||
size, reserved = d.split('pp', value)
|
||||
data = value.address() + 2 * d.ptrSize()
|
||||
typeobj = value['data'].type.dereference()
|
||||
|
@@ -33,7 +33,7 @@ def qdump__cv__Size_(d, value):
|
||||
|
||||
|
||||
def qform__cv__Mat():
|
||||
return [DisplayFormat.SeparateFormat]
|
||||
return [DisplayFormat.Separate]
|
||||
|
||||
|
||||
def qdump__cv__Mat(d, value):
|
||||
@@ -47,7 +47,7 @@ def qdump__cv__Mat(d, value):
|
||||
d.putPlainChildren(value)
|
||||
return
|
||||
|
||||
if d.currentItemFormat() == DisplayFormat.SeparateFormat:
|
||||
if d.currentItemFormat() == DisplayFormat.Separate:
|
||||
rs = steps[0] * innerSize
|
||||
cs = cols * innerSize
|
||||
dform = 'arraydata:separate:int:%d::2:%d:%d' % (innerSize, cols, rows)
|
||||
@@ -57,7 +57,7 @@ def qdump__cv__Mat(d, value):
|
||||
d.putValue('(%s x %s)' % (rows, cols))
|
||||
if d.isExpanded():
|
||||
with Children(d):
|
||||
innerType = d.createType(TypeCode.TypeCodeIntegral, innerSize)
|
||||
innerType = d.createType(TypeCode.Integral, innerSize)
|
||||
for i in range(rows):
|
||||
for j in range(cols):
|
||||
with SubItem(d, None):
|
||||
|
@@ -45,8 +45,8 @@ def qdump__QAtomicPointer(d, value):
|
||||
|
||||
|
||||
def qform__QByteArray():
|
||||
return [DisplayFormat.Latin1StringFormat, DisplayFormat.SeparateLatin1StringFormat,
|
||||
DisplayFormat.Utf8StringFormat, DisplayFormat.SeparateUtf8StringFormat]
|
||||
return [DisplayFormat.Latin1String, DisplayFormat.SeparateLatin1String,
|
||||
DisplayFormat.Utf8String, DisplayFormat.SeparateUtf8String]
|
||||
|
||||
|
||||
def qedit__QByteArray(d, value, data):
|
||||
@@ -61,14 +61,14 @@ def qdump__QByteArray(d, value):
|
||||
d.putNumChild(size)
|
||||
elided, p = d.encodeByteArrayHelper(d.extractPointer(value), d.displayStringLimit)
|
||||
displayFormat = d.currentItemFormat()
|
||||
if displayFormat == DisplayFormat.AutomaticFormat or displayFormat == DisplayFormat.Latin1StringFormat:
|
||||
if displayFormat == DisplayFormat.Automatic or displayFormat == DisplayFormat.Latin1String:
|
||||
d.putValue(p, 'latin1', elided=elided)
|
||||
elif displayFormat == DisplayFormat.SeparateLatin1StringFormat:
|
||||
elif displayFormat == DisplayFormat.SeparateLatin1String:
|
||||
d.putValue(p, 'latin1', elided=elided)
|
||||
d.putDisplay('latin1:separate', d.encodeByteArray(value, limit=100000))
|
||||
elif displayFormat == DisplayFormat.Utf8StringFormat:
|
||||
elif displayFormat == DisplayFormat.Utf8String:
|
||||
d.putValue(p, 'utf8', elided=elided)
|
||||
elif displayFormat == DisplayFormat.SeparateUtf8StringFormat:
|
||||
elif displayFormat == DisplayFormat.SeparateUtf8String:
|
||||
d.putValue(p, 'utf8', elided=elided)
|
||||
d.putDisplay('utf8:separate', d.encodeByteArray(value, limit=100000))
|
||||
if d.isExpanded():
|
||||
@@ -108,15 +108,15 @@ def qdump__QChar(d, value):
|
||||
|
||||
|
||||
def qform_X_QAbstractItemModel():
|
||||
return [DisplayFormat.SimpleFormat, DisplayFormat.EnhancedFormat]
|
||||
return [DisplayFormat.Simple, DisplayFormat.Enhanced]
|
||||
|
||||
|
||||
def qdump_X_QAbstractItemModel(d, value):
|
||||
displayFormat = d.currentItemFormat()
|
||||
if displayFormat == DisplayFormat.SimpleFormat:
|
||||
if displayFormat == DisplayFormat.Simple:
|
||||
d.putPlainChildren(value)
|
||||
return
|
||||
#displayFormat == EnhancedFormat:
|
||||
#displayFormat == Enhanced:
|
||||
# Create a default-constructed QModelIndex on the stack.
|
||||
try:
|
||||
ri = d.pokeValue(d.qtNamespace() + 'QModelIndex', '-1, -1, 0, 0')
|
||||
@@ -144,12 +144,12 @@ def qdump_X_QAbstractItemModel(d, value):
|
||||
|
||||
|
||||
def qform_X_QModelIndex():
|
||||
return [DisplayFormat.SimpleFormat, DisplayFormat.EnhancedFormat]
|
||||
return [DisplayFormat.Simple, DisplayFormat.Enhanced]
|
||||
|
||||
|
||||
def qdump_X_QModelIndex(d, value):
|
||||
displayFormat = d.currentItemFormat()
|
||||
if displayFormat == DisplayFormat.SimpleFormat:
|
||||
if displayFormat == DisplayFormat.Simple:
|
||||
d.putPlainChildren(value)
|
||||
return
|
||||
r = value['r']
|
||||
@@ -776,7 +776,7 @@ def qdump__QFixed(d, value):
|
||||
|
||||
|
||||
def qform__QFiniteStack():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qdump__QFiniteStack(d, value):
|
||||
@@ -795,7 +795,7 @@ def qdump__QFlags(d, value):
|
||||
|
||||
|
||||
def qform__QHash():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__QHash(d, value):
|
||||
@@ -858,7 +858,7 @@ def qdumpHelper_QHash(d, value, keyType, valueType):
|
||||
|
||||
|
||||
def qform__QHashNode():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__QHashNode(d, value):
|
||||
@@ -970,7 +970,7 @@ def qdump__QIPv6Address(d, value):
|
||||
|
||||
|
||||
def qform__QList():
|
||||
return [DisplayFormat.DirectQListStorageFormat, DisplayFormat.IndirectQListStorageFormat]
|
||||
return [DisplayFormat.DirectQListStorage, DisplayFormat.IndirectQListStorage]
|
||||
|
||||
|
||||
def qdump__QList(d, value):
|
||||
@@ -1003,9 +1003,9 @@ def qdumpHelper_QList(d, value, innerType):
|
||||
# in the frontend.
|
||||
# So as first approximation only do the 'isLarge' check:
|
||||
displayFormat = d.currentItemFormat()
|
||||
if displayFormat == DisplayFormat.DirectQListStorageFormat:
|
||||
if displayFormat == DisplayFormat.DirectQListStorage:
|
||||
isInternal = True
|
||||
elif displayFormat == DisplayFormat.IndirectQListStorageFormat:
|
||||
elif displayFormat == DisplayFormat.IndirectQListStorage:
|
||||
isInternal = False
|
||||
else:
|
||||
isInternal = innerSize <= stepSize and innerType.isMovableType()
|
||||
@@ -1027,7 +1027,7 @@ def qdumpHelper_QList(d, value, innerType):
|
||||
|
||||
|
||||
def qform__QImage():
|
||||
return [DisplayFormat.SimpleFormat, DisplayFormat.SeparateFormat]
|
||||
return [DisplayFormat.Simple, DisplayFormat.Separate]
|
||||
|
||||
|
||||
def qdump__QImage(d, value):
|
||||
@@ -1057,7 +1057,7 @@ def qdump__QImage(d, value):
|
||||
d.putType('void *')
|
||||
|
||||
displayFormat = d.currentItemFormat()
|
||||
if displayFormat == DisplayFormat.SeparateFormat:
|
||||
if displayFormat == DisplayFormat.Separate:
|
||||
d.putDisplay('imagedata:separate', '%08x%08x%08x%08x' % (width, height, nbytes, iformat)
|
||||
+ d.readMemory(bits, nbytes))
|
||||
|
||||
@@ -1202,7 +1202,7 @@ def qdumpHelper_Qt5_QMap(d, value, keyType, valueType):
|
||||
|
||||
|
||||
def qform__QMap():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__QMap(d, value):
|
||||
@@ -1217,7 +1217,7 @@ def qdumpHelper_QMap(d, value, keyType, valueType):
|
||||
|
||||
|
||||
def qform__QMultiMap():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__QMultiMap(d, value):
|
||||
@@ -1225,7 +1225,7 @@ def qdump__QMultiMap(d, value):
|
||||
|
||||
|
||||
def qform__QVariantMap():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__QVariantMap(d, value):
|
||||
@@ -1506,7 +1506,7 @@ def qdump__QSizePolicy(d, value):
|
||||
|
||||
|
||||
def qform__QStack():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qdump__QStack(d, value):
|
||||
@@ -1546,7 +1546,7 @@ def qedit__QString(d, value, data):
|
||||
|
||||
|
||||
def qform__QString():
|
||||
return [DisplayFormat.SimpleFormat, DisplayFormat.SeparateFormat]
|
||||
return [DisplayFormat.Simple, DisplayFormat.Separate]
|
||||
|
||||
|
||||
def qdump__QString(d, value):
|
||||
@@ -1554,7 +1554,7 @@ def qdump__QString(d, value):
|
||||
(data, size, alloc) = d.stringData(value)
|
||||
d.putNumChild(size)
|
||||
displayFormat = d.currentItemFormat()
|
||||
if displayFormat == DisplayFormat.SeparateFormat:
|
||||
if displayFormat == DisplayFormat.Separate:
|
||||
d.putDisplay('utf16:separate', d.encodeString(value, limit=100000))
|
||||
if d.isExpanded():
|
||||
d.putArrayData(data, size, d.createType('QChar'))
|
||||
@@ -1656,7 +1656,7 @@ def qdump__QTextDocument(d, value):
|
||||
|
||||
|
||||
def qform__QUrl():
|
||||
return [DisplayFormat.SimpleFormat, DisplayFormat.SeparateFormat]
|
||||
return [DisplayFormat.Simple, DisplayFormat.Separate]
|
||||
|
||||
|
||||
def qdump__QUrl(d, value):
|
||||
@@ -1698,7 +1698,7 @@ def qdump__QUrl(d, value):
|
||||
d.putValue(url, 'utf16')
|
||||
|
||||
displayFormat = d.currentItemFormat()
|
||||
if displayFormat == DisplayFormat.SeparateFormat:
|
||||
if displayFormat == DisplayFormat.Separate:
|
||||
d.putDisplay('utf16:separate', url)
|
||||
|
||||
d.putNumChild(1)
|
||||
@@ -2016,7 +2016,7 @@ def qedit__QVector(d, value, data):
|
||||
|
||||
|
||||
def qform__QVector():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qdump__QVector(d, value):
|
||||
@@ -2135,7 +2135,7 @@ def qdump__QXmlStreamAttribute(d, value):
|
||||
#######################################################################
|
||||
|
||||
def extractQmlData(d, value):
|
||||
#if value.type.code == TypeCode.TypeCodePointer:
|
||||
#if value.type.code == TypeCode.Pointer:
|
||||
# value = value.dereference()
|
||||
base = value.split('p')[0]
|
||||
#mmdata = d.split('Q', base)[0]
|
||||
|
@@ -28,7 +28,7 @@ from dumper import Children, SubItem
|
||||
|
||||
|
||||
def qform__std__array():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qdump__std__array(d, value):
|
||||
@@ -39,7 +39,7 @@ def qdump__std__array(d, value):
|
||||
|
||||
|
||||
def qform__std____1__array():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qdump__std____1__array(d, value):
|
||||
@@ -274,7 +274,7 @@ def qdump__std____1__list(d, value):
|
||||
|
||||
|
||||
def qform__std__map():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__std__map(d, value):
|
||||
@@ -357,7 +357,7 @@ def qdump__std____cxx1998__map(d, value):
|
||||
|
||||
|
||||
def qform__std__multimap():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__std__multimap(d, value):
|
||||
@@ -581,7 +581,7 @@ def qdump__std____1__multiset(d, value):
|
||||
|
||||
|
||||
def qform__std____1__map():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__std____1__map(d, value):
|
||||
@@ -620,7 +620,7 @@ def qdump__std____1__map(d, value):
|
||||
|
||||
|
||||
def qform__std____1__multimap():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__std____1__multimap(d, value):
|
||||
@@ -675,8 +675,8 @@ def qdump__std____1__stack(d, value):
|
||||
|
||||
|
||||
def qform__std__string():
|
||||
return [DisplayFormat.Latin1StringFormat, DisplayFormat.SeparateLatin1StringFormat,
|
||||
DisplayFormat.Utf8StringFormat, DisplayFormat.SeparateUtf8StringFormat]
|
||||
return [DisplayFormat.Latin1String, DisplayFormat.SeparateLatin1String,
|
||||
DisplayFormat.Utf8String, DisplayFormat.SeparateUtf8String]
|
||||
|
||||
|
||||
def qdump__std__string(d, value):
|
||||
@@ -826,11 +826,11 @@ def qdump__std__pair(d, value):
|
||||
|
||||
|
||||
def qform__std__unordered_map():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qform__std____debug__unordered_map():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__std__unordered_map(d, value):
|
||||
@@ -934,7 +934,7 @@ def qdump__std__unordered_set(d, value):
|
||||
|
||||
|
||||
def qform__std____1__unordered_map():
|
||||
return [DisplayFormat.CompactMapFormat]
|
||||
return [DisplayFormat.CompactMap]
|
||||
|
||||
|
||||
def qdump__std____1__unordered_map(d, value):
|
||||
@@ -992,7 +992,7 @@ def qdump__std____debug__unordered_multiset(d, value):
|
||||
|
||||
|
||||
def qform__std__valarray():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qdump__std__valarray(d, value):
|
||||
@@ -1005,7 +1005,7 @@ def qdump__std__valarray(d, value):
|
||||
|
||||
|
||||
def qform__std____1__valarray():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qdump__std____1__valarray(d, value):
|
||||
@@ -1017,7 +1017,7 @@ def qdump__std____1__valarray(d, value):
|
||||
|
||||
|
||||
def qform__std__vector():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qedit__std__vector(d, value, data):
|
||||
@@ -1119,7 +1119,7 @@ def qdumpHelper__std__vector__QNX(d, value):
|
||||
|
||||
|
||||
def qform__std____1__vector():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qdump__std____1__vector(d, value):
|
||||
@@ -1127,7 +1127,7 @@ def qdump__std____1__vector(d, value):
|
||||
|
||||
|
||||
def qform__std____debug__vector():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
return [DisplayFormat.ArrayPlot]
|
||||
|
||||
|
||||
def qdump__std____debug__vector(d, value):
|
||||
@@ -1182,7 +1182,7 @@ def qdump__string(d, value):
|
||||
|
||||
|
||||
def qform__std__wstring():
|
||||
return [DisplayFormat.SimpleFormat, DisplayFormat.SeparateFormat]
|
||||
return [DisplayFormat.Simple, DisplayFormat.Separate]
|
||||
|
||||
|
||||
def qdump__std__wstring(d, value):
|
||||
|
@@ -43,26 +43,26 @@ class DebuggerStartMode():
|
||||
# Known special formats. Keep in sync with DisplayFormat in debuggerprotocol.h
|
||||
class DisplayFormat():
|
||||
(
|
||||
AutomaticFormat,
|
||||
RawFormat,
|
||||
SimpleFormat,
|
||||
EnhancedFormat,
|
||||
SeparateFormat,
|
||||
Latin1StringFormat,
|
||||
SeparateLatin1StringFormat,
|
||||
Utf8StringFormat,
|
||||
SeparateUtf8StringFormat,
|
||||
Local8BitStringFormat,
|
||||
Utf16StringFormat,
|
||||
Ucs4StringFormat,
|
||||
Array10Format,
|
||||
Array100Format,
|
||||
Array1000Format,
|
||||
Array10000Format,
|
||||
ArrayPlotFormat,
|
||||
CompactMapFormat,
|
||||
DirectQListStorageFormat,
|
||||
IndirectQListStorageFormat,
|
||||
Automatic,
|
||||
Raw,
|
||||
Simple,
|
||||
Enhanced,
|
||||
Separate,
|
||||
Latin1String,
|
||||
SeparateLatin1String,
|
||||
Utf8String,
|
||||
SeparateUtf8String,
|
||||
Local8BitString,
|
||||
Utf16String,
|
||||
Ucs4String,
|
||||
Array10,
|
||||
Array100,
|
||||
Array1000,
|
||||
Array10000,
|
||||
ArrayPlot,
|
||||
CompactMap,
|
||||
DirectQListStorage,
|
||||
IndirectQListStorage,
|
||||
) = range(0, 20)
|
||||
|
||||
|
||||
@@ -89,22 +89,22 @@ class BreakpointType():
|
||||
# Internal codes for types keep in sync with cdbextensions pytype.cpp
|
||||
class TypeCode():
|
||||
(
|
||||
TypeCodeTypedef,
|
||||
TypeCodeStruct,
|
||||
TypeCodeVoid,
|
||||
TypeCodeIntegral,
|
||||
TypeCodeFloat,
|
||||
TypeCodeEnum,
|
||||
TypeCodePointer,
|
||||
TypeCodeArray,
|
||||
TypeCodeComplex,
|
||||
TypeCodeReference,
|
||||
TypeCodeFunction,
|
||||
TypeCodeMemberPointer,
|
||||
TypeCodeFortranString,
|
||||
TypeCodeUnresolvable,
|
||||
TypeCodeBitfield,
|
||||
TypeCodeRValueReference,
|
||||
Typedef,
|
||||
Struct,
|
||||
Void,
|
||||
Integral,
|
||||
Float,
|
||||
Enum,
|
||||
Pointer,
|
||||
Array,
|
||||
Complex,
|
||||
Reference,
|
||||
Function,
|
||||
MemberPointer,
|
||||
FortranString,
|
||||
Unresolvable,
|
||||
Bitfield,
|
||||
RValueReference,
|
||||
) = range(0, 16)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user