Commit 9c09ca9e authored by Orgad Shaneh's avatar Orgad Shaneh

Merge remote-tracking branch 'origin/4.2'

Change-Id: Ia98031eb87f1859c3736faa0cdd8b655e8a50689
parents 1a2f649b b5f587ef
......@@ -4,7 +4,7 @@ include(config/qtcreator-project.qdocconf)
HTML.footer = \
" </div>\n" \
" <p class=\"copy-notice\">\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2015 The Qt Company Ltd.\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2016 The Qt Company Ltd.\n" \
" Documentation contributions included herein are the copyrights of\n" \
" their respective owners. " \
" The documentation provided herein is licensed under the terms of the" \
......
......@@ -83,6 +83,19 @@
a custom icon is defined. You can assign several comma-separated stereotypes
to one element.
By default, when you select an element in a diagram, it is highlighted also
in the \uicontrol Structure view. To change this behavior so that selecting
an element in the \uicontrol Structure makes it highlighted also in the
diagram, click and hold the \inlineimage linkicon.png
button, and then select \uicontrol {Synchronize Diagram with Structure}.
To keep the selections in the diagram and the \uicontrol Structure view
synchronized, select \uicontrol {Keep Synchronized}.
To zoom into diagrams, press \key Ctrl++ or press \key Ctrl and roll the
mouse wheel up. To zoom out of diagrams, press \key Ctrl+- or press
\key Ctrl and roll the mouse wheel down. To reset the diagram size to 100%,
select \key Ctrl+0.
To print diagrams, press \key Ctrl+C when no elements are selected in
the editor to copy all elements to the clipboard by using 300 dpi. Then
paste the diagram to an application that can print images.
......
......@@ -3,7 +3,7 @@ import qbs.FileInfo
QtcProduct {
type: ["application", "autotest"]
Depends { name: "Qt.test" }
Depends { name: "Qt.testlib" }
Depends { name: "copyable_resource" }
targetName: "tst_" + name.split(' ').join("")
......
......@@ -8,7 +8,7 @@ QtcProduct {
useNonGuiPchFile: true
Depends {
condition: qtc.testsEnabled
name: "Qt.test"
name: "Qt.testlib"
}
targetName: QtcFunctions.qtLibraryName(qbs, name)
......
......@@ -22,7 +22,7 @@ QtcProduct {
Depends { name: "pluginjson" }
Depends {
condition: qtc.testsEnabled
name: "Qt.test"
name: "Qt.testlib"
}
Properties {
......
......@@ -53,5 +53,6 @@ while (my $line = <STDIN> ) {
# match a warning/error report
} elsif ($line =~ /^\[[W|E|I]\] /) {
$lastMessage = substr($line, 4);
$lastMessage =~ s/\\/\\\\/g;
}
}
......@@ -42,7 +42,7 @@ class FakeVoidType(cdbext.Type):
return self.typeName
def bitsize(self):
return 0 if self.typeName == 'void' else self.dumper.ptrSize() * 8
return self.dumper.ptrSize() * 8
def code(self):
if self.typeName.endswith('*'):
......@@ -85,6 +85,7 @@ class Dumper(DumperBase):
def fromNativeValue(self, nativeValue):
val = self.Value(self)
val.name = nativeValue.name()
val.nativeValue = nativeValue
val.type = self.fromNativeType(nativeValue.type())
val.lIsInScope = True
......@@ -109,6 +110,9 @@ class Dumper(DumperBase):
self.check(isinstance(nativeType, cdbext.Type))
code = nativeType.code()
if nativeType.name().startswith('void'):
nativeType = FakeVoidType(nativeType.name(), self)
if code == TypeCodePointer:
targetType = self.fromNativeType(nativeType.target().unqualified())
return self.createPointerType(targetType)
......@@ -127,36 +131,35 @@ class Dumper(DumperBase):
tdata.lbitsize = nativeType.bitsize()
tdata.code = code
self.registerType(typeId, tdata) # Prevent recursion in fields.
tdata.lfields = self.listFields(nativeType, self.Type(self, typeId))
if code == TypeCodeStruct:
tdata.lfields = lambda value : \
self.listFields(nativeType, value)
tdata.lalignment = lambda : \
self.nativeStructAlignment(nativeType)
tdata.templateArguments = self.listTemplateParameters(nativeType)
self.registerType(typeId, tdata) # Fix up fields and template args
return self.Type(self, typeId)
def listFields(self, nativeType, parentType):
fields = []
if not nativeType.code() == TypeCodeStruct:
return fields
nativeIndex = 0
nativeFields = nativeType.fields()
for nativeField in nativeFields:
field = self.Field(self)
fieldType = nativeField.type().unqualified()
if fieldType is None:
fieldType = FakeVoidType('void', self)
field.ltype = self.fromNativeType(fieldType)
field.parentType = parentType
field.name = nativeField.name()
field.isBaseClass = False
field.lbitpos = nativeField.bitpos()
field.lbitsize = nativeField.bitsize()
field.nativeIndex = nativeIndex
#warn("FIELD RESULT: %s" % field)
fields.append(field)
nativeIndex += 1
return fields
def listFields(self, nativeType, value):
if value.address() is None or value.address() == 0:
raise Exception("")
nativeValue = cdbext.createValue(value.address(), nativeType)
index = 0
nativeMember = nativeValue.childFromIndex(index)
while nativeMember is not None:
yield self.fromNativeValue(nativeMember)
index += 1
nativeMember = nativeValue.childFromIndex(index)
def nativeStructAlignment(self, nativeType):
#warn("NATIVE ALIGN FOR %s" % nativeType.name)
def handleItem(nativeFieldType, align):
a = self.fromNativeType(nativeFieldType).alignment()
return a if a > align else align
align = 1
for f in nativeType.fields():
align = handleItem(f.type(), align)
return align
def listTemplateParameters(self, nativeType):
targs = []
......
This diff is collapsed.
This diff is collapsed.
......@@ -225,16 +225,12 @@ class Dumper(DumperBase):
return align
def listMembers(self, nativeType, value):
if value.laddress is not None:
sbaddr = lldb.SBAddress(value.laddress, self.target)
nativeValue = self.target.CreateValueFromAddress('x', sbaddr, nativeType)
else:
nativeValue = self.target.CreateValueFromData('x', sbaddr, nativeType)
#warn("ADDR: 0x%x" % self.fakeAddress)
fakeAddress = self.fakeAddress if value.laddress is None else value.laddress
sbaddr = lldb.SBAddress(fakeAddress, self.target)
fakeValue = self.target.CreateValueFromAddress('x', sbaddr, nativeType)
fakeValue.SetPreferSyntheticValue(False)
nativeValue.SetPreferSyntheticValue(False)
nativeType = nativeValue.GetType()
anonNumber = 0
baseNames = {}
for i in range(nativeType.GetNumberOfDirectBaseClasses()):
base = nativeType.GetDirectBaseClassAtIndex(i)
......@@ -251,31 +247,44 @@ class Dumper(DumperBase):
if bitsize > 0:
#bitpos = bitpos % bitsize
bitpos = bitpos % 8 # Reported type is always wrapping type!
#warn("BIT SIZE: %s POS: %s NAME: %s" % (bitsize, bitpos, f.name))
fieldBits[f.name] = (bitsize, bitpos)
# Normal members and non-empty base classes.
for i in range(nativeValue.GetNumChildren()):
fieldObj = nativeValue.GetChildAtIndex(i)
fieldObj.SetPreferSyntheticValue(False)
fieldName = fieldObj.GetName()
member = self.fromNativeValue(fieldObj)
if fieldName is None or len(fieldName) == 0:
# Something without a name.
anonNumber += 1
member.name = '#%s' % anonNumber
for i in range(fakeValue.GetNumChildren()):
nativeField = fakeValue.GetChildAtIndex(i)
nativeField.SetPreferSyntheticValue(False)
field = self.Field(self)
field.name = nativeField.GetName()
nativeFieldType = nativeField.GetType()
if field.name in fieldBits:
(field.lbitsize, field.lbitpos) = fieldBits[field.name]
else:
member.name = fieldName
if fieldName in baseNames:
member.isBaseClass = True
member.baseIndex = baseNames[fieldName]
if fieldName in fieldBits:
(member.lbitsize, member.lbitpos) = fieldBits[fieldName]
field.lbitsize = nativeFieldType.GetByteSize() * 8
if field.lbitsize != nativeFieldType.GetByteSize() * 8:
field.ltype = self.createBitfieldType(self.typeName(nativeFieldType), field.lbitsize)
else:
member.lbitsize = fieldObj.GetType().GetByteSize() * 8
#member.lbitpos = (caddr - addr) * 8
#warn("MEMBER: %s" % member)
yield member
fakeMember = fakeValue.GetChildAtIndex(i)
#try:
fakeMemberAddress = fakeMember.GetLoadAddress()
#except:
# # Happens in the BoostList dumper for a 'const bool'
# # item named 'constant_time_size'. There isn't anything we can do
# # in this case.
# continue
offset = fakeMemberAddress - fakeAddress
field.lbitpos = 8 * offset
field.ltype = self.fromNativeType(nativeFieldType)
if field.name in baseNames:
field.isBaseClass = True
field.baseIndex = baseNames[field.name]
yield field
# Empty bases are not covered above.
for i in range(nativeType.GetNumberOfDirectBaseClasses()):
......@@ -291,7 +300,6 @@ class Dumper(DumperBase):
member.ldata = bytes()
member.lbitsize = fieldType.GetByteSize() * 8
member.isBaseClass = True
member.baseIndex = baseNames[fieldName]
member.ltype = self.fromNativeType(fieldType)
member.name = fieldName
yield member
......@@ -362,10 +370,7 @@ class Dumper(DumperBase):
return self.createTypedefedType(targetType, nativeType.GetName())
nativeType = nativeType.GetUnqualifiedType()
if hasattr(nativeType, 'GetDisplayTypeName'):
typeName = nativeType.GetDisplayTypeName() # Xcode 6 (lldb-320)
else:
typeName = nativeType.GetName() # Xcode 5 (lldb-310)
typeName = self.typeName(nativeType)
if code in (lldb.eTypeClassArray, lldb.eTypeClassVector):
#warn('ARRAY: %s' % nativeType.GetName())
......@@ -420,10 +425,6 @@ class Dumper(DumperBase):
tdata.code = TypeCodeComplex
elif code in (lldb.eTypeClassClass, lldb.eTypeClassStruct, lldb.eTypeClassUnion):
tdata.code = TypeCodeStruct
#if nativeType.GetNumberOfDirectBaseClasses() > 0:
# firstBase = nativeType.GetDirectBaseClassAtIndex(0).GetType()
# if firstBase.GetByteSize() >= 2 * self.ptrSize():
# tdata.lfirstBase = self.fromNativeType(firstBase)
tdata.lalignment = lambda : \
self.nativeStructAlignment(nativeType)
tdata.lfields = lambda value : \
......@@ -489,11 +490,16 @@ class Dumper(DumperBase):
#warn('TARGS: %s %s' % (nativeType.GetName(), [str(x) for x in targs]))
return targs
def nativeTypeId(self, nativeType):
def typeName(self, nativeType):
if hasattr(nativeType, 'GetDisplayTypeName'):
name = nativeType.GetDisplayTypeName() # Xcode 6 (lldb-320)
else:
name = nativeType.GetName() # Xcode 5 (lldb-310)
return nativeType.GetDisplayTypeName() # Xcode 6 (lldb-320)
return nativeType.GetName() # Xcode 5 (lldb-310)
def nativeTypeId(self, nativeType):
name = self.typeName(nativeType)
def nativeTypeId(self, nativeType):
name = self.typeName(nativeType)
if name is None or len(name) == 0:
c = '0'
elif name == '(anonymous struct)' and nativeType.GetTypeClass() == lldb.eTypeClassStruct:
......@@ -1057,6 +1063,10 @@ class Dumper(DumperBase):
self.setVariableFetchingOptions(args)
anyModule = self.target.GetModuleAtIndex(0)
anySymbol = anyModule.GetSymbolAtIndex(0)
self.fakeAddress = int(anySymbol.GetStartAddress())
frame = self.currentFrame()
if frame is None:
self.reportResult('error="No frame"', args)
......@@ -1067,7 +1077,6 @@ class Dumper(DumperBase):
self.currentIName = 'local'
self.put('data=[')
self.anonNumber = 0
with SubItem(self, '[statics]'):
self.put('iname="%s",' % self.currentIName)
......
......@@ -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.
......@@ -330,3 +330,14 @@ def qdump__WTF__String(d, value):
charSize = 2
d.putCharArrayHelper(bufferPtr, stringLength, charSize)
#######################################################################
#
# Internal test
#
#######################################################################
def qdump__QtcDumperTest_FieldAccessByIndex(d, value):
d.putValue(value["d"][2].integer())
This diff is collapsed.
......@@ -191,7 +191,7 @@ def qdump_X_QModelIndex(d, value):
% (mm_, row, column, mi_))
d.putItem(mi2)
i = i + 1
d.putCallItem('parent', ns + 'QModelIndex', value, 'parent')
d.putCallItem('parent', '@QModelIndex', value, 'parent')
#gdb.execute('call free($mi)')
......@@ -203,13 +203,13 @@ def qdump__QDate(d, value):
if d.isExpanded():
with Children(d):
if d.canCallLocale():
d.putCallItem('toString', d.qtNamespace() + 'QString', value, 'toString',
d.putCallItem('toString', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'TextDate'))
d.putCallItem('(ISO)', d.qtNamespace() + 'QString', value, 'toString',
d.putCallItem('(ISO)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'ISODate'))
d.putCallItem('(SystemLocale)', d.qtNamespace() + 'QString', value, 'toString',
d.putCallItem('(SystemLocale)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'SystemLocaleDate'))
d.putCallItem('(Locale)', d.qtNamespace() + 'QString', value, 'toString',
d.putCallItem('(Locale)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'LocaleDate'))
d.putFields(value)
else:
......@@ -226,14 +226,14 @@ def qdump__QTime(d, value):
d.putValue(mds, 'millisecondssincemidnight')
if d.isExpanded():
with Children(d):
d.putCallItem('toString', d.qtNamespace() + 'QString', value, 'toString',
d.putCallItem('toString', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'TextDate'))
d.putCallItem('(ISO)', d.qtNamespace() + 'QString', value, 'toString',
d.putCallItem('(ISO)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'ISODate'))
if d.canCallLocale():
d.putCallItem('(SystemLocale)', d.qtNamespace() + 'QString', value, 'toString',
d.putCallItem('(SystemLocale)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'SystemLocaleDate'))
d.putCallItem('(Locale)', d.qtNamespace() + 'QString', value, 'toString',
d.putCallItem('(Locale)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'LocaleDate'))
d.putFields(value)
......@@ -335,20 +335,19 @@ def qdump__QDateTime(d, value):
d.putNumChild(1)
if d.isExpanded():
with Children(d):
ns = d.qtNamespace()
d.putCallItem('toTime_t', 'unsigned int', value, 'toTime_t')
if d.canCallLocale():
d.putCallItem('toString', 'QString', value, 'toString',
d.putCallItem('toString', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'TextDate'))
d.putCallItem('(ISO)', 'QString', value, 'toString',
d.putCallItem('(ISO)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'ISODate'))
d.putCallItem('toUTC', 'QDateTime', value, 'toTimeSpec',
d.putCallItem('toUTC', '@QDateTime', value, 'toTimeSpec',
d.enumExpression('TimeSpec', 'UTC'))
d.putCallItem('(SystemLocale)', 'QString', value, 'toString',
d.putCallItem('(SystemLocale)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'SystemLocaleDate'))
d.putCallItem('(Locale)', 'QString', value, 'toString',
d.putCallItem('(Locale)', '@QString', value, 'toString',
d.enumExpression('DateFormat', 'LocaleDate'))
d.putCallItem('toLocalTime', 'QDateTime', value, 'toTimeSpec',
d.putCallItem('toLocalTime', '@QDateTime', value, 'toTimeSpec',
d.enumExpression('TimeSpec', 'LocalTime'))
d.putFields(value)
......@@ -430,8 +429,8 @@ def qdump__QDir(d, value):
with Children(d):
ns = d.qtNamespace()
d.call('int', value, 'count') # Fill cache.
#d.putCallItem('absolutePath', value, 'absolutePath')
#d.putCallItem('canonicalPath', value, 'canonicalPath')
#d.putCallItem('absolutePath', '@QString', value, 'absolutePath')
#d.putCallItem('canonicalPath', '@QString', value, 'canonicalPath')
with SubItem(d, 'absolutePath'):
typ = d.lookupType(ns + 'QString')
d.putItem(d.createValue(privAddress + absoluteDirEntryOffset, typ))
......@@ -500,7 +499,7 @@ def qdump__QFileInfo(d, value):
if d.isExpanded():
ns = d.qtNamespace()
with Children(d):
stype = ns + 'QString'
stype = '@QString'
d.putCallItem('absolutePath', stype, value, 'absolutePath')
d.putCallItem('absoluteFilePath', stype, value, 'absoluteFilePath')
d.putCallItem('canonicalPath', stype, value, 'canonicalPath')
......@@ -518,8 +517,8 @@ def qdump__QFileInfo(d, value):
#d.putCallItem('owner', value, 'owner')
d.putCallItem('path', stype, value, 'path')
d.putCallItem('groupid', value, 'groupId')
d.putCallItem('ownerid', value, 'ownerId')
d.putCallItem('groupid', 'unsigned int', value, 'groupId')
d.putCallItem('ownerid', 'unsigned int', value, 'ownerId')
#QFile::Permissions permissions () const
try:
......@@ -911,11 +910,11 @@ def qdump__QLocale(d, value):
d.putSubItem('groupSeparator', group)
d.putSubItem('negativeSign', minus)
d.putSubItem('positiveSign', plus)
d.putCallItem('measurementSystem', ns + 'QLocale::MeasurementSystem',
d.putCallItem('measurementSystem', '@QLocale::MeasurementSystem',
value, 'measurementSystem')
d.putCallItem('timeFormat_(short)', ns + 'QString',
d.putCallItem('timeFormat_(short)', '@QString',
value, 'timeFormat', ns + 'QLocale::ShortFormat')
d.putCallItem('timeFormat_(long)', ns + 'QString',
d.putCallItem('timeFormat_(long)', '@QString',
value, 'timeFormat', ns + 'QLocale::LongFormat')
d.putFields(value)
......@@ -1260,7 +1259,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)
......@@ -1313,8 +1312,8 @@ def qdump__QTextCodec(d, value):
d.putNumChild(2)
if d.isExpanded():
with Children(d):
d.putCallItem('name', value, 'name')
d.putCallItem('mibEnum', value, 'mibEnum')
d.putCallItem('name', '@QByteArray', value, 'name')
d.putCallItem('mibEnum', 'int', value, 'mibEnum')
d.putFields(value)
......@@ -1332,7 +1331,7 @@ def qdump__QTextCursor(d, value):
positionAddress = privAddress + 2 * d.ptrSize() + 8
d.putIntItem('position', d.extractInt(positionAddress))
d.putIntItem('anchor', d.extractInt(positionAddress + 4))
d.putCallItem('selected', value, 'selectedText')
d.putCallItem('selected', '@QString', value, 'selectedText')
d.putFields(value)
......@@ -1341,11 +1340,11 @@ def qdump__QTextDocument(d, value):
d.putNumChild(1)
if d.isExpanded():
with Children(d):
d.putCallItem('blockCount', value, 'blockCount')
d.putCallItem('characterCount', value, 'characterCount')
d.putCallItem('lineCount', value, 'lineCount')
d.putCallItem('revision', value, 'revision')
d.putCallItem('toPlainText', value, 'toPlainText')
d.putCallItem('blockCount', 'int', value, 'blockCount')
d.putCallItem('characterCount', 'int', value, 'characterCount')
d.putCallItem('lineCount', 'int', value, 'lineCount')
d.putCallItem('revision', 'int', value, 'revision')
d.putCallItem('toPlainText', '@QString', value, 'toPlainText')
d.putFields(value)
......@@ -1632,6 +1631,7 @@ def qdump__QVariant(d, value):
else:
#warn('DIRECT ITEM 1: %s' % innerType)
val = d.createValue(data, innerType)
val.laddress = value.laddress
d.putEmptyValue(-99)
d.putItem(val)
......@@ -1849,7 +1849,7 @@ def qdump__QV4__FunctionObject(d, value):
with Children(d):
d.putFields(value)
d.putSubItem('heap', extractQmlData(d, value))
d.putCallItem('sourceLocation', d.qtNamespace() + 'QQmlSourceLocation',
d.putCallItem('sourceLocation', '@QQmlSourceLocation',
value, 'sourceLocation')
def qdump__QV4__CompilationUnit(d, value):
......@@ -2255,7 +2255,7 @@ def qdump__QQmlBinding(d, value):
d.putEmptyValue()
if d.isExpanded():
with Children(d):
d.putCallItem('expressionIdentifier', d.qtNamespace() + 'QString',
d.putCallItem('expressionIdentifier', '@QString',
value, 'expressionIdentifier')
d.putFields(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])
......
......@@ -72,9 +72,8 @@ void QmlStateNodeInstance::deactivateState()
void QmlStateNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
{