Commit 7a2f5f92 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

Merge branch 'master' into refactoring

parents 9d9285cf bfbf7848
......@@ -29,7 +29,7 @@ qrc_*.cpp
Thumbs.db
# qtcreator generated files
*.pro.user
*.pro.user*
# xemacs temporary files
*.flc
......
......@@ -19,6 +19,7 @@ General
setting
* New "Design" mode for visual editors (.ui & .qml files)
* Fixed crash when working with empty pro-file
* Ask for close, save, or save as when file is removed while open in Qt Creator
Editing
* Text based search and replace in multiple files
......
......@@ -253,7 +253,7 @@ def listOfLocals(varList):
items = []
if hasBlock and isGoodGdb():
warn("IS GOOD: %s " % varList)
#warn("IS GOOD: %s " % varList)
try:
block = frame.block()
#warn("BLOCK: %s " % block)
......@@ -340,6 +340,14 @@ def listOfLocals(varList):
except RuntimeError:
pass
#continue
except:
# Something breaking the list, like intermediate gdb warnings
# like 'Warning: can't find linker symbol for virtual table for
# `std::less<char const*>' value\n\nwarning: found
# `myns::QHashData::shared_null' instead [...]
# that break subsequent parsing. Chicken out and take the
# next "usable" line.
continue
items.append(item)
return items
......@@ -1197,7 +1205,9 @@ class Dumper:
# UCS-4:
self.putValue(encodeChar4Array(value, 100), Hex8EncodedBigEndian)
if (not isHandled) and str(type.strip_typedefs()).find("(") != -1:
strippedType = str(type.strip_typedefs()) \
.replace("(anonymous namespace)", "")
if (not isHandled) and strippedType.find("(") != -1:
# A function pointer.
self.putValue(str(item.value))
self.putAddress(value.address)
......@@ -1274,7 +1284,7 @@ class Dumper:
#warn("INAMES: %s " % self.expandedINames)
#warn("EXPANDED: %s " % (item.iname in self.expandedINames))
# insufficient, see http://sourceware.org/bugzilla/show_bug.cgi?id=10953
# Insufficient, see http://sourceware.org/bugzilla/show_bug.cgi?id=10953
#fields = value.type.fields()
fields = value.type.strip_typedefs().fields()
......
......@@ -1077,8 +1077,7 @@ static void qDumpQAbstractItem(QDumper &d)
QModelIndex mi;
{
ModelIndex *mm = reinterpret_cast<ModelIndex *>(&mi);
mm->r = mm->c = 0;
mm->p = mm->m = 0;
memset(&mi, 0, sizeof(mi));
static const char *printFormat = sizeof(void *) == sizeof(long) ?
"%d,%d,0x%lx,0x%lx" : "%d,%d,0x%llx,0x%llx";
sscanf(d.templateParameters[0], printFormat, &mm->r, &mm->c, &mm->p, &mm->m);
......
......@@ -579,16 +579,26 @@ def extractCString(table, offset):
return result
def qdump__QWidget(d, item):
qdump__QObject(d, item)
def qdump__QObject(d, item):
#warn("OBJECT: %s " % item.value)
staticMetaObject = item.value["staticMetaObject"]
#warn("SMO: %s " % staticMetaObject)
#warn("SMO DATA: %s " % staticMetaObject["d"]["stringdata"])
superData = staticMetaObject["d"]["superdata"]
#warn("SUPERDATA: %s" % superData)
#while not isNull(superData):
# superData = superData.dereference()["d"]["superdata"]
# warn("SUPERDATA: %s" % superData)
privateType = gdb.lookup_type(d.ns + "QObjectPrivate").pointer()
d_ptr = item.value["d_ptr"]["d"].cast(privateType).dereference()
#warn("D_PTR: %s " % d_ptr)
objectName = d_ptr["objectName"]
#warn("OBJECTNAME: %s " % objectName)
#warn("D_PTR: %s " % d_ptr.dereference())
#warn("D_PTR: %s " % d_ptr)
mo = d_ptr["metaObject"]
type = d.stripNamespaceFromType(item.value.type)
if isNull(mo):
......@@ -608,13 +618,16 @@ def qdump__QObject(d, item):
if d.isExpanded(item):
d.beginChildren()
# parent and children
# Parent and children.
d.putItem(Item(d_ptr["parent"], item.iname, "parent", "parent"))
d.putItem(Item(d_ptr["children"], item.iname, "children", "children"))
# properties
# Properties.
d.beginHash()
propertyCount = metaData[6]
#propertyCount = metaData[6]
# FIXME: Replace with plain memory accesses.
propertyCount = int(call(mo, "propertyCount()"))
warn("PROPERTY COUNT: %s" % propertyCount)
propertyData = metaData[7]
d.putName("properties")
d.putItemCount(propertyCount)
......@@ -630,28 +643,43 @@ def qdump__QObject(d, item):
d.putName(propertyName)
#flags = metaData[offset + 2]
#warn("FLAGS: %s " % flags)
warn("PROPERTY TYPE: %s " % propertyType)
#warn("PROPERTY: %s %s " % (propertyType, propertyName))
# #exp = '((\'%sQObject\'*)%s)->property("%s")' \
# % (d.ns, item.value.address, propertyName)
#exp = '"((\'%sQObject\'*)%s)"' % (d.ns, item.value.address,)
#warn("EXPRESSION: %s" % exp)
value = call(item.value, 'property("%s")' % propertyName)
warn("VALUE: %s" % value)
warn("TYPE: %s" % value.type)
if True and propertyType == "QString":
# FIXME: re-use parts of QVariant dumper
#d.putType(d.ns + "QString")
data = value["d"]["data"]["ptr"]
innerType = gdb.lookup_type(d.ns + "QString")
d.putItemHelper(
Item(data.cast(innerType), item.iname, property))
#d.putNumChild(0)
val, inner, innert = qdumpHelper__QVariant(d, value)
if len(inner):
# Build-in types.
d.putType(inner)
d.putItemHelper(Item(val, item.iname + ".properties",
propertyName, propertyName))
else:
iname = "%s.properties.%s" % (item.iname, propertyName)
d.putItemHelper(Item(value, iname, propertyName))
# User types.
# func = "typeToName(('%sQVariant::Type')%d)" % (d.ns, variantType)
# type = str(call(item.value, func))
# type = type[type.find('"') + 1 : type.rfind('"')]
# type = type.replace("Q", d.ns + "Q") # HACK!
# data = call(item.value, "constData()")
# tdata = data.cast(gdb.lookup_type(type).pointer()).dereference()
# d.putValue("(%s)" % tdata.type)
# d.putType(tdata.type)
# d.putNumChild(1)
# if d.isExpanded(item):
# d.beginChildren()
# d.putItem(Item(tdata, item.iname, "data", "data"))
# d.endChildren()
warn("FIXME: CUSTOM QOBJECT PROPERTIES NOT IMPLEMENTED: %s %s"
% (propertyType, innert))
d.putType(propertyType)
d.putValue("...")
d.putNumChild(0)
d.endHash()
d.endChildren()
d.endHash()
# connections
d.beginHash()
......@@ -679,7 +707,7 @@ def qdump__QObject(d, item):
d.endChildren()
d.endHash()
# signals
# Signals
signalCount = metaData[13]
d.beginHash()
d.putName("signals")
......@@ -703,7 +731,7 @@ def qdump__QObject(d, item):
d.endChildren()
d.endHash()
# slots
# Slots
d.beginHash()
slotCount = metaData[4] - signalCount
d.putName("slots")
......@@ -991,55 +1019,6 @@ def qdump__QObject(d, item):
# d.disarm()
# }
#
# static void dumpQObjectPropertyList(QDumper &d)
# {
# const QObject *ob = (const QObject *)d.data
# const QMetaObject *mo = ob->metaObject()
# const int propertyCount = mo->propertyCount()
# d.putField("addr", "<synthetic>")
# d.putField("type", ns + "QObjectPropertyList")
# d.putField("numchild", propertyCount)
# d.putItemCount(propertyCount)
# if d.isExpanded(item):
# d.beginChildren()
# for (int i = propertyCount; --i >= 0; ) {
# const QMetaProperty & prop = mo->property(i)
# d.beginHash()
# d.putName(prop.name())
# switch (prop.type()) {
# case QVariant::String:
# d.putField("type", prop.typeName())
# d.putValue(prop.read(ob).toString(), 2)
# d.putField("numchild", "0")
# break
# case QVariant::Bool:
# d.putField("type", prop.typeName())
# d.putValue((prop.read(ob).toBool() ? "true" : "false"))
# d.putField("numchild", "0")
# break
# case QVariant::Int:
# if prop.isEnumType()) {
# dumpMetaEnumValue(d, prop, prop.read(ob).toInt())
# } elif prop.isFlagType()) {
# dumpMetaFlagValue(d, prop, prop.read(ob).toInt())
# } else {
# d.putValue(prop.read(ob).toInt())
# d.putField("numchild", "0")
# }
# break
# default:
# d.putField("addr", d.data)
# d.putField("type", ns + "QObjectProperty")
# d.putField("numchild", "1")
# break
# }
# d.endHash()
# }
# d.endChildren()
# }
# d.disarm()
# }
#
# static void dumpQObjectMethodList(QDumper &d)
# {
# const QObject *ob = (const QObject *)d.data
......@@ -1512,12 +1491,11 @@ def qdump__QTextCodec(d, item):
d.putCallItem("mibEnum", item, "mibEnum()")
d.endChildren()
def qdump__QVariant(d, item):
union = item.value["d"]
data = union["data"]
variantType = int(union["type"])
def qdumpHelper__QVariant(d, value):
#warn("VARIANT TYPE: %s : " % variantType)
data = value["d"]["data"]
variantType = int(value["d"]["type"])
val = None
inner = ""
innert = ""
if variantType == 0: # QVariant::Invalid
......@@ -1526,22 +1504,28 @@ def qdump__QVariant(d, item):
elif variantType == 1: # QVariant::Bool
d.putValue(select(data["b"], "true", "false"))
d.putNumChild(0)
inner = "bool"
elif variantType == 2: # QVariant::Int
d.putValue(data["i"])
d.putNumChild(0)
inner = "int"
elif variantType == 3: # uint
d.putValue(data["u"])
d.putNumChild(0)
inner = "uint"
elif variantType == 4: # qlonglong
d.putValue(data["ll"])
d.putNumChild(0)
inner = "qlonglong"
elif variantType == 5: # qulonglong
d.putValue(data["ull"])
d.putNumChild(0)
inner = "qulonglong"
elif variantType == 6: # QVariant::Double
value = data["d"]
d.putValue(data["d"])
d.putNumChild(0)
inner = "double"
elif variantType == 7: # QVariant::QChar
inner = d.ns + "QChar"
elif variantType == 8: # QVariant::VariantMap
......@@ -1634,25 +1618,37 @@ def qdump__QVariant(d, item):
elif variantType == 86: # QVariant::Quadernion
inner = d.ns + "QQuadernion"
if len(inner):
innerType = gdb.lookup_type(inner)
sizePD = gdb.lookup_type(d.ns + 'QVariant::Private::Data').sizeof
if innerType.sizeof > sizePD:
sizePS = gdb.lookup_type(d.ns + 'QVariant::PrivateShared').sizeof
val = (sizePS + data.cast(gdb.lookup_type('char').pointer())) \
.cast(innerType.pointer()).dereference()
else:
val = data.cast(innerType)
if len(innert) == 0:
innert = inner
return val, inner, innert
def qdump__QVariant(d, item):
val, inner, innert = qdumpHelper__QVariant(d, item.value)
if len(inner):
# Build-in types.
if len(innert) == 0:
innert = inner
d.putValue("(%s)" % innert)
d.putNumChild(1)
if d.isExpanded(item):
innerType = gdb.lookup_type(inner)
d.beginChildren()
d.beginHash()
#d.putName("data")
#d.putField("type", innert)
val = gdb.Value(data["ptr"]).cast(innerType)
d.putItemHelper(Item(val, item.iname, "data", "data"))
d.endHash()
d.putItem(Item(val, item.iname, "data", "data"))
d.endChildren()
else:
# User types.
func = "typeToName(('%sQVariant::Type')%d)" % (d.ns, variantType)
d_member = item.value["d"]
func = "typeToName(('%sQVariant::Type')%d)" % (d.ns, d_member["type"])
type = str(call(item.value, func))
type = type[type.find('"') + 1 : type.rfind('"')]
type = type.replace("Q", d.ns + "Q") # HACK!
......@@ -1808,9 +1804,9 @@ def qdump__std__map(d, item):
d.putValue(" ")
if d.isExpandedIName("%s.%d" % (item.iname, i)):
d.beginChildren(2, None)
iname = "%s.%d." % (item.iname, i)
keyItem = Item(pair["first"], iname + "key", "key", "first")
valueItem = Item(pair["second"], iname + "value", "value", "second")
iname = "%s.%d" % (item.iname, i)
keyItem = Item(pair["first"], iname, "first", "first")
valueItem = Item(pair["second"], iname, "second", "second")
d.putItem(keyItem)
d.putItem(valueItem)
d.endChildren()
......
diff --git a/gdb/dcache.c b/gdb/dcache.c
index e1386e0..65b1a02 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -76,7 +76,7 @@
/* The size of a cache line. Smaller values reduce the time taken to
read a single byte and make the cache more granular, but increase
overhead and reduce the effectiveness of the cache as a prefetcher. */
-#define LINE_SIZE_POWER 6
+#define LINE_SIZE_POWER 8
#define LINE_SIZE (1 << LINE_SIZE_POWER)
/* Each cache block holds LINE_SIZE bytes of data
......@@ -2,7 +2,7 @@
<module>
<type name="QmlProject.Project">
<property name="sourceDirectory" type="string"/>
<property name="libraryPaths" type="string" isList="true"/>
<property name="importPaths" type="string" isList="true"/>
<property name="content" type="QmlProjectItem" isList="true"/>
</type>
<type name="QmlProjectItem">
......
......@@ -6,18 +6,16 @@ QWidget {
height:220;fixedHeight: height
styleSheetFile: "anchorbox.css"
Script {
function isBorderAnchored() {
return anchorBackend.leftAnchored || anchorBackend.topAnchored || anchorBackend.rightAnchored || anchorBackend.bottomAnchored;
}
function isBorderAnchored() {
return anchorBackend.leftAnchored || anchorBackend.topAnchored || anchorBackend.rightAnchored || anchorBackend.bottomAnchored;
}
function fill() {
anchorBackend.fill();
}
function fill() {
anchorBackend.fill();
}
function breakLayout() {
anchorBackend.resetLayout()
}
function breakLayout() {
anchorBackend.resetLayout()
}
QPushButton {
......
......@@ -6,19 +6,16 @@ QWidget {
id: anchorButtons
fixedHeight: 32
function isBorderAnchored() {
return anchorBackend.leftAnchored || anchorBackend.topAnchored || anchorBackend.rightAnchored || anchorBackend.bottomAnchored;
}
Script {
function isBorderAnchored() {
return anchorBackend.leftAnchored || anchorBackend.topAnchored || anchorBackend.rightAnchored || anchorBackend.bottomAnchored;
}
function fill() {
anchorBackend.fill();
}
function fill() {
anchorBackend.fill();
}
function breakLayout() {
anchorBackend.resetLayout()
}
function breakLayout() {
anchorBackend.resetLayout()
}
QPushButton {
......
......@@ -31,22 +31,20 @@ QWidget { //This is a special checkBox that does color coding for states
evaluate();
}
Script {
function evaluate() {
if (!enabled) {
localLabel.setStyleSheet("color: "+scheme.disabledColor);
function evaluate() {
if (!enabled) {
localLabel.setStyleSheet("color: "+scheme.disabledColor);
} else {
if (baseStateFlag) {
if (backendValue.isInModel)
localLabel.setStyleSheet("color: "+scheme.changedBaseColor);
else
localLabel.setStyleSheet("color: "+scheme.boldTextColor);
} else {
if (baseStateFlag) {
if (backendValue.isInModel)
localLabel.setStyleSheet("color: "+scheme.changedBaseColor);
else
localLabel.setStyleSheet("color: "+scheme.boldTextColor);
} else {
if (backendValue.isInSubState)
localLabel.setStyleSheet("color: "+scheme.changedStateColor);
else
localLabel.setStyleSheet("color: "+scheme.boldTextColor);
}
if (backendValue.isInSubState)
localLabel.setStyleSheet("color: "+scheme.changedStateColor);
else
localLabel.setStyleSheet("color: "+scheme.boldTextColor);
}
}
}
......
......@@ -52,35 +52,33 @@ QExtGroupBox {
evaluate();
}
Script {
function evaluate() {
if (backendColor === undefined)
return;
if (!enabled) {
valueSpinBox.setStyleSheet("color: "+scheme.disabledColor);
hueSpinBox.setStyleSheet("color: "+scheme.disabledColor);
saturationSpinBox.setStyleSheet("color: "+scheme.disabledColor);
function evaluate() {
if (backendColor === undefined)
return;
if (!enabled) {
valueSpinBox.setStyleSheet("color: "+scheme.disabledColor);
hueSpinBox.setStyleSheet("color: "+scheme.disabledColor);
saturationSpinBox.setStyleSheet("color: "+scheme.disabledColor);
} else {
if (baseStateFlag) {
if (backendColor.isInModel) {
valueSpinBox.setStyleSheet("color: "+scheme.changedBaseColor);
hueSpinBox.setStyleSheet("color: "+scheme.changedBaseColor);
saturationSpinBox.setStyleSheet("color: "+scheme.changedBaseColor);
} else {
valueSpinBox.setStyleSheet("color: "+scheme.defaultColor);
hueSpinBox.setStyleSheet("color: "+scheme.defaultColor);
saturationSpinBox.setStyleSheet("color: "+scheme.defaultColor);
}
} else {
if (baseStateFlag) {
if (backendColor.isInModel) {
valueSpinBox.setStyleSheet("color: "+scheme.changedBaseColor);
hueSpinBox.setStyleSheet("color: "+scheme.changedBaseColor);
saturationSpinBox.setStyleSheet("color: "+scheme.changedBaseColor);
} else {
valueSpinBox.setStyleSheet("color: "+scheme.defaultColor);
hueSpinBox.setStyleSheet("color: "+scheme.defaultColor);
saturationSpinBox.setStyleSheet("color: "+scheme.defaultColor);
}
if (backendColor.isInSubState) {
valueSpinBox.setStyleSheet("color: "+scheme.changedStateColor);
hueSpinBox.setStyleSheet("color: "+scheme.changedStateColor);
saturationSpinBox.setStyleSheet("color: "+scheme.changedStateColor);
} else {
if (backendColor.isInSubState) {
valueSpinBox.setStyleSheet("color: "+scheme.changedStateColor);
hueSpinBox.setStyleSheet("color: "+scheme.changedStateColor);
saturationSpinBox.setStyleSheet("color: "+scheme.changedStateColor);
} else {
valueSpinBox.setStyleSheet("color: "+scheme.defaultColor);
hueSpinBox.setStyleSheet("color: "+scheme.defaultColor);
saturationSpinBox.setStyleSheet("color: "+scheme.defaultColor);
}
valueSpinBox.setStyleSheet("color: "+scheme.defaultColor);
hueSpinBox.setStyleSheet("color: "+scheme.defaultColor);
saturationSpinBox.setStyleSheet("color: "+scheme.defaultColor);
}
}
}
......
......@@ -22,26 +22,23 @@ QWidget {
evaluate();
}
Script {
function evaluate() {
if (backendValue === undefined)
return;
if (!enabled) {
box.setStyleSheet("color: "+scheme.disabledColor);
function evaluate() {
if (backendValue === undefined)
return;
if (!enabled) {
box.setStyleSheet("color: "+scheme.disabledColor);
} else {
if (baseStateFlag) {
if (backendValue.isInModel)
box.setStyleSheet("QComboBox,QComboBox:on{color: "+scheme.changedBaseColor+"}QComboBox:off{color:"+scheme.optionsColor+"}");
else
box.setStyleSheet("QComboBox,QComboBox:on{color: "+scheme.defaultColor+"}QComboBox:off{color:"+scheme.optionsColor+"}");
} else {
if (baseStateFlag) {
if (backendValue.isInModel)
box.setStyleSheet("QComboBox,QComboBox:on{color: "+scheme.changedBaseColor+"}QComboBox:off{color:"+scheme.optionsColor+"}");
else
box.setStyleSheet("QComboBox,QComboBox:on{color: "+scheme.defaultColor+"}QComboBox:off{color:"+scheme.optionsColor+"}");
} else {
if (backendValue.isInSubState)
box.setStyleSheet("QComboBox,QComboBox:on{color: "+scheme.changedStateColor+"}QComboBox:off{color:"+scheme.optionsColor+"}");
else
box.setStyleSheet("QComboBox,QComboBox:on{color: "+scheme.defaultColor+"}QComboBox:off{color:"+scheme.optionsColor+"}");
}
if (backendValue.isInSubState)
box.setStyleSheet("QComboBox,QComboBox:on{color: "+scheme.changedStateColor+"}QComboBox:off{color:"+scheme.optionsColor+"}");
else
box.setStyleSheet("QComboBox,QComboBox:on{color: "+scheme.defaultColor+"}QComboBox:off{color:"+scheme.optionsColor+"}");
}
}
}
......
......@@ -29,25 +29,23 @@ QWidget { //This is a special doubleSpinBox that does color coding for states
evaluate();
}
Script {
function evaluate() {
if (backendValue === undefined)