Commit a98fe15f authored by Eike Ziller's avatar Eike Ziller
Browse files

Merge remote-tracking branch 'origin/2.8' into HEAD

Conflicts:
	qbs/pluginspec/pluginspec.qbs

Change-Id: Ic8e992623b9eda8913ee473c779a8df27643ccc9
parents 2c211007 07c0a834
......@@ -18,11 +18,6 @@ Module {
var cmd = new JavaScriptCommand();
cmd.description = "prepare " + FileInfo.fileName(output.fileName);
cmd.highlight = "codegen";
cmd.ide_version_major = project.ide_version_major;
cmd.ide_version_minor = project.ide_version_minor;
cmd.ide_version_release = project.ide_version_release;
cmd.qtcreator_version = cmd.ide_version_major + '.' + cmd.ide_version_minor + '.' + cmd.ide_version_release;
cmd.pluginspecreplacements = product.pluginspecreplacements;
cmd.plugin_depends = [];
var deps = product.dependencies;
......@@ -45,16 +40,16 @@ Module {
// replace quoted quotes
all = all.replace(/\\\"/g, '"');
// replace config vars
vars['QTCREATOR_VERSION'] = qtcreator_version;
vars['IDE_VERSION_MAJOR'] = ide_version_major;
vars['IDE_VERSION_MINOR'] = ide_version_minor;
vars['IDE_VERSION_RELEASE'] = ide_version_release;
vars['QTCREATOR_VERSION'] = project.qtcreator_version;
vars['IDE_VERSION_MAJOR'] = project.ide_version_major;
vars['IDE_VERSION_MINOR'] = project.ide_version_minor;
vars['IDE_VERSION_RELEASE'] = project.ide_version_release;
var deplist = ["<dependencyList>"];
for (i in plugin_depends) {
deplist.push(" <dependency name=\"" + plugin_depends[i] + "\" version=\"" + qtcreator_version + "\"/>");
deplist.push(" <dependency name=\"" + plugin_depends[i] + "\" version=\"" + project.qtcreator_version + "\"/>");
}
for (i in plugin_recommends) {
deplist.push(" <dependency name=\"" + plugin_recommends[i] + "\" version=\"" + qtcreator_version + "\" type=\"optional\"/>");
deplist.push(" <dependency name=\"" + plugin_recommends[i] + "\" version=\"" + project.qtcreator_version + "\" type=\"optional\"/>");
}
deplist.push(" </dependencyList>");
vars['dependencyList'] = deplist.join("\n");
......
......@@ -1777,6 +1777,12 @@ class Dumper:
self.put('",')
return True
def isReferenceType(self, typeobj):
return typeobj.code == gdb.TYPE_CODE_REF
def isStructType(self, typeobj):
return typeobj.code == gdb.TYPE_CODE_STRUCT
def putPlotData(self, type, base, n, plotFormat):
if self.isExpanded():
self.putArrayData(type, base, n)
......
......@@ -73,9 +73,6 @@ DisplayLatin1String, \
DisplayUtf8String \
= range(7)
def lookupType(name):
return None
def isSimpleType(typeobj):
typeClass = typeobj.GetTypeClass()
#warn("TYPECLASS: %s" % typeClass)
......@@ -179,36 +176,7 @@ def fileName(file):
return str(file) if file.IsValid() else ''
PointerCode = None
ArrayCode = None
StructCode = None
UnionCode = None
EnumCode = None
FlagsCode = None
FunctionCode = None
IntCode = None
FloatCode = None
VoidCode = None
SetCode = None
RangeCode = None
StringCode = None
BitStringCode = None
ErrorTypeCode = None
MethodCode = None
MethodPointerCode = None
MemberPointerCode = None
ReferenceCode = None
CharCode = None
BoolCode = None
ComplexCode = None
TypedefCode = None
NamespaceCode = None
SimpleValueCode = None # LLDB only
# Data members
SimpleValueCode = 100
StructCode = 101
PointerCode = 102
# Breakpoints. Keep synchronized with BreakpointType in breakpoint.h
......@@ -245,7 +213,7 @@ def checkPointer(p, align = 1):
p.Dereference()
def isNull(p):
return long(p) == 0
return p.GetValueAsUnsigned() == 0
Value = lldb.SBValue
......@@ -290,7 +258,16 @@ def impl_SBValue__le__(self, other):
def impl_SBValue__int__(self):
return self.GetValueAsSigned()
#return int(self.GetValue(), 0)
def impl_SBValue__float__(self):
error = lldb.SBError()
if self.GetType().GetByteSize() == 4:
result = self.GetData().GetFloat(error, 0)
else:
result = self.GetData().GetDouble(error, 0)
if error.Success():
return result
return NotImplemented
def impl_SBValue__long__(self):
return int(self.GetValue(), 0)
......@@ -318,6 +295,7 @@ lldb.SBValue.__le__ = impl_SBValue__le__
lldb.SBValue.__getitem__ = impl_SBValue__getitem__
lldb.SBValue.__int__ = impl_SBValue__int__
lldb.SBValue.__float__ = impl_SBValue__float__
lldb.SBValue.__long__ = lambda self: long(self.GetValue(), 0)
lldb.SBValue.code = lambda self: self.GetTypeClass()
......@@ -325,12 +303,13 @@ lldb.SBValue.cast = lambda self, typeObj: self.Cast(typeObj)
lldb.SBValue.dereference = lambda self: self.Dereference()
lldb.SBValue.address = property(lambda self: self.GetAddress())
lldb.SBType.unqualified = lambda self: self.GetUnqualifiedType()
lldb.SBType.pointer = lambda self: self.GetPointerType()
lldb.SBType.code = lambda self: self.GetTypeClass()
lldb.SBType.sizeof = property(lambda self: self.GetByteSize())
lldb.SBType.unqualified = \
lambda self: self.GetUnqualifiedType() if hasattr(self, 'GetUnqualifiedType') else self
lldb.SBType.strip_typedefs = \
lambda self: self.GetCanonicalType() if hasattr(self, 'GetCanonicalType') else self
......@@ -340,9 +319,6 @@ lldb.SBType.__str__ = lldb.SBType.GetName
def simpleEncoding(typeobj):
code = typeobj.GetTypeClass()
size = typeobj.sizeof
#if code == BoolCode or code == CharCode:
# return Hex2EncodedInt1
#if code == IntCode:
if code == lldb.eTypeClassBuiltin:
name = str(typeobj)
if name == "float":
......@@ -390,7 +366,7 @@ class Children:
#if isSimpleType(childType):
# self.d.put('childnumchild="0",')
# self.childNumChild = 0
#elif childType.code == PointerCode:
#elif childType.code == lldb.eTypeClassPointer:
# self.d.put('childnumchild="1",')
# self.childNumChild = 1
else:
......@@ -469,6 +445,8 @@ class SubItem:
self.d.put('{')
#if not self.name is None:
if isinstance(self.name, str):
if self.name == '**&':
self.name = '*'
self.d.put('name="%s",' % self.name)
self.savedIName = self.d.currentIName
self.savedCurrentAddress = self.d.currentAddress
......@@ -597,7 +575,7 @@ class Dumper:
def templateArgument(self, typeobj, index):
type = typeobj.GetTemplateArgumentType(index)
if len(type.GetName()):
if type.IsValid():
return type
inner = self.extractTemplateArgument(typeobj.GetName(), index)
return self.lookupType(inner)
......@@ -606,6 +584,12 @@ class Dumper:
inner = self.extractTemplateArgument(typeobj.GetName(), index)
return int(inner)
def isReferenceType(self, typeobj):
return typeobj.IsReferenceType()
def isStructType(self, typeobj):
return typeobj.GetTypeClass() in (lldb.eTypeClassStruct, lldb.eTypeClassClass)
def qtVersion(self):
return 0x050000
......@@ -678,9 +662,8 @@ class Dumper:
return format
def isMovableType(self, type):
if type.code == PointerCode:
return True
if isSimpleType(type):
if type.GetTypeClass() in (lldb.eTypeClassBuiltin,
lldb.eTypeClassPointer):
return True
return self.stripNamespaceFromType(type.GetName()) in movableTypes
......@@ -745,7 +728,7 @@ class Dumper:
return True
def putPlotData(self, type, base, n, plotFormat):
warn("PLOTDATA: %s %s" % (type, n))
#warn("PLOTDATA: %s %s" % (type, n))
if self.isExpanded():
self.putArrayData(type, base, n)
self.putValue(self.currentValue)
......@@ -754,7 +737,7 @@ class Dumper:
def putArrayData(self, type, base, n,
childNumChild = None, maxNumChild = 10000):
if not self.tryPutArrayContents(type, base, n):
base = base.cast(type.pointer())
base = self.createPointerValue(base, type)
with Children(self, n, type, childNumChild, maxNumChild,
base, type.GetByteSize()):
for i in self.childRange():
......@@ -789,9 +772,14 @@ class Dumper:
self.putFields(value)
def lookupType(self, name):
if name.endswith('*'):
type = self.lookupType(name[:-1].strip())
return type.GetPointerType() if type.IsValid() else None
#warn("LOOKUP TYPE NAME: %s" % name)
#warn("LOOKUP RESULT: %s" % self.target.FindFirstType(name))
return self.target.FindFirstType(name)
#warn("LOOKUP RESULT: %s" % self.target.FindFirstType(name))
type = self.target.FindFirstType(name)
return type if type.IsValid() else None
def setupInferior(self, args):
executable = args['executable']
......@@ -942,6 +930,17 @@ class Dumper:
contents = self.process.ReadMemory(base, size, error)
return binascii.hexlify(contents)
def isQObject(self, value):
try:
vtable = value.Cast(self.voidPtrType().GetPointerType())
metaObjectEntry = vtable.Dereference()
addr = lldb.SBAddress(long(metaObjectEntry), self.target)
symbol = addr.GetSymbol()
name = symbol.GetMangledName()
return name.find("10metaObjectEv") > 0
except:
return False
def computeLimit(self, size, limit):
if limit is None:
return size
......@@ -967,6 +966,10 @@ class Dumper:
pos1 = type.rfind(">", pos)
type = type[0:pos] + type[pos1+1:]
pos = type.find("<")
if type.startswith("const "):
type = type[6:]
if type.startswith("volatile "):
type = type[9:]
return type
def putSubItem(self, component, value, tryDynamic=True):
......@@ -987,6 +990,7 @@ class Dumper:
#value = value.GetDynamicValue(lldb.eDynamicCanRunTarget)
typeName = value.GetTypeName()
value.SetPreferDynamicValue(tryDynamic)
typeClass = value.GetType().GetTypeClass()
if tryDynamic:
self.putAddress(value.address)
......@@ -1016,42 +1020,72 @@ class Dumper:
self.putItem(child)
return
# Typedefs
if typeClass == lldb.eTypeClassTypedef:
if typeName in qqDumpers:
self.putType(typeName)
self.context = value
qqDumpers[typeName](self, value)
return
realType = value.GetType()
if hasattr(realType, 'GetCanonicalType'):
realType = realType.GetCanonicalType()
value = value.Cast(realType.unqualified())
self.putItem(value)
self.putBetterType(typeName)
return
# Our turf now.
value.SetPreferSyntheticValue(False)
# Arrays
if value.GetType().GetTypeClass() == lldb.eTypeClassArray:
if typeClass == lldb.eTypeClassArray:
qdump____c_style_array__(self, value)
return
# References
if value.GetType().IsReferenceType():
origType = value.GetTypeName();
type = value.GetType().GetDereferencedType()
addr = int(value.GetAddress()) & 0xFFFFFFFFFFFFFFFF
type = value.GetType().GetDereferencedType().unqualified()
addr = int(value) & 0xFFFFFFFFFFFFFFFF
self.putItem(value.CreateValueFromAddress(None, addr, type))
#self.putItem(value.CreateValueFromData(None, value.GetData(), type))
self.putBetterType(origType)
return
# Pointers
if value.GetType().IsPointerType() and self.autoDerefPointers:
if value.GetType().IsPointerType():
if isNull(value):
self.putType(typeName)
self.putValue("0x0")
self.putNumChild(0)
return
innerType = value.GetType().GetPointeeType()
self.putType(innerType)
savedCurrentChildType = self.currentChildType
self.currentChildType = str(innerType)
inner = value.Dereference()
if inner.IsValid():
self.putItem(inner)
self.currentChildType = savedCurrentChildType
self.put('origaddr="%s",' % value.address)
return
if self.autoDerefPointers:
innerType = value.GetType().GetPointeeType().unqualified()
self.putType(innerType)
savedCurrentChildType = self.currentChildType
self.currentChildType = str(innerType)
inner = value.Dereference()
if inner.IsValid():
self.putItem(inner)
self.currentChildType = savedCurrentChildType
self.put('origaddr="%s",' % value.address)
return
else:
numchild = value.GetNumChildren()
self.put('iname="%s",' % self.currentIName)
self.putType(typeName)
self.putValue('0x%x' % value.GetValueAsUnsigned())
self.put('numchild="1",')
self.put('addr="0x%x",' % value.GetLoadAddress())
if self.currentIName in self.expandedINames:
with Children(self):
child = value.Dereference()
with SubItem(self, child):
self.putItem(child)
#warn("VALUE: %s" % value)
#warn("FANCY: %s" % self.useFancy)
......@@ -1066,12 +1100,24 @@ class Dumper:
return
# Normal value
v = value.GetValue()
#numchild = 1 if value.MightHaveChildren() else 0
numchild = value.GetNumChildren()
self.put('iname="%s",' % self.currentIName)
self.putType(typeName)
self.putValue('' if v is None else v)
if typeClass == lldb.eTypeClassStruct or typeClass == lldb.eTypeClassClass:
if self.isQObject(value):
self.context = value
if not self.putQObjectNameValue(value): # Is this too expensive?
self.putEmptyValue()
else:
self.putEmptyValue()
else:
v = value.GetValue()
if v:
self.putValue(v)
else:
self.putEmptyValue()
self.put('numchild="%s",' % numchild)
self.put('addr="0x%x",' % value.GetLoadAddress())
if self.currentIName in self.expandedINames:
......@@ -1079,6 +1125,14 @@ class Dumper:
self.putFields(value)
def putFields(self, value):
# Suppress printing of 'name' field for arrays.
if value.GetType().GetTypeClass() == lldb.eTypeClassArray:
for i in xrange(value.GetNumChildren()):
child = value.GetChildAtIndex(i)
with UnnamedSubItem(self, "%d" % (i + 1)):
self.putItem(child)
return
n = value.GetNumChildren()
m = value.GetType().GetNumberOfDirectBaseClasses()
if n > 10000:
......@@ -1094,8 +1148,9 @@ class Dumper:
self.putItem(child)
for i in xrange(m, n):
child = value.GetChildAtIndex(i)
with SubItem(self, child):
self.putItem(child)
if child.IsValid(): # FIXME: Anon members?
with SubItem(self, child):
self.putItem(child)
def reportVariables(self, _ = None):
frame = self.currentThread().GetSelectedFrame()
......
This diff is collapsed.
......@@ -50,6 +50,9 @@ int main(int argc, char *argv[])
// Since we always render text into an FBO, we need to globally disable
// subpixel antialiasing and instead use gray.
qputenv("QSG_DISTANCEFIELD_ANTIALIASING", "gray");
#ifdef Q_OS_MAC //This keeps qml2puppet from stealing focus
qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true");
#endif
QApplication application(argc, argv);
......
......@@ -51,6 +51,10 @@ int main(int argc, char *argv[])
QtSimulatorPrivate::SimulatorConnection::createStubInstance();
#endif
#ifdef Q_OS_MAC //This keeps qml2puppet from stealing focus
qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "true");
#endif
QApplication application(argc, argv);
QCoreApplication::setOrganizationName("QtProject");
......
......@@ -527,6 +527,7 @@ CPLUSPLUS_EXPORT QString simplifySTLType(const QString &typeIn)
if (type.startsWith(QLatin1String("struct ")))
type.remove(0, 7);
type.replace(QLatin1String("std::__1::"), QLatin1String("std::"));
type.replace(QLatin1Char('*'), QLatin1Char('@'));
for (int i = 0; i < 10; ++i) {
......
......@@ -151,6 +151,10 @@ void SshKeyGenerator::generateOpenSslPrivateKeyString(const KeyPtr &key)
= key.dynamicCast<RSA_PrivateKey>();
params << rsaKey->get_n() << rsaKey->get_e() << rsaKey->get_d() << rsaKey->get_p()
<< rsaKey->get_q();
const BigInt dmp1 = rsaKey->get_d() % (rsaKey->get_p() - 1);
const BigInt dmq1 = rsaKey->get_d() % (rsaKey->get_q() - 1);
const BigInt iqmp = inverse_mod(rsaKey->get_q(), rsaKey->get_p());
params << dmp1 << dmq1 << iqmp;
keyId = SshCapabilities::PubKeyRsa;
label = "RSA PRIVATE KEY";
} else {
......
......@@ -36,9 +36,29 @@
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <QDateTime>
#include <QTextStream>
#include <QRegExp>
#include <QRect>
#include <utils/qtcassert.h>
// Read and write rectangle in X11 resource syntax "12x12+4+3"
static QString rectangleToString(const QRect &r)
{
QString result;
QTextStream(&result) << r.width() << 'x' << r.height() << forcesign << r.x() << r.y();
return result;
}
static QRect stringToRectangle(const QString &v)
{
static QRegExp pattern(QLatin1String("(\\d+)x(\\d+)([-+]\\d+)([-+]\\d+)"));
Q_ASSERT(pattern.isValid());
return pattern.exactMatch(v) ?
QRect(QPoint(pattern.cap(3).toInt(), pattern.cap(4).toInt()),
QSize(pattern.cap(1).toInt(), pattern.cap(2).toInt())) :
QRect();
}
/*!
\class Utils::PersistentSettingsReader
......@@ -174,6 +194,8 @@ private:
bool handleStartElement(QXmlStreamReader &r);
bool handleEndElement(const QStringRef &name);
static QString formatWarning(const QXmlStreamReader &r, const QString &message);
QStack<ParseValueStackEntry> m_valueStack;
QVariantMap m_result;
QString m_currentVariableName;
......@@ -223,10 +245,16 @@ bool ParseContext::handleStartElement(QXmlStreamReader &r)
const QString key = attributes.hasAttribute(keyAttribute) ?
attributes.value(keyAttribute).toString() : QString();
switch (e) {
case SimpleValueElement:
case SimpleValueElement: {
// This reads away the end element, so, handle end element right here.
m_valueStack.push_back(ParseValueStackEntry(readSimpleValue(r, attributes), key));
const QVariant v = readSimpleValue(r, attributes);
if (!v.isValid()) {
qWarning() << ParseContext::formatWarning(r, QString::fromLatin1("Failed to read element \"%1\".").arg(name.toString()));
return false;
}
m_valueStack.push_back(ParseValueStackEntry(v, key));
return handleEndElement(name);
}
case ListValueElement:
m_valueStack.push_back(ParseValueStackEntry(QVariant::List, key));
break;
......@@ -256,6 +284,18 @@ bool ParseContext::handleEndElement(const QStringRef &name)
return e == QtCreatorElement;
}
QString ParseContext::formatWarning(const QXmlStreamReader &r, const QString &message)
{
QString result = QLatin1String("Warning reading ");
if (const QIODevice *device = r.device())
if (const QFile *file = qobject_cast<const QFile *>(device))
result += QDir::toNativeSeparators(file->fileName()) + QLatin1Char(':');
result += QString::number(r.lineNumber());
result += QLatin1String(": ");
result += message;
return result;
}
ParseContext::Element ParseContext::element(const QStringRef &r) const
{
if (r == valueElement)
......@@ -282,6 +322,10 @@ QVariant ParseContext::readSimpleValue(QXmlStreamReader &r, const QXmlStreamAttr
QTC_ASSERT(text.size() == 1, return QVariant());
return QVariant(QChar(text.at(0)));
}
if (type == QLatin1String("QRect")) {
const QRect rectangle = stringToRectangle(text);
return rectangle.isValid() ? QVariant(rectangle) : QVariant();
}
QVariant value;
value.setValue(text);
value.convert(QVariant::nameToType(type.toLatin1().data()));
......@@ -361,7 +405,14 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx,
w.writeAttribute(ctx.typeAttribute, QLatin1String(variant.typeName()));
if (!key.isEmpty())
w.writeAttribute(ctx.keyAttribute, key);
w.writeCharacters(variant.toString());
switch (variant.type()) {
case QVariant::Rect:
w.writeCharacters(rectangleToString(variant.toRect()));
break;
default:
w.writeCharacters(variant.toString());
break;
}
w.writeEndElement();
break;
}
......
......@@ -186,8 +186,13 @@ bool AndroidSettingsWidget::checkSDK(const Utils::FileName &location)
|| (!androidExe.appendPath(QLatin1String("/tools/android" QTC_HOST_EXE_SUFFIX)).toFileInfo().exists()
&& !androidBat.appendPath(QLatin1String("/tools/android" ANDROID_BAT_SUFFIX)).toFileInfo().exists())
|| !emulator.appendPath(QLatin1String("/tools/emulator" QTC_HOST_EXE_SUFFIX)).toFileInfo().exists()) {
QMessageBox::critical(this, tr("Android SDK Folder"), tr("\"%1\" does not seem to be an Android SDK top folder.").arg(location.toUserOutput()));
m_ui->sdkWarningIconLabel->setVisible(true);
m_ui->sdkWarningLabel->setVisible(true);
m_ui->sdkWarningLabel->setText(tr("\"%1\" does not seem to be an Android SDK top folder.").arg(location.toUserOutput()));
return false;
} else {
m_ui->sdkWarningIconLabel->setVisible(false);
m_ui->sdkWarningLabel->setVisible(false);
}
return true;
}
......
......@@ -33,7 +33,11 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="SDKLocationLineEdit"/>
<widget class="QLineEdit" name="SDKLocationLineEdit">
<property name="text">
<string/>
</property>