summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2016-11-14 11:15:40 +0200
committerOrgad Shaneh <orgad.shaneh@audiocodes.com>2016-11-14 11:17:13 +0200
commit9c09ca9e42c7a7f39bf279adcb14ae1691a409bc (patch)
tree4a3e10324aa97692fb57e13d4a9870edc7d3e35b
parent1a2f649b70c67380d29cdececbce3fad1b97dfca (diff)
parentb5f587efb540cff5f51052a6e30be3139d8b930d (diff)
downloadqt-creator-9c09ca9e42c7a7f39bf279adcb14ae1691a409bc.tar.gz
Merge remote-tracking branch 'origin/4.2'
Change-Id: Ia98031eb87f1859c3736faa0cdd8b655e8a50689
-rw-r--r--doc/qtcreator-online.qdocconf2
-rw-r--r--doc/src/editors/creator-modeling.qdoc13
-rw-r--r--qbs/imports/QtcAutotest.qbs2
-rw-r--r--qbs/imports/QtcLibrary.qbs2
-rw-r--r--qbs/imports/QtcPlugin.qbs2
-rwxr-xr-xscripts/purify2tasks.pl1
-rw-r--r--share/qtcreator/debugger/cdbbridge.py57
-rw-r--r--share/qtcreator/debugger/dumper.py391
-rw-r--r--share/qtcreator/debugger/gdbbridge.py609
-rw-r--r--share/qtcreator/debugger/lldbbridge.py95
-rw-r--r--share/qtcreator/debugger/misctypes.py19
-rw-r--r--share/qtcreator/debugger/pdbbridge.py226
-rw-r--r--share/qtcreator/debugger/qttypes.py70
-rw-r--r--share/qtcreator/debugger/stdtypes.py2
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp7
-rw-r--r--share/qtcreator/templates/wizards/classes/cpp/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/classes/itemmodel/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/classes/python/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/classes/qtquickui/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/cppheader/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/cppsource/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/form/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/java/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/js/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/modeling/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/nimscript/file.nims1
-rw-r--r--share/qtcreator/templates/wizards/files/nimscript/icon.pngbin0 -> 1511 bytes
-rw-r--r--share/qtcreator/templates/wizards/files/nimscript/wizard.json37
-rw-r--r--share/qtcreator/templates/wizards/files/python/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/qrc/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/qtquick2/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/scratch/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/scxml/wizard.json1
-rw-r--r--share/qtcreator/templates/wizards/files/text/wizard.json1
-rw-r--r--src/libs/3rdparty/cplusplus/Names.h3
-rw-r--r--src/libs/cplusplus/LookupContext.cpp15
-rw-r--r--src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp2
-rw-r--r--src/libs/qmldebug/qmldebugclient.cpp4
-rw-r--r--src/libs/qmljs/qmljscheck.cpp39
-rw-r--r--src/libs/qmljs/qmljslink.cpp2
-rw-r--r--src/libs/qtcreatorcdbext/pycdbextmodule.cpp84
-rw-r--r--src/libs/qtcreatorcdbext/pyfield.cpp10
-rw-r--r--src/libs/qtcreatorcdbext/pytype.cpp4
-rw-r--r--src/libs/qtcreatorcdbext/pyvalue.cpp113
-rw-r--r--src/libs/qtcreatorcdbext/pyvalue.h1
-rw-r--r--src/libs/sqlite/sqlitestatement.cpp4
-rw-r--r--src/libs/timeline/qml/TimeDisplay.qml17
-rw-r--r--src/libs/timeline/timelinetheme.cpp8
-rw-r--r--src/libs/utils/images/filledcircle.png (renamed from src/plugins/debugger/images/breakpoint.png)bin147 -> 147 bytes
-rw-r--r--src/libs/utils/images/filledcircle@2x.png (renamed from src/plugins/debugger/images/breakpoint@2x.png)bin254 -> 254 bytes
-rw-r--r--src/libs/utils/theme/theme.cpp33
-rw-r--r--src/libs/utils/theme/theme.h2
-rw-r--r--src/libs/utils/theme/theme_p.h2
-rw-r--r--src/libs/utils/utils.qrc2
-rw-r--r--src/plugins/android/androidrunner.cpp6
-rw-r--r--src/plugins/autotest/autotest.pro3
-rw-r--r--src/plugins/autotest/autotest.qbs2
-rw-r--r--src/plugins/autotest/gtest/gtest_utils.cpp56
-rw-r--r--src/plugins/autotest/gtest/gtest_utils.h29
-rw-r--r--src/plugins/autotest/qtest/qttest_utils.cpp68
-rw-r--r--src/plugins/autotest/qtest/qttest_utils.h40
-rw-r--r--src/plugins/autotest/qtest/qttestparser.cpp4
-rw-r--r--src/plugins/autotest/qtest/qttestvisitors.cpp16
-rw-r--r--src/plugins/autotest/qtest/qttestvisitors.h6
-rw-r--r--src/plugins/autotest/quick/quicktest_utils.cpp77
-rw-r--r--src/plugins/autotest/quick/quicktest_utils.h49
-rw-r--r--src/plugins/autotest/testcodeparser.cpp53
-rw-r--r--src/plugins/autotest/testrunner.cpp23
-rw-r--r--src/plugins/autotest/unit_test/mixed_atp/tests/auto/bench/bench.qbs2
-rw-r--r--src/plugins/autotest/unit_test/mixed_atp/tests/auto/dummy/dummy.qbs2
-rw-r--r--src/plugins/autotest/unit_test/plain/test_plain/test_plain.qbs2
-rw-r--r--src/plugins/beautifier/beautifierplugin.cpp8
-rw-r--r--src/plugins/clangcodemodel/clangcodemodel.qbs1
-rw-r--r--src/plugins/cmakeprojectmanager/builddirreader.cpp1
-rw-r--r--src/plugins/cmakeprojectmanager/builddirreader.h1
-rw-r--r--src/plugins/cmakeprojectmanager/cmakekitinformation.cpp8
-rw-r--r--src/plugins/cmakeprojectmanager/tealeafreader.cpp4
-rw-r--r--src/plugins/coreplugin/documentmanager.cpp54
-rw-r--r--src/plugins/coreplugin/documentmanager.h3
-rw-r--r--src/plugins/coreplugin/editormanager/editormanager.cpp20
-rw-r--r--src/plugins/coreplugin/variablechooser.cpp14
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp4
-rw-r--r--src/plugins/debugger/commonoptionspage.cpp380
-rw-r--r--src/plugins/debugger/commonoptionspage.h24
-rw-r--r--src/plugins/debugger/debugger.qbs6
-rw-r--r--src/plugins/debugger/debugger.qrc2
-rw-r--r--src/plugins/debugger/debuggeractions.h9
-rw-r--r--src/plugins/debugger/debuggerengine.cpp3
-rw-r--r--src/plugins/debugger/debuggerengine.h3
-rw-r--r--src/plugins/debugger/debuggericons.cpp4
-rw-r--r--src/plugins/debugger/debuggerkitinformation.cpp2
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp8
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp2
-rw-r--r--src/plugins/debugger/lldb/lldbengine.cpp2
-rw-r--r--src/plugins/debugger/qml/qmlengine.cpp8
-rw-r--r--src/plugins/debugger/qml/qmlengine.h2
-rw-r--r--src/plugins/debugger/qml/qmlinspectoragent.cpp2
-rw-r--r--src/plugins/debugger/registerhandler.cpp2
-rw-r--r--src/plugins/debugger/watchhandler.cpp27
-rw-r--r--src/plugins/debugger/watchhandler.h3
-rw-r--r--src/plugins/designer/designer.qbs5
-rw-r--r--src/plugins/git/commitdata.cpp24
-rw-r--r--src/plugins/git/commitdata.h4
-rw-r--r--src/plugins/git/gitclient.cpp7
-rw-r--r--src/plugins/git/gitgrep.cpp9
-rw-r--r--src/plugins/git/gitplugin.cpp4
-rw-r--r--src/plugins/git/gitsubmiteditor.cpp2
-rw-r--r--src/plugins/git/logchangedialog.cpp1
-rw-r--r--src/plugins/git/mergetool.cpp35
-rw-r--r--src/plugins/git/mergetool.h1
-rw-r--r--src/plugins/ios/iosrunner.cpp2
-rw-r--r--src/plugins/modeleditor/modeleditor.cpp6
-rw-r--r--src/plugins/nim/Nim.mimetypes.xml6
-rw-r--r--src/plugins/nim/editor/nimeditorfactory.cpp1
-rw-r--r--src/plugins/nim/nimconstants.h1
-rw-r--r--src/plugins/nim/nimplugin.cpp4
-rw-r--r--src/plugins/nim/settings/nimsettings.cpp1
-rw-r--r--src/plugins/projectexplorer/abstractmsvctoolchain.cpp3
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp27
-rw-r--r--src/plugins/projectexplorer/projectexplorericons.cpp6
-rw-r--r--src/plugins/projectexplorer/projectexplorericons.h3
-rw-r--r--src/plugins/projectexplorer/projectwindow.cpp7
-rw-r--r--src/plugins/projectexplorer/target.cpp6
-rw-r--r--src/plugins/pythoneditor/pythoneditorplugin.cpp7
-rw-r--r--src/plugins/pythoneditor/pythoneditorplugin.h2
-rw-r--r--src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp7
-rw-r--r--src/plugins/qbsprojectmanager/qbsbuildstep.cpp7
-rw-r--r--src/plugins/qbsprojectmanager/qbsproject.cpp96
-rw-r--r--src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp4
-rw-r--r--src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h2
-rw-r--r--src/plugins/qmakeprojectmanager/qmakenodes.cpp13
-rw-r--r--src/plugins/qmakeprojectmanager/qmakenodes.h3
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeproject.cpp47
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeproject.h2
-rw-r--r--src/plugins/qmldesigner/components/componentcore/theming.cpp26
-rw-r--r--src/plugins/qmldesigner/components/componentcore/theming.h2
-rw-r--r--src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp7
-rw-r--r--src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h1
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp3
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h1
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp3
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h1
-rw-r--r--src/plugins/qmldesigner/designercore/include/componenttextmodifier.h4
-rw-r--r--src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp2
-rw-r--r--src/plugins/qmldesigner/designercore/model/componenttextmodifier.cpp28
-rw-r--r--src/plugins/qmldesigner/qtquickplugin/source/pathviewv2.qml28
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertool.cpp2
-rw-r--r--src/plugins/qnx/qnxdebugsupport.cpp17
-rw-r--r--src/plugins/qtsupport/QtSupport.mimetypes.xml4
-rw-r--r--src/plugins/scxmleditor/plugin_interface/actionhandler.cpp46
-rw-r--r--src/plugins/scxmleditor/plugin_interface/initialwarningitem.h1
-rw-r--r--src/plugins/scxmleditor/plugin_interface/scattributeitemmodel.h1
-rw-r--r--src/plugins/scxmleditor/plugin_interface/scshapeprovider.h1
-rw-r--r--src/plugins/scxmleditor/plugin_interface/scxmltag.h1
-rw-r--r--src/plugins/scxmleditor/scxmleditordata.h1
-rw-r--r--src/plugins/subversion/subversionclient.cpp21
-rw-r--r--src/plugins/subversion/subversionclient.h3
-rw-r--r--src/plugins/subversion/subversionplugin.cpp20
-rw-r--r--src/plugins/texteditor/basefilefind.cpp2
-rw-r--r--src/plugins/welcome/welcomeplugin.cpp12
m---------src/shared/qbs0
-rw-r--r--src/tools/icons/qtcreatoricons.svg2
-rw-r--r--src/tools/iostool/iostool.qbs2
-rw-r--r--src/tools/iostool/main.cpp4
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp61
-rw-r--r--tests/system/objects.map8
-rw-r--r--tests/system/shared/project.py2
-rw-r--r--tests/system/shared/utils.py4
-rw-r--r--tests/system/suite_editors/tst_generic_highlighter/test.py2
-rw-r--r--tests/system/suite_general/tst_create_proj_wizard/test.py5
-rw-r--r--tests/system/suite_general/tst_default_settings/test.py61
175 files changed, 2136 insertions, 1554 deletions
diff --git a/doc/qtcreator-online.qdocconf b/doc/qtcreator-online.qdocconf
index 70b9f01338..e2a875c30b 100644
--- a/doc/qtcreator-online.qdocconf
+++ b/doc/qtcreator-online.qdocconf
@@ -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" \
diff --git a/doc/src/editors/creator-modeling.qdoc b/doc/src/editors/creator-modeling.qdoc
index fedb7d703a..3b7acd31f8 100644
--- a/doc/src/editors/creator-modeling.qdoc
+++ b/doc/src/editors/creator-modeling.qdoc
@@ -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.
diff --git a/qbs/imports/QtcAutotest.qbs b/qbs/imports/QtcAutotest.qbs
index 586626b22d..03670f2902 100644
--- a/qbs/imports/QtcAutotest.qbs
+++ b/qbs/imports/QtcAutotest.qbs
@@ -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("")
diff --git a/qbs/imports/QtcLibrary.qbs b/qbs/imports/QtcLibrary.qbs
index 5c54ba8894..af6eb04bad 100644
--- a/qbs/imports/QtcLibrary.qbs
+++ b/qbs/imports/QtcLibrary.qbs
@@ -8,7 +8,7 @@ QtcProduct {
useNonGuiPchFile: true
Depends {
condition: qtc.testsEnabled
- name: "Qt.test"
+ name: "Qt.testlib"
}
targetName: QtcFunctions.qtLibraryName(qbs, name)
diff --git a/qbs/imports/QtcPlugin.qbs b/qbs/imports/QtcPlugin.qbs
index 5f11e136ee..1a6406f176 100644
--- a/qbs/imports/QtcPlugin.qbs
+++ b/qbs/imports/QtcPlugin.qbs
@@ -22,7 +22,7 @@ QtcProduct {
Depends { name: "pluginjson" }
Depends {
condition: qtc.testsEnabled
- name: "Qt.test"
+ name: "Qt.testlib"
}
Properties {
diff --git a/scripts/purify2tasks.pl b/scripts/purify2tasks.pl
index 24aa1aafea..655df47b68 100755
--- a/scripts/purify2tasks.pl
+++ b/scripts/purify2tasks.pl
@@ -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;
}
}
diff --git a/share/qtcreator/debugger/cdbbridge.py b/share/qtcreator/debugger/cdbbridge.py
index bea616b1f1..827502e170 100644
--- a/share/qtcreator/debugger/cdbbridge.py
+++ b/share/qtcreator/debugger/cdbbridge.py
@@ -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 = []
diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py
index 554e4037c0..b637eef410 100644
--- a/share/qtcreator/debugger/dumper.py
+++ b/share/qtcreator/debugger/dumper.py
@@ -110,7 +110,8 @@ TypeCodeFunction, \
TypeCodeMemberPointer, \
TypeCodeFortranString, \
TypeCodeUnresolvable, \
- = range(0, 14)
+TypeCodeBitfield, \
+ = range(0, 15)
def isIntegralTypeName(name):
return name in ('int', 'unsigned int', 'signed int',
@@ -288,8 +289,11 @@ class DumperBase:
self.typesToReport = {}
self.qtNamespaceToReport = None
self.passExceptions = False
+ self.isTesting = False
self.typeData = {}
+ self.isBigEndian = False
+ self.packCode = '<'
self.resetCaches()
self.resetStats()
@@ -333,6 +337,7 @@ class DumperBase:
self.useFancy = int(args.get('fancy', '0'))
self.forceQtNamespace = int(args.get('forcens', '0'))
self.passExceptions = int(args.get('passexceptions', '0'))
+ self.isTesting = int(args.get('testing', '0'))
self.showQObjectNames = int(args.get('qobjectnames', '0'))
self.nativeMixed = int(args.get('nativemixed', '0'))
self.autoDerefPointers = int(args.get('autoderef', '0'))
@@ -389,12 +394,12 @@ class DumperBase:
self.counts[key] = 1
def preping(self, key):
- import time
+ return
self.pretimings[key] = time.time()
def ping(self, key):
- import time
- elapsed = int(1000000 * (time.time() - self.pretimings[key]))
+ return
+ elapsed = int(1000 * (time.time() - self.pretimings[key]))
self.timings.append([key, elapsed])
def childRange(self):
@@ -518,6 +523,9 @@ class DumperBase:
nativeType = self.lookupNativeType(typeName)
return None if nativeType is None else self.fromNativeType(nativeType)
+ def nativeDynamicType(self, address, baseType):
+ return baseType # Override in backends.
+
def listTemplateParameters(self, typename):
targs = []
if not typename.endswith('>'):
@@ -855,6 +863,7 @@ class DumperBase:
self.putValue(self.prettySymbolByAddress(address))
def putFields(self, value, dumpBase = True):
+ baseIndex = 0
for item in value.members(True):
#warn('FIELD: %s' % item)
if item.name is not None and item.name.startswith('_vptr.'):
@@ -879,12 +888,13 @@ class DumperBase:
continue
if item.isBaseClass and dumpBase:
+ baseIndex += 1
# We cannot use nativeField.name as part of the iname as
# it might contain spaces and other strange characters.
- with UnnamedSubItem(self, "@%d" % (item.baseIndex + 1)):
+ with UnnamedSubItem(self, "@%d" % baseIndex):
self.putField('iname', self.currentIName)
self.putField('name', '[%s]' % item.name)
- self.putField('sortgroup', 1000 - item.baseIndex)
+ self.putField('sortgroup', 1000 - baseIndex)
self.putAddress(item.address())
self.putItem(item)
continue
@@ -916,7 +926,7 @@ class DumperBase:
self.checkIntType(tsize)
self.checkIntType(maximum)
- code = (None, 'b', 'H', None, 'I')[tsize]
+ code = self.packCode + (None, 'b', 'H', None, 'I')[tsize]
#blob = self.readRawMemory(base, 1)
blob = bytes()
while maximum > 1:
@@ -1137,7 +1147,7 @@ class DumperBase:
n = arrayByteSize // innerType.size()
p = value.address()
if displayFormat != RawFormat and p:
- if innerType.name in ('char', 'wchar_t'):
+ if innerType.name in ('char', 'wchar_t', 'unsigned char', 'signed char'):
self.putCharArrayHelper(p, n, innerType, self.currentItemFormat(),
makeExpandable = False)
else:
@@ -1216,7 +1226,7 @@ class DumperBase:
# This is shared by pointer and array formatting.
def tryPutSimpleFormattedPointer(self, ptr, typeName, innerType, displayFormat, limit):
if displayFormat == AutomaticFormat:
- if innerType.name == 'char':
+ if innerType.name in ('char', 'signed char', 'unsigned char'):
# Use UTF-8 as default for char *.
self.putType(typeName)
(elided, shown, data) = self.readToFirstZero(ptr, 1, limit)
@@ -1282,6 +1292,11 @@ class DumperBase:
return False
def putFormattedPointer(self, value):
+ self.preping('formattedPointer')
+ self.putFormattedPointerX(value)
+ self.ping('formattedPointer')
+
+ def putFormattedPointerX(self, value):
#warn("PUT FORMATTED: %s" % value)
pointer = value.pointer()
#warn('POINTER: 0x%x' % pointer)
@@ -1368,7 +1383,7 @@ class DumperBase:
#warn('GENERIC PLAIN POINTER: %s' % value.type)
#warn('ADDR PLAIN POINTER: 0x%x' % value.laddress)
self.putType(typeName)
- self.putValue('0x%x' % pointer)
+ self.putSymbolValue(pointer)
self.putNumChild(1)
if self.currentIName in self.expandedINames:
with Children(self):
@@ -1444,12 +1459,19 @@ class DumperBase:
else:
return p > 100000 and (p & 0x7 == 0) and (p < 0x7fffffffffff)
+ def canBeVTableEntry(self, p):
+ if self.ptrSize() == 4:
+ return p > 100000 and (p & 0x1 == 0)
+ else:
+ return p > 100000 and (p & 0x1 == 0) and (p < 0x7fffffffffff)
+
def couldBeQObject(self, objectPtr):
try:
(vtablePtr, dd) = self.split('pp', objectPtr)
except:
self.bump('nostruct-1')
return False
+
if not self.canBePointer(vtablePtr):
self.bump('vtable')
return False
@@ -1458,6 +1480,33 @@ class DumperBase:
return False
try:
+ metaObjectFunc, metaCastFunc, metaCallFunc = self.split('ppp', vtablePtr)
+ except:
+ return False
+
+ # The first three entries are in a fairly rigid relationship defined
+ # by the Q_OBJECT macro.
+ if not self.canBeVTableEntry(metaObjectFunc):
+ return False
+ if not self.canBeVTableEntry(metaCastFunc):
+ return False
+ if not self.canBeVTableEntry(metaCallFunc):
+ return False
+ if metaCastFunc < metaObjectFunc or metaCastFunc > metaObjectFunc + 200:
+ # The metaObject implementation is just that:
+ # QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject()
+ # : &staticMetaObject;
+ # That should not exceed 200 bytes. Observed on x86_64 debug 72.
+ return False
+ if metaCallFunc < metaCastFunc or metaCallFunc > metaCastFunc + 200:
+ # if (!_clname) return nullptr;
+ # if (!strcmp(_clname, qt_meta_stringdata_Bar__TestObject.stringdata0))
+ # return static_cast<void*>(const_cast< TestObject*>(this));
+ # return QWidget::qt_metacast(_clname);
+ # That should not exceed 200 bytes. Observed on x86_64 debug 80.
+ return False
+
+ try:
(dvtablePtr, qptr, parentPtr, childrenDPtr, flags) \
= self.split('ppppI', dd)
except:
@@ -1529,14 +1578,9 @@ class DumperBase:
typeName = someTypeObj.name
isQObjectProper = typeName == self.qtNamespace() + 'QObject'
- if not isQObjectProper:
- #if someTypeObj.firstBase() is None:
- # warn("FIRST BASE IS NONE")
- # return 0
-
- # No templates for now.
- if typeName.find('<') >= 0:
- return 0
+ # No templates for now.
+ if typeName.find('<') >= 0:
+ return 0
result = self.findStaticMetaObject(typeName)
@@ -1568,10 +1612,10 @@ class DumperBase:
#except:
# warn('METAOBJECT EXTRACTION FAILED FOR UNKNOWN REASON')
- if not result:
- base = someTypeObj.firstBase()
- if base is not None and base != someTypeObj: # sanity check
- result = extractStaticMetaObjectPtrFromType(base)
+ #if not result:
+ # base = someTypeObj.firstBase()
+ # if base is not None and base != someTypeObj: # sanity check
+ # result = extractStaticMetaObjectPtrFromType(base)
self.knownStaticMetaObjects[someTypeName] = result
return result
@@ -1999,7 +2043,7 @@ class DumperBase:
self.putItemCount(0)
else:
connections = connections.dereference()
- connections = connections.cast(connections.type.firstBase())
+ #connections = connections.cast(connections.type.firstBase())
self.putSpecialValue('minimumitemcount', 0)
self.putNumChild(1)
if self.isExpanded():
@@ -2210,25 +2254,28 @@ class DumperBase:
self.preping('locals')
shadowed = {}
for value in variables:
- self.anonNumber = 0
- if value.name == 'argv' and value.type.name == 'char **':
- self.putSpecialArgv(value)
+ if value.name == 'argv':
+ if value.type.code == TypeCodePointer:
+ if value.type.ltarget.code == TypeCodePointer:
+ if value.type.ltarget.ltarget.name == 'char':
+ self.putSpecialArgv(value)
+ continue
+
+ name = value.name
+ if name in shadowed:
+ level = shadowed[name]
+ shadowed[name] = level + 1
+ name += '@%d' % level
else:
- name = value.name
- if name in shadowed:
- level = shadowed[name]
- shadowed[name] = level + 1
- name += '@%d' % level
- else:
- shadowed[name] = 1
- # A 'normal' local variable or parameter.
- iname = value.iname if hasattr(value, 'iname') else 'local.' + name
- with TopLevelItem(self, iname):
- self.preping('all-' + iname)
- self.putField('iname', iname)
- self.putField('name', name)
- self.putItem(value)
- self.ping('all-' + iname)
+ shadowed[name] = 1
+ # A 'normal' local variable or parameter.
+ iname = value.iname if hasattr(value, 'iname') else 'local.' + name
+ with TopLevelItem(self, iname):
+ self.preping('all-' + iname)
+ self.putField('iname', iname)
+ self.putField('name', name)
+ self.putItem(value)
+ self.ping('all-' + iname)
self.ping('locals')
def handleWatches(self, args):
@@ -2539,6 +2586,11 @@ class DumperBase:
return False
def putItem(self, value):
+ self.preping('putItem')
+ self.putItemX(value)
+ self.ping('putItem')
+
+ def putItemX(self, value):
#warn('PUT ITEM: %s' % value.stringify())
typeobj = value.type #unqualified()
@@ -2563,10 +2615,7 @@ class DumperBase:
if typeobj.code == TypeCodeTypedef:
#warn('TYPEDEF VALUE: %s' % value.stringify())
- #strippedType = typeobj.ltarget
self.putItem(value.detypedef())
- if value.lbitsize is not None and value.lbitsize != value.type.size() * 8:
- typeName += ' : %s' % value.lbitsize
self.putBetterType(typeName)
return
@@ -2593,16 +2642,17 @@ class DumperBase:
self.putCStyleArray(value)
return
+ if typeobj.code == TypeCodeBitfield:
+ #warn('BITFIELD VALUE: %s %s' % (value.name, value))
+ self.putNumChild(0)
+ self.putValue(value.lvalue)
+ self.putType(typeName)
+ return
+
if typeobj.code == TypeCodeIntegral:
#warn('INTEGER: %s %s' % (value.name, value))
val = value.value()
self.putNumChild(0)
- if value.lbitsize is not None and value.lbitsize != value.type.size() * 8:
- typeName += ' : %s' % value.lbitsize
- val = val >> value.lbitpos
- val = val & ((1 << value.lbitsize) - 1)
- #warn('VAL: %s BITPOS: %s BITSIZE: %s'
- # % (val, value.lbitpos, value.lbitsize))
self.putValue(val)
self.putType(typeName)
return
@@ -2772,6 +2822,8 @@ class DumperBase:
return self.detypedef().value()
if self.type.code == TypeCodeIntegral:
return self.integer()
+ if self.type.code == TypeCodeBitfield:
+ return self.integer()
if self.type.code == TypeCodeFloat:
return self.floatingPoint()
if self.type.code == TypeCodeTypedef:
@@ -2828,6 +2880,9 @@ class DumperBase:
elif isinstance(index, self.dumper.Field):
field = index
elif self.dumper.isInt(index):
+ if self.type.code in (TypeCodeArray, TypeCodePointer):
+ itemAddress = self.laddress + int(index) * self.type.ltarget.size()
+ return self.dumper.createValue(itemAddress, self.type.ltarget)
return self.members(False)[index]
else:
error('BAD INDEX TYPE %s' % type(index))
@@ -2850,15 +2905,40 @@ class DumperBase:
error('BAD INDEX TYPE %s' % type(field))
#warn('FIELD: %s ' % field)
- fieldBitsize = field.bitsize()
- fieldSize = None if fieldBitsize is None else fieldBitsize >> 3
- fieldBitpos = field.bitpos()
- fieldOffset = fieldBitpos >> 3
- fieldBitpos -= fieldOffset * 8
- fieldType = field.fieldType()
-
val = self.dumper.Value(self.dumper)
val.name = field.name
+ val.isBaseClass = field.isBaseClass
+ val.type = field.fieldType()
+
+ if field.isArtificial:
+ if self.laddress is not None:
+ val.laddress = self.laddress
+ if self.ldata is not None:
+ val.ldata = self.ldata
+ return val
+
+ fieldBitsize = field.lbitsize
+ fieldSize = (fieldBitsize + 7) // 8
+ fieldBitpos = field.lbitpos
+ fieldOffset = fieldBitpos // 8
+ fieldType = field.fieldType()
+
+ if fieldType.code == TypeCodeBitfield:
+ fieldBitpos -= fieldOffset * 8
+ ldata = self.data()
+ data = 0
+ for i in range(fieldSize):
+ data = data << 8
+ if self.dumper.isBigEndian:
+ byte = ldata[i]
+ else:
+ byte = ldata[fieldOffset + fieldSize - 1 - i]
+ data += ord(byte)
+ data = data >> fieldBitpos
+ data = data & ((1 << fieldBitsize) - 1)
+ val.lvalue = data
+ val.laddress = None
+ return val
if self.laddress is not None:
val.laddress = self.laddress + fieldOffset
@@ -2867,30 +2947,14 @@ class DumperBase:
else:
self.dumper.check(False)
- if fieldBitsize is not None and fieldBitsize != fieldType.size() * 8:
- data = val.extractInteger(fieldBitsize, True)
- data = data >> fieldBitpos
- data = data & ((1 << fieldBitsize) - 1)
- val.laddress = None
- val.ldata = bytes(struct.pack('Q', data))
-
- val.type = None
- if val.laddress is not None and fieldType is not None:
- if fieldType.code == TypeCodePointer:
- objectAddress = self.dumper.extractPointer(val.laddress)
- val = self.dumper.createPointerValue(objectAddress, fieldType.ltarget)
- elif fieldType.code == TypeCodeReference:
- objectAddress = self.dumper.extractPointer(val.laddress)
- val = self.dumper.createReferenceValue(objectAddress, fieldType.ltarget)
- if val.type is None:
- val.type = fieldType
+ if fieldType.code == TypeCodeReference:
+ if val.laddress is not None:
+ val = self.dumper.createReferenceValue(val.laddress, fieldType.ltarget)
+ val.name = field.name
#warn('GOT VAL %s FOR FIELD %s' % (val, field))
- val.check()
- val.name = field.name
val.lbitsize = fieldBitsize
- val.isBaseClass = field.isBaseClass
- val.baseIndex = field.baseIndex
+ val.check()
return val
# This is the generic version for synthetic values.
@@ -2899,11 +2963,31 @@ class DumperBase:
def members(self, includeBases):
if self.type.code == TypeCodeTypedef:
return self.detypedef().members(includeBases)
+
+ tdata = self.type.typeData()
+ #if isinstance(tdata.lfields, list):
+ # return tdata.lfields
+
+ fields = []
+ if tdata.lfields is not None:
+ if isinstance(tdata.lfields, list):
+ fields = tdata.lfields
+ else:
+ fields = list(tdata.lfields(self))
+
+ #warn("FIELDS: %s" % fields)
res = []
- for field in self.type.fields(self):
+ anonNumber = 0
+ for field in fields:
if field.isBaseClass and not includeBases:
continue
- res.append(field)
+ if field.name is None or len(field.name) == 0:
+ # Something without a name.
+ # Anonymous union? We need a dummy name to distinguish
+ # multiple anonymous unions in the struct.
+ anonNumber += 1
+ field.name = '#%s' % anonNumber
+ res.append(self.extractField(field))
return res
def __add__(self, other):
@@ -2914,7 +2998,7 @@ class DumperBase:
address = self.pointer() + stripped.dereference().size()
val = self.dumper.Value(self.dumper)
val.laddress = None
- val.ldata = bytes(struct.pack('Q', address))
+ val.ldata = bytes(struct.pack(self.dumper.packCode + 'Q', address))
val.type = self.type
return val
error('BAD DATA TO ADD TO: %s %s' % (self.type, other))
@@ -2928,10 +3012,10 @@ class DumperBase:
val.laddress = self.pointer()
if val.laddress is None and self.laddress is not None:
val.laddress = self.laddress
- val.type = self.type.dereference().dynamicType(val.laddress)
+ val.type = self.dumper.nativeDynamicType(val.laddress, self.type.dereference())
elif self.type.code == TypeCodePointer:
val.laddress = self.pointer()
- val.type = self.type.dereference().dynamicType(val.laddress)
+ val.type = self.dumper.nativeDynamicType(val.laddress, self.type.dereference())
else:
error("WRONG: %s" % self.type.code)
#warn("DEREFERENCING FROM: %s" % self)
@@ -2964,10 +3048,12 @@ class DumperBase:
error('NOT IMPLEMENTED')
def zeroExtend(self, data, size):
+ ext = '\0' * (size - len(data))
if sys.version_info[0] == 3:
- return data + bytes('\0' * (size - len(data)), encoding='latin1')
+ pad = bytes(ext, encoding='latin1')
else:
- return data + bytes('\0' * (size - len(data)))
+ pad = bytes(ext)
+ return pad + data if self.dumper.isBigEndian else data + pad
def cast(self, typish):
self.check()
@@ -3008,6 +3094,7 @@ class DumperBase:
error('CANNOT CONVERT TO BYTES: %s' % self)
def extractInteger(self, bitsize, unsigned):
+ self.dumper.preping('extractInt')
self.check()
if bitsize > 32:
size = 8
@@ -3022,27 +3109,30 @@ class DumperBase:
size = 1
code = 'B' if unsigned else 'b'
rawBytes = self.data(size)
- try:
- return struct.unpack_from(code, rawBytes, 0)[0]
- except:
- pass
- error('Cannot extract: Code: %s Bytes: %s Bitsize: %s Size: %s'
- % (code, self.dumper.hexencode(rawBytes), bitsize, size))
+ res = struct.unpack_from(self.dumper.packCode + code, rawBytes, 0)[0]
+ #warn('Extract: Code: %s Bytes: %s Bitsize: %s Size: %s'
+ # % (self.dumper.packCode + code, self.dumper.hexencode(rawBytes), bitsize, size))
+ self.dumper.ping('extractInt')
+ return res
def extractSomething(self, code, bitsize):
+ self.dumper.preping('extractSomething')
self.check()
size = (bitsize + 7) >> 3
rawBytes = self.data(size)
- return struct.unpack_from(code, rawBytes, 0)[0]
+ res = struct.unpack_from(self.dumper.packCode + code, rawBytes, 0)[0]
+ self.dumper.ping('extractSomething')
+ return res
def to(self, pattern):
return self.split(pattern)[0]
def split(self, pattern):
+ self.dumper.preping('split')
#warn('EXTRACT STRUCT FROM: %s' % self.type)
(pp, size, fields) = self.dumper.describeStruct(pattern)
#warn('SIZE: %s ' % size)
- result = struct.unpack_from(pp, self.data(size))
+ result = struct.unpack_from(self.dumper.packCode + pp, self.data(size))
def structFixer(field, thing):
#warn('STRUCT MEMBER: %s' % type(thing))
if field.isStruct:
@@ -3058,6 +3148,7 @@ class DumperBase:
return thing
if len(fields) != len(result):
error('STRUCT ERROR: %s %s' (fields, result))
+ self.dumper.ping('split')
return tuple(map(structFixer, fields, result))
def checkPointer(self, p, align = 1):
@@ -3084,8 +3175,6 @@ class DumperBase:
self.lfields = None # None or Value -> list of member Values
self.lalignment = None # Function returning alignment of this struct
self.lbitsize = None
- self.lbitpos = None
- self.lfirstBase = None
self.ltarget = None # Inner type for arrays
self.templateArguments = []
self.code = None
@@ -3099,8 +3188,6 @@ class DumperBase:
tdata.lfields = self.lfields
tdata.lalignment = self.lalignment
tdata.lbitsize = self.lbitsize
- tdata.lbitpos = self.lbitpos
- tdata.lfirstBase = self.lfirstBase
tdata.ltarget = self.ltarget
tdata.templateArguments = self.templateArguments
tdata.code = self.code
@@ -3158,8 +3245,8 @@ class DumperBase:
tdata = self.typeData()
if tdata is None:
return 'Type(id="%s")' % self.typeId
- return 'Type(name="%s",bsize=%s,bpos=%s,code=%s)' \
- % (tdata.name, tdata.lbitsize, tdata.lbitpos, tdata.code)
+ return 'Type(name="%s",bsize=%s,code=%s)' \
+ % (tdata.name, tdata.lbitsize, tdata.code)
def __getitem__(self, index):
if self.dumper.isInt(index):
@@ -3182,7 +3269,12 @@ class DumperBase:
return self.dumper.nativeDynamicTypeName(address, self)
def dynamicType(self, address):
+ # FIXME: That buys some performance at the cost of a fail
+ # of Gdb13393 dumper test.
+ #return self
+ self.dumper.preping('dynamicType %s 0x%s' % (self.name, address))
dynTypeName = self.dynamicTypeName(address)
+ self.dumper.ping('dynamicType %s 0x%s' % (self.name, address))
if dynTypeName is not None:
return self.dumper.createType(dynTypeName)
return self
@@ -3203,7 +3295,7 @@ class DumperBase:
def unqualified(self):
return self
- def templateArgument(self, position, numeric = False):
+ def templateArgument(self, position):
tdata = self.typeData()
#warn('TDATA: %s' % tdata)
#warn('ID: %s' % self.typeId)
@@ -3217,11 +3309,7 @@ class DumperBase:
return res
#warn('TA: %s %s' % (position, self.typeId))
#warn('ARGS: %s' % tdata.templateArguments)
- res = tdata.templateArguments[position]
- #if tdata.templateArguments is not None:
- #if numeric:
- # return tdata.templateArguments[position].value()
- return res
+ return tdata.templateArguments[position]
def simpleEncoding(self):
res = {
@@ -3247,7 +3335,7 @@ class DumperBase:
tdata = self.typeData()
if tdata.code == TypeCodeTypedef:
return tdata.ltarget.alignment()
- if self.isSimpleType():
+ if tdata.code in (TypeCodeIntegral, TypeCodeFloat, TypeCodeEnum):
if tdata.name in ('double', 'long long', 'unsigned long long'):
return self.dumper.ptrSize() # Crude approximation.
return self.size()
@@ -3260,16 +3348,6 @@ class DumperBase:
return tdata.lalignment
return 1
- #align = 1
- #for field in self.fields():
- # #warn(' SUBFIELD: %s TYPE %s' % (field.name, field.fieldType().name))
- # a = field.fieldType().alignment()
- # #warn(' SUBFIELD: %s ALIGN: %s' % (field.name, a))
- # if a is not None and a > align:
- # align = a
- ##warn('COMPUTED ALIGNMENT: %s ' % align)
- #return align
-
def pointer(self):
return self.dumper.createPointerType(self)
@@ -3286,20 +3364,6 @@ class DumperBase:
def target(self):
return self.typeData().ltarget
- def fields(self, value):
- tdata = self.typeData()
- if tdata.code == TypeCodeTypedef:
- return tdata.ltarget.fields(value)
- if tdata.lfields is not None:
- return tdata.lfields(value)
- return []
-
- def firstBase(self):
- #lfields = self.fields()
- #if len(lfields) > 0 and lfields[0].isBaseClass:
- # return lfields[0].ltype
- #return None
- return self.typeData().lfirstBase
def field(self, value, name, bitoffset = 0):
#warn('GETTING FIELD %s FOR: %s' % (name, self.name))
@@ -3364,10 +3428,8 @@ class DumperBase:
def __init__(self, dumper):
self.dumper = dumper
self.name = None
- self.baseIndex = None # Base class index if parent is structure
- self.nativeIndex = None # Backend-defined index value
self.isBaseClass = False
- self.isVirtualBase = False
+ self.isArtificial = False
self.ltype = None
self.lbitsize = None
self.lbitpos = None
@@ -3375,36 +3437,23 @@ class DumperBase:
def __str__(self):
typename = None if self.ltype is None else self.ltype.stringify()
- return ('Field(name="%s",ltype=%s,bpos=%s,bsize=%s,'
- + 'bidx=%s,nidx=%s)') \
- % (self.name, typename,
- self.lbitpos, self.lbitsize,
- self.baseIndex, self.nativeIndex)
+ return ('Field(name="%s",ltype=%s,bpos=%s,bsize=%s)') \
+ % (self.name, typename, self.lbitpos, self.lbitsize)
def check(self):
pass
def size(self):
- return self.bitsize() >> 3
+ return self.lbitsize // 8
def offset(self):
- return self.bitpos() >> 3
+ return self.lbitpos // 8
def bitsize(self):
- self.check()
- if self.lbitsize is not None:
- return self.lbitsize
- fieldType = self.fieldType()
- # FIXME: enforce return value != None.
- if fieldType is not None:
- return fieldType.bitsize()
- return None
+ return self.lbitsize
def bitpos(self):
- if self.lbitpos is not None:
- #warn('BITPOS KNOWN: %s %s' % (self.name, self.lbitpos))
- return self.lbitpos
- error('DONT KNOW BITPOS FOR FIELD: %s ' % self)
+ return self.lbitpos
def fieldType(self):
if self.ltype is not None:
@@ -3412,12 +3461,13 @@ class DumperBase:
error('CANT GET FIELD TYPE FOR %s' % self)
return None
+ def ptrCode(self):
+ return 'I' if self.ptrSize() == 4 else 'Q'
+
def toPointerData(self, address):
if not self.isInt(address):
error('wrong')
- size = self.ptrSize()
- code = 'I' if size == 4 else 'Q'
- return bytes(struct.pack(code, address))
+ return bytes(struct.pack(self.packCode + self.ptrCode(), address))
def createPointerValue(self, targetAddress, targetTypish):
if not isinstance(targetTypish, self.Type) and not isinstance(targetTypish, str):
@@ -3445,6 +3495,20 @@ class DumperBase:
val.type = self.createReferenceType(targetType)
return val
+ def createBitfieldValue(self, targetType, bitsize):
+ if not isinstance(targetType, self.Type):
+ error('Expected type in createBitfieldValue(), got %s'
+ % type(targetType))
+ targetTypeId = targetType.typeId
+ typeId = '%s:%d' % (targetTypeId, bitsize)
+ tdata = self.TypeData(self)
+ tdata.name = '%s : %d' % (targetType.name, bitsize)
+ tdata.typeId = typeId
+ tdata.code = TypeCodeArray
+ tdata.ltarget = targetType
+ self.registerType(typeId, tdata)
+ return self.Type(self, typeId)
+
def createPointerType(self, targetType):
if not isinstance(targetType, self.Type):
error('Expected type in createPointerType(), got %s'
@@ -3488,6 +3552,19 @@ class DumperBase:
self.registerType(typeId, tdata)
return self.Type(self, typeId)
+ def createBitfieldType(self, targetTypeId, bitsize):
+ if not isinstance(targetTypeId, str):
+ error('Expected type in createBitfieldType(), got %s'
+ % type(targetType))
+ typeId = '%s:%d' % (targetTypeId, bitsize)
+ tdata = self.TypeData(self)
+ tdata.name = '%s : %d' % (targetTypeId, bitsize)
+ tdata.typeId = typeId
+ tdata.code = TypeCodeBitfield
+ tdata.lbitsize = bitsize
+ self.registerType(typeId, tdata)
+ return self.Type(self, typeId)
+
def createTypedefedType(self, targetType, typeId):
if not isinstance(targetType, self.Type):
error('Expected type in createTypedefType(), got %s'
@@ -3630,7 +3707,7 @@ class DumperBase:
if self.autoPadNext:
self.currentBitsize = 8 * ((self.currentBitsize + 7) >> 3) # Fill up byte.
padding = (fieldAlign - (self.currentBitsize >> 3)) % fieldAlign
- #warn('AUTO PADDING AT %s BITS BY %s BYTES' % (self.currentBitsize, padding))
+ warn('AUTO PADDING AT %s BITS BY %s BYTES' % (self.currentBitsize, padding))
field = self.dumper.Field(self.dumper)
field.code = None
#field.lbitpos = self.currentBitsize
@@ -3676,7 +3753,7 @@ class DumperBase:
else:
typeName += c
elif c == 'p': # Pointer as int
- builder.addField(ptrSize, 'Q' if ptrSize == 8 else 'I', fieldAlign = ptrSize)
+ builder.addField(ptrSize, self.ptrCode(), fieldAlign = ptrSize)
elif c == 'P': # Pointer as Value
builder.addField(ptrSize, '%ss' % ptrSize, fieldAlign = ptrSize)
elif c in ('d'):
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py
index 6e973bc86f..9877c54c29 100644
--- a/share/qtcreator/debugger/gdbbridge.py
+++ b/share/qtcreator/debugger/gdbbridge.py
@@ -48,13 +48,13 @@ def safePrint(output):
try:
print(output)
except:
- out = ""
+ out = ''
for c in output:
cc = ord(c)
if cc > 127:
- out += "\\\\%d" % cc
+ out += '\\\\%d' % cc
elif cc < 0:
- out += "\\\\%d" % (cc + 256)
+ out += '\\\\%d' % (cc + 256)
else:
out += c
print(out)
@@ -80,7 +80,7 @@ def registerCommand(name, func):
# Just convienience for 'python print ...'
class PPCommand(gdb.Command):
def __init__(self):
- super(PPCommand, self).__init__("pp", gdb.COMMAND_OBSCURE)
+ super(PPCommand, self).__init__('pp', gdb.COMMAND_OBSCURE)
def invoke(self, args, from_tty):
print(eval(args))
@@ -89,7 +89,7 @@ PPCommand()
# Just convienience for 'python print gdb.parse_and_eval(...)'
class PPPCommand(gdb.Command):
def __init__(self):
- super(PPPCommand, self).__init__("ppp", gdb.COMMAND_OBSCURE)
+ super(PPPCommand, self).__init__('ppp', gdb.COMMAND_OBSCURE)
def invoke(self, args, from_tty):
print(gdb.parse_and_eval(args))
@@ -100,20 +100,20 @@ def scanStack(p, n):
p = int(p)
r = []
for i in xrange(n):
- f = gdb.parse_and_eval("{void*}%s" % p)
- m = gdb.execute("info symbol %s" % f, to_string=True)
- if not m.startswith("No symbol matches"):
+ f = gdb.parse_and_eval('{void*}%s' % p)
+ m = gdb.execute('info symbol %s' % f, to_string=True)
+ if not m.startswith('No symbol matches'):
r.append(m)
p += f.type.sizeof
return r
class ScanStackCommand(gdb.Command):
def __init__(self):
- super(ScanStackCommand, self).__init__("scanStack", gdb.COMMAND_OBSCURE)
+ super(ScanStackCommand, self).__init__('scanStack', gdb.COMMAND_OBSCURE)
def invoke(self, args, from_tty):
if len(args) == 0:
args = 20
- safePrint(scanStack(gdb.parse_and_eval("$sp"), int(args)))
+ safePrint(scanStack(gdb.parse_and_eval('$sp'), int(args)))
ScanStackCommand()
@@ -134,7 +134,7 @@ class PlainDumper:
printer = self.printer.gen_printer(value)
except:
printer = self.printer.invoke(value)
- lister = getattr(printer, "children", None)
+ lister = getattr(printer, 'children', None)
children = [] if lister is None else list(lister())
d.putType(self.printer.name)
val = printer.to_string()
@@ -152,16 +152,16 @@ class PlainDumper:
d.putSubItem(child[0], child[1])
def importPlainDumpers(args):
- if args == "off":
+ if args == 'off':
try:
- gdb.execute("disable pretty-printer .* .*")
+ gdb.execute('disable pretty-printer .* .*')
except:
# Might occur in non-ASCII directories
- warn("COULD NOT DISABLE PRETTY PRINTERS")
+ warn('COULD NOT DISABLE PRETTY PRINTERS')
else:
theDumper.importPlainDumpers()
-registerCommand("importPlainDumpers", importPlainDumpers)
+registerCommand('importPlainDumpers', importPlainDumpers)
@@ -175,7 +175,7 @@ class OutputSafer:
def __exit__(self, exType, exValue, exTraceBack):
if self.d.passExceptions and not exType is None:
- showException("OUTPUTSAFER", exType, exValue, exTraceBack)
+ showException('OUTPUTSAFER', exType, exValue, exTraceBack)
self.d.output = self.savedOutput
else:
self.savedOutput.extend(self.d.output)
@@ -206,43 +206,47 @@ class Dumper(DumperBase):
self.setVariableFetchingOptions(args)
def fromFrameValue(self, nativeValue):
+ #warn('FROM FRAME VALUE: %s' % nativeValue.address)
val = nativeValue
- if self.useDynamicType:
- try:
- val = nativeValue.cast(nativeValue.dynamic_type)
- except:
- pass
+ try:
+ val = nativeValue.cast(nativeValue.dynamic_type)
+ except:
+ pass
return self.fromNativeValue(val)
def fromNativeValue(self, nativeValue):
- #warn("FROM NATIVE VALUE: %s" % nativeValue)
+ #warn('FROM NATIVE VALUE: %s' % nativeValue)
self.check(isinstance(nativeValue, gdb.Value))
nativeType = nativeValue.type
code = nativeType.code
if code == gdb.TYPE_CODE_REF:
- targetType = self.fromNativeType(nativeType.target().unqualified())
+ targetType = self.fromNativeType(nativeType.target().unqualified(), nativeValue)
val = self.createReferenceValue(toInteger(nativeValue.address), targetType)
- #warn("CREATED REF: %s" % val)
+ #warn('CREATED REF: %s' % val)
return val
if code == gdb.TYPE_CODE_PTR:
- targetType = self.fromNativeType(nativeType.target().unqualified())
+ try:
+ nativeTargetValue = nativeValue.dereference()
+ except:
+ nativeTargetValue = None
+ targetType = self.fromNativeType(nativeType.target().unqualified(), nativeTargetValue)
val = self.createPointerValue(toInteger(nativeValue), targetType)
- #warn("CREATED PTR 1: %s" % val)
+ #warn('CREATED PTR 1: %s' % val)
if not nativeValue.address is None:
val.laddress = toInteger(nativeValue.address)
- #warn("CREATED PTR 2: %s" % val)
+ #warn('CREATED PTR 2: %s' % val)
return val
if code == gdb.TYPE_CODE_TYPEDEF:
targetType = nativeType.strip_typedefs().unqualified()
- #warn("TARGET TYPE: %s" % targetType)
+ #warn('TARGET TYPE: %s' % targetType)
if targetType.code == gdb.TYPE_CODE_ARRAY:
val = self.Value(self)
val.laddress = toInteger(nativeValue.address)
else:
# Cast may fail (e.g for arrays, see test for Bug5799)
val = self.fromNativeValue(nativeValue.cast(targetType))
- val.type = self.fromNativeType(nativeType)
- #warn("CREATED TYPEDEF: %s" % val)
+ val.type = self.fromNativeType(nativeType, nativeValue)
+ #warn('CREATED TYPEDEF: %s' % val)
return val
val = self.Value(self)
@@ -250,14 +254,14 @@ class Dumper(DumperBase):
val.laddress = toInteger(nativeValue.address)
else:
size = nativeType.sizeof
- chars = self.lookupNativeType("unsigned char")
+ chars = self.lookupNativeType('unsigned char')
y = nativeValue.cast(chars.array(0, int(nativeType.sizeof - 1)))
buf = bytearray(struct.pack('x' * size))
for i in range(size):
buf[i] = int(y[i])
val.ldata = bytes(buf)
- val.type = self.fromNativeType(nativeType)
+ val.type = self.fromNativeType(nativeType, nativeValue)
val.lIsInScope = not nativeValue.is_optimized_out
code = nativeType.code
if code == gdb.TYPE_CODE_ENUM:
@@ -276,15 +280,17 @@ class Dumper(DumperBase):
self.ptrSize = lambda: result
return result
- def fromNativeType(self, nativeType):
+ def fromNativeType(self, nativeType, nativeValue = None):
self.check(isinstance(nativeType, gdb.Type))
code = nativeType.code
#warn('FROM NATIVE TYPE: %s' % nativeType)
- #nativeType = nativeType.unqualified()
+ nativeType = nativeType.unqualified()
if code == gdb.TYPE_CODE_PTR:
#warn('PTR')
- targetType = self.fromNativeType(nativeType.target().unqualified())
+ if nativeValue is not None:
+ nativeValue = nativeValue.dereference()
+ targetType = self.fromNativeType(nativeType.target().unqualified(), nativeValue)
return self.createPointerType(targetType)
if code == gdb.TYPE_CODE_REF:
@@ -344,8 +350,7 @@ class Dumper(DumperBase):
if tdata.code == TypeCodeStruct:
tdata.lalignment = lambda : \
self.nativeStructAlignment(nativeType)
- tdata.lfields = lambda value : \
- self.listMembers(nativeType, value)
+ tdata.lfields = self.listMembers(nativeType, nativeValue)
#tdata.lfieldByName = lambda name : \
# self.nativeTypeFieldTypeByName(nativeType, name)
tdata.templateArguments = self.listTemplateParameters(nativeType)
@@ -394,82 +399,182 @@ class Dumper(DumperBase):
return typeId
def nativeStructAlignment(self, nativeType):
- #warn("NATIVE ALIGN FOR %s" % nativeType.name)
+ self.preping('align ' + str(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)
+ self.ping('align ' + str(nativeType))
return align
- def listMembers(self, nativeType, value):
- if not nativeType.code in (gdb.TYPE_CODE_STRUCT, gdb.TYPE_CODE_UNION):
- return
- if value.laddress == 0:
- warn("CANNOT LIST MEMBERS OF NULL VALUE OF %s" % nativeType)
- return
- if value.laddress is None:
- # FIXME: Happens e.g. for QVariant(QBitArray)
- addr = self.pokeValue(value) # FIXME: Far too expensive.
+ #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.
+ # pass
+
+ #yield value.extractField(field)
+
+ def fromNativeField(self, nativeField):
+ field = self.Field(self)
+ field.name = nativeField.name
+ field.isBaseClass = nativeField.is_base_class
+ # Something without a name.
+ # Anonymous union? We need a dummy name to distinguish
+ # multiple anonymous unions in the struct.
+ # Since GDB commit b5b08fb4 anonymous structs get also reported
+ # with a 'None' name.
+ if field.name is not None and len(field.name) == 0:
+ field.name = None
+ nativeFieldType = nativeField.type.unqualified()
+
+ if hasattr(nativeField, 'bitpos'):
+ field.lbitpos = nativeField.bitpos
+
+ if hasattr(nativeField, 'bitsize') and nativeField.bitsize != 0:
+ field.lbitsize = nativeField.bitsize
else:
- addr = value.laddress
- nativeTypePointer = nativeType.unqualified().pointer()
- nativeValue = gdb.Value(addr).cast(nativeTypePointer).dereference()
+ field.lbitsize = 8 * nativeFieldType.sizeof
+
+ if field.lbitsize != nativeFieldType.sizeof * 8:
+ field.ltype = self.createBitfieldType(str(nativeFieldType), field.lbitsize)
+ else:
+ field.ltype = self.fromNativeType(nativeFieldType)
+ return field
+
+ def memberFromField(self, nativeValue, nativeField):
+ if nativeField.is_base_class:
+ return nativeValue.cast(nativeField.type)
+ try:
+ return nativeValue[nativeField]
+ except:
+ pass
+ try:
+ return nativeValue[nativeField.name]
+ except:
+ pass
+ return None
- baseIndex = 0
- anonNumber = 0
- #warn('FIELDS FOR %s' % nativeType)
+ def listMembers(self, nativeType, nativeValue):
+ #warn('LISTING MEMBERS OF %s' % nativeType)
+ try:
+ nativeValueAddress = toInteger(nativeValue.address)
+ except:
+ nativeValueAddress = None
+
+ if nativeValue is None or nativeValueAddress is None:
+ return lambda value : self.listDelayedMembers(nativeType, value)
+
+ def needsDeep(someNativeType):
+ if someNativeType.sizeof >= ptrSize:
+ for nativeField in someNativeType.fields():
+ if nativeField.is_base_class:
+ if nativeField.bitpos < 0 or needsDeep(nativeField.type):
+ return True
+ return False
+
+ ptrSize = self.ptrSize()
+ if needsDeep(nativeType):
+ return self.listDeepMembers(nativeType, nativeValue, nativeValueAddress)
+
+ return self.listSimpleMembers(nativeType, nativeValue, nativeValueAddress)
+
+ def listSimpleMembers(self, nativeType, nativeValue, nativeValueAddress):
+ #warn('SIMPLE FIELDS FOR %s' % nativeType)
+ fields = []
for nativeField in nativeType.fields():
- #warn('FIELD: %s' % nativeField)
+ nativeFieldType = nativeField.type.unqualified()
+ #warn('SIMPLE FIELD: %s' % nativeField.name)
#warn(' BITSIZE: %s' % nativeField.bitsize)
+ #warn(' NAME: %s' % nativeField.name)
+ #warn(' TYPE: %s' % nativeFieldType)
+ #warn(' TYPEID: %s' % self.nativeTypeId(nativeFieldType))
+ field = self.fromNativeField(nativeField)
+ if field.ltype.code != TypeCodeBitfield:
+ nativeMember = self.memberFromField(nativeValue, nativeField)
+ if nativeMember is None:
+ warn('CANNOT EXTRACT FIELD %s FROM %s' % (nativeField.name, nativeValue))
+ #continue
+ if nativeMember.address is None: # Could be a static member.
+ warn('NO ADDRESS OF %s' % nativeMember)
+ continue
+ nativeMemberAddress = toInteger(nativeMember.address)
+ offset = nativeMemberAddress - nativeValueAddress
+ field.lbitpos = 8 * offset
+ fields.append(field)
+ return fields
+
+ def listDelayedMembers(self, nativeType, value):
+ #warn('DELAYED FIELDS FOR %s' % nativeType)
+ if value.laddress is None:
+ error('No address for object of type %s' % nativeType)
+ nativeTypePointer = nativeType.unqualified().pointer()
+ nativeValue = gdb.Value(value.laddress).cast(nativeTypePointer).dereference()
+ return self.listSimpleMembers(nativeType, nativeValue, value.laddress)
+
+ # The is expensive as it recurses through all base classes. Ideally this
+ # should only be used if virtual inheritance is known to be involved.
+ def listDeepMembers(self, nativeType, nativeValue, nativeBaseAddress, bpbase = 0):
+ #warn('DEEP FIELDS FOR %s AT 0x%x' % (nativeType, nativeBaseAddress))
+ fields = []
+ for nativeField in nativeType.fields():
+ nativeFieldType = nativeField.type.unqualified()
+ #warn('DEEP FIELD: %s' % nativeField.name)
+ #warn(' SIZE: %s' % nativeField.bitsize)
+ #warn(' POS: %s' % nativeField.bitpos)
+ #warn(' BPBASE: %s' % bpbase)
#warn(' ARTIFICIAL: %s' % nativeField.artificial)
#warn(' NAME: %s' % nativeField.name)
- #warn(' TYPE: %s' % nativeField.type)
- #warn(' TYPEID: %s' % self.nativeTypeId(nativeField.type))
- val = nativeValue[nativeField]
- #warn('VAL: %s' % val)
- try:
- # Remove 'const', fails for 'const bool' members in some containers.
- val = val.cast(nativeField.type.unqualified())
- except:
- pass
- try:
- member = self.fromNativeValue(val)
- except:
- #warn('CANNOT CREATE FIELD: %s' % nativeField.name)
- continue
+ #warn(' TYPE: %s' % nativeFieldType)
+ #warn(' TYPEID: %s' % self.nativeTypeId(nativeFieldType))
+ nativeMember = self.memberFromField(nativeValue, nativeField)
if nativeField.is_base_class:
- member.isBaseClass = True
- member.baseIndex = baseIndex
- baseIndex += 1
- member.name = nativeField.name
+ #warn(' THIS IS VIRTUAL BASE OF TYPE %s' % nativeField.type)
+ # This is a virtual base, we need to recurse *now*, as later
+ # there is no way to generate a nativeValue with this type.
+ #warn(' NATIVE MEMBER: %s' % nativeMember)
+ pureFieldType = self.fromNativeType(nativeFieldType)
+ fieldTypeId = pureFieldType.typeId + ' in ' + str(nativeType)
+ fieldTypeData = pureFieldType.typeData().copy()
+ bp = - nativeField.bitpos
+ fieldTypeData.lfields = self.listDeepMembers(
+ nativeField.type, nativeMember, nativeBaseAddress, bpbase + bp - 64)
+ self.registerType(fieldTypeId, fieldTypeData)
+
+ field = self.Field(self)
+ field.name = nativeField.name
+ #field.name = fieldTypeId
+ field.ltype = self.Type(self, fieldTypeId)
+ field.isBaseClass = True
+ field.isArtificial = True
+ field.lbitsize = None
+ field.lbitpos = None
+
+ fields.append(field)
else:
- if nativeField.name is None or len(nativeField.name) == 0:
- # Something without a name.
- # Anonymous union? We need a dummy name to distinguish
- # multiple anonymous unions in the struct.
- anonNumber += 1
- member.name = '#%s' % anonNumber
- else:
- # Normal named member.
- member.name = nativeField.name
- if hasattr(nativeField, 'bitpos'):
- member.lbitpos = nativeField.bitpos
- # Correction for some bitfields. Size 0 can occur for
- # types without debug information.
- bitsize = 8 * nativeField.type.sizeof
- if bitsize > 0:
- member.lbitpos = nativeField.bitpos % bitsize
- if hasattr(nativeField, 'bitsize') and nativeField.bitsize != 0:
- member.lbitsize = nativeField.bitsize
- else:
- member.lbitsize = 8 * nativeField.type.sizeof
- #warn('MEMBER: %s' % member)
- yield member
- if value.laddress is None:
- self.releaseValue(addr)
+ # This is a normal field or non-virtual base.
+ field = self.fromNativeField(nativeField)
+ if field.ltype.code != TypeCodeBitfield:
+ #if field.lbitpos is None:
+ try:
+ nativeMemberAddress = toInteger(nativeMember.address)
+ #warn(' NATIVE MEMBER ADDRESS: 0x%x' % nativeMemberAddress)
+ offset = nativeMemberAddress - nativeBaseAddress
+ #offset = bpbase + nativeField.bitpos
+ #warn('DEEP OFFSET: %s POS: %s' % (offset // 8, field.lbitpos // 8))
+ field.lbitpos = offset * 8
+ except:
+ field.lbitpos = None
+ field.lvalue = 'XXX'
+ #else:
+ # warn('REUSING BITPOS %s FOR %s' % (field.lbitpos, field.name))
+ fields.append(field)
+ return fields
+
def listLocals(self, partialVar):
frame = gdb.selected_frame()
@@ -496,34 +601,36 @@ class Dumper(DumperBase):
if symbol.is_variable or symbol.is_argument:
name = symbol.print_name
- if name == "__in_chrg" or name == "__PRETTY_FUNCTION__":
+ if name in ('__in_chrg', '__PRETTY_FUNCTION__'):
continue
if not partialVar is None and partialVar != name:
continue
- # "NotImplementedError: Symbol type not yet supported in
- # Python scripts."
- #warn("SYMBOL %s (%s, %s)): " % (symbol, name, symbol.name))
- if False and self.passExceptions:
- value = self.fromFrameValue(frame.read_var(name, block))
+ # 'NotImplementedError: Symbol type not yet supported in
+ # Python scripts.'
+ #warn('SYMBOL %s (%s, %s)): ' % (symbol, name, symbol.name))
+ if self.passExceptions and not self.isTesting:
+ nativeValue = frame.read_var(name, block)
+ value = self.fromFrameValue(nativeValue)
value.name = name
- #warn("READ 1: %s" % value.stringify())
+ #warn('READ 0: %s' % value.stringify())
items.append(value)
continue
try:
# Same as above, but for production.
- value = self.fromFrameValue(frame.read_var(name, block))
+ nativeValue = frame.read_var(name, block)
+ value = self.fromFrameValue(nativeValue)
value.name = name
- #warn("READ 1: %s" % value.stringify())
+ #warn('READ 1: %s' % value.stringify())
items.append(value)
continue
except:
pass
try:
- #warn("READ 2: %s" % item.value)
+ #warn('READ 2: %s' % item.value)
value = self.fromFrameValue(frame.read_var(name))
value.name = name
items.append(value)
@@ -537,15 +644,15 @@ class Dumper(DumperBase):
pass
try:
- #warn("READ 3: %s %s" % (name, item.value))
- #warn("ITEM 3: %s" % item.value)
+ #warn('READ 3: %s %s' % (name, item.value))
+ #warn('ITEM 3: %s' % item.value)
value = self.fromFrameValue(gdb.parse_and_eval(name))
value.name = name
items.append(value)
except:
# Can happen in inlined code (see last line of
- # RowPainter::paintChars(): "RuntimeError:
- # No symbol \"__val\" in current context.\n"
+ # RowPainter::paintChars(): 'RuntimeError:
+ # No symbol '__val' in current context.\n'
pass
# The outermost block in a function has the function member
@@ -567,6 +674,11 @@ class Dumper(DumperBase):
self.resetStats()
self.prepare(args)
+ self.preping('endian')
+ self.isBigEndian = gdb.execute('show endian', to_string = True).find('big endian') > 0
+ self.ping('endian')
+ self.packCode = '>' if self.isBigEndian else '<'
+
(ok, res) = self.tryFetchInterpreterVariables(args)
if ok:
safePrint(res)
@@ -574,18 +686,19 @@ class Dumper(DumperBase):
self.output.append('data=[')
- partialVar = args.get("partialvar", "")
+ partialVar = args.get('partialvar', '')
isPartial = len(partialVar) > 0
partialName = partialVar.split('.')[1].split('@')[0] if isPartial else None
variables = self.listLocals(partialName)
+ #warn('VARIABLES: %s' % variables)
# Take care of the return value of the last function call.
if len(self.resultVarName) > 0:
try:
value = self.parseAndEvaluate(self.resultVarName)
value.name = self.resultVarName
- value.iname = "return." + self.resultVarName
+ value.iname = 'return.' + self.resultVarName
variables.append(value)
except:
# Don't bother. It's only supplementary information anyway.
@@ -612,14 +725,15 @@ class Dumper(DumperBase):
self.qtNamespaceToReport = None
self.output.append(',partial="%d"' % isPartial)
+ self.output.append(',counts=%s' % self.counts)
+ self.output.append(',timimgs=%s' % self.timings)
- self.preping('safePrint')
+ tt = time.time()
safePrint(''.join(self.output))
- self.ping('safePrint')
- safePrint('"%s"' % str(self.dumpStats()))
+ print(',time="%d"' % int(1000 * (tt - time.time())))
def parseAndEvaluate(self, exp):
- #warn("EVALUATE '%s'" % exp)
+ #warn('EVALUATE "%s"' % exp)
try:
val = gdb.parse_and_eval(exp)
except RuntimeError as error:
@@ -630,7 +744,7 @@ class Dumper(DumperBase):
def callHelper(self, rettype, value, function, args):
# args is a tuple.
- arg = ""
+ arg = ''
for i in range(len(args)):
if i:
arg += ','
@@ -640,41 +754,38 @@ class Dumper(DumperBase):
else:
arg += a
- #warn("CALL: %s -> %s(%s)" % (value, function, arg))
+ #warn('CALL: %s -> %s(%s)' % (value, function, arg))
typeName = value.type.name
- if typeName.find(":") >= 0:
+ if typeName.find(':') >= 0:
typeName = "'" + typeName + "'"
# 'class' is needed, see http://sourceware.org/bugzilla/show_bug.cgi?id=11912
- #exp = "((class %s*)%s)->%s(%s)" % (typeName, value.laddress, function, arg)
+ #exp = '((class %s*)%s)->%s(%s)' % (typeName, value.laddress, function, arg)
addr = value.laddress
if addr is None:
addr = self.pokeValue(value)
- #warn("PTR: %s -> %s(%s)" % (value, function, addr))
- exp = "((%s*)0x%x)->%s(%s)" % (typeName, addr, function, arg)
- #warn("CALL: %s" % exp)
+ #warn('PTR: %s -> %s(%s)' % (value, function, addr))
+ exp = '((%s*)0x%x)->%s(%s)' % (typeName, addr, function, arg)
+ #warn('CALL: %s' % exp)
result = gdb.parse_and_eval(exp)
- warn(" -> %s" % result)
+ #warn(' -> %s' % result)
res = self.fromNativeValue(result)
if value.laddress is None:
self.releaseValue(addr)
return res
def makeExpression(self, value):
- typename = "::" + value.type.name
- #warn(" TYPE: %s" % typename)
- exp = "(*(%s*)(0x%x))" % (typename, value.address())
- #warn(" EXP: %s" % exp)
+ typename = '::' + value.type.name
+ #warn(' TYPE: %s' % typename)
+ exp = '(*(%s*)(0x%x))' % (typename, value.address())
+ #warn(' EXP: %s' % exp)
return exp
def makeStdString(init):
# Works only for small allocators, but they are usually empty.
- gdb.execute("set $d=(std::string*)calloc(sizeof(std::string), 2)");
- gdb.execute("call($d->basic_string(\"" + init +
- "\",*(std::allocator<char>*)(1+$d)))")
- value = gdb.parse_and_eval("$d").dereference()
- #warn(" TYPE: %s" % value.type)
- #warn(" ADDR: %s" % value.address)
- #warn(" VALUE: %s" % value)
+ gdb.execute('set $d=(std::string*)calloc(sizeof(std::string), 2)');
+ gdb.execute('call($d->basic_string("' + init +
+ '",*(std::allocator<char>*)(1+$d)))')
+ value = gdb.parse_and_eval('$d').dereference()
return value
def pokeValue(self, value):
@@ -684,24 +795,24 @@ class Dumper(DumperBase):
size = value.type.size()
data = value.data()
h = self.hexencode(data)
- #warn("DATA: %s" % h
- string = ''.join("\\x" + h[2*i:2*i+2] for i in range(size))
+ #warn('DATA: %s' % h)
+ string = ''.join('\\x' + h[2*i:2*i+2] for i in range(size))
exp = '(%s*)memcpy(calloc(%d, 1), "%s", %d)' \
% (value.type.name, size, string, size)
- #warn("EXP: %s" % exp)
+ #warn('EXP: %s' % exp)
res = gdb.parse_and_eval(exp)
- #warn("RES: %s" % res)
+ #warn('RES: %s' % res)
return toInteger(res)
def releaseValue(self, address):
gdb.parse_and_eval('free(0x%x)' % address)
def setValue(self, address, typename, value):
- cmd = "set {%s}%s=%s" % (typename, address, value)
+ cmd = 'set {%s}%s=%s' % (typename, address, value)
gdb.execute(cmd)
def setValues(self, address, typename, values):
- cmd = "set {%s[%s]}%s={%s}" \
+ cmd = 'set {%s[%s]}%s={%s}' \
% (typename, len(values), address, ','.join(map(str, values)))
gdb.execute(cmd)
@@ -718,10 +829,16 @@ class Dumper(DumperBase):
return self.cachedInferior
def readRawMemory(self, address, size):
- return self.selectedInferior().read_memory(address, size)
+ #warn('READ: %s FROM 0x%x' % (size, address))
+ if address == 0 or size == 0:
+ return bytes()
+ self.preping('readMem')
+ res = self.selectedInferior().read_memory(address, size)
+ self.ping('readMem')
+ return res
def findStaticMetaObject(self, typename):
- symbolName = typename + "::staticMetaObject"
+ symbolName = typename + '::staticMetaObject'
symbol = gdb.lookup_global_symbol(symbolName, gdb.SYMBOL_VAR_DOMAIN)
if not symbol:
return 0
@@ -758,7 +875,7 @@ class Dumper(DumperBase):
def qtVersionString(self):
try:
- return str(gdb.lookup_symbol("qVersion")[0].value()())
+ return str(gdb.lookup_symbol('qVersion')[0].value()())
except:
pass
try:
@@ -771,7 +888,7 @@ class Dumper(DumperBase):
def qtVersion(self):
try:
# Only available with Qt 5.3+
- qtversion = int(str(gdb.parse_and_eval("((void**)&qtHookData)[2]")), 16)
+ qtversion = int(str(gdb.parse_and_eval('((void**)&qtHookData)[2]')), 16)
self.qtVersion = lambda: qtversion
return qtversion
except:
@@ -787,21 +904,6 @@ class Dumper(DumperBase):
# Use fallback until we have a better answer.
return self.fallbackQtVersion
- def isQt3Support(self):
- if self.qtVersion() >= 0x050000:
- return False
- else:
- try:
- # This will fail on Qt 4 without Qt 3 support
- gdb.execute("ptype QChar::null", to_string=True)
- self.cachedIsQt3Suport = True
- except:
- self.cachedIsQt3Suport = False
-
- # Memoize good results.
- self.isQt3Support = lambda: self.cachedIsQt3Suport
- return self.cachedIsQt3Suport
-
def createSpecialBreakpoints(self, args):
self.specialBreakpoints = []
def newSpecial(spec):
@@ -818,24 +920,24 @@ class Dumper(DumperBase):
# FIXME: ns is accessed too early. gdb.Breakpoint() has no
# 'rbreak' replacement, and breakpoints created with
- # 'gdb.execute("rbreak...") cannot be made invisible.
+ # 'gdb.execute('rbreak...') cannot be made invisible.
# So let's ignore the existing of namespaced builds for this
# fringe feature here for now.
ns = self.qtNamespace()
if args.get('breakonabort', 0):
- self.specialBreakpoints.append(newSpecial("abort"))
+ self.specialBreakpoints.append(newSpecial('abort'))
if args.get('breakonwarning', 0):
- self.specialBreakpoints.append(newSpecial(ns + "qWarning"))
- self.specialBreakpoints.append(newSpecial(ns + "QMessageLogger::warning"))
+ self.specialBreakpoints.append(newSpecial(ns + 'qWarning'))
+ self.specialBreakpoints.append(newSpecial(ns + 'QMessageLogger::warning'))
if args.get('breakonfatal', 0):
- self.specialBreakpoints.append(newSpecial(ns + "qFatal"))
- self.specialBreakpoints.append(newSpecial(ns + "QMessageLogger::fatal"))
+ self.specialBreakpoints.append(newSpecial(ns + 'qFatal'))
+ self.specialBreakpoints.append(newSpecial(ns + 'QMessageLogger::fatal'))
#def threadname(self, maximalStackDepth, objectPrivateType):
# e = gdb.selected_frame()
- # out = ""
+ # out = ''
# ns = self.qtNamespace()
# while True:
# maximalStackDepth -= 1
@@ -844,17 +946,16 @@ class Dumper(DumperBase):
# e = e.older()
# if e == None or e.name() == None:
# break
- # if e.name() == ns + "QThreadPrivate::start" \
- # or e.name() == "_ZN14QThreadPrivate5startEPv@4":
+ # if e.name() in (ns + 'QThreadPrivate::start', '_ZN14QThreadPrivate5startEPv@4'):
# try:
- # thrptr = e.read_var("thr").dereference()
- # d_ptr = thrptr["d_ptr"]["d"].cast(objectPrivateType).dereference()
+ # thrptr = e.read_var('thr').dereference()
+ # d_ptr = thrptr['d_ptr']['d'].cast(objectPrivateType).dereference()
# try:
- # objectName = d_ptr["objectName"]
+ # objectName = d_ptr['objectName']
# except: # Qt 5
- # p = d_ptr["extraData"]
+ # p = d_ptr['extraData']
# if not self.isNull(p):
- # objectName = p.dereference()["objectName"]
+ # objectName = p.dereference()['objectName']
# if not objectName is None:
# (data, size, alloc) = self.stringData(objectName)
# if size > 0:
@@ -881,7 +982,7 @@ class Dumper(DumperBase):
#oldthread = gdb.selected_thread()
#if oldthread:
# try:
- # objectPrivateType = gdb.lookup_type(ns + "QObjectPrivate").pointer()
+ # objectPrivateType = gdb.lookup_type(ns + 'QObjectPrivate').pointer()
# inferior = self.selectedInferior()
# for thread in inferior.threads():
# thread.switch()
@@ -893,9 +994,9 @@ class Dumper(DumperBase):
def importPlainDumper(self, printer):
- name = printer.name.replace("::", "__")
+ name = printer.name.replace('::', '__')
self.qqDumpers[name] = PlainDumper(printer)
- self.qqFormats[name] = ""
+ self.qqFormats[name] = ''
def importPlainDumpers(self):
for obj in gdb.objfiles():
@@ -904,12 +1005,18 @@ class Dumper(DumperBase):
self.importPlainDumper(printer)
def qtNamespace(self):
+ self.preping('qtNamespace')
+ res = self.qtNamespaceX()
+ self.ping('qtNamespace')
+ return res
+
+ def qtNamespaceX(self):
if not self.currentQtNamespaceGuess is None:
return self.currentQtNamespaceGuess
# This only works when called from a valid frame.
try:
- cand = "QArrayData::shared_null"
+ cand = 'QArrayData::shared_null'
symbol = gdb.lookup_symbol(cand)[0]
if symbol:
ns = symbol.name[:-len(cand)]
@@ -921,7 +1028,7 @@ class Dumper(DumperBase):
try:
# This is Qt, but not 5.x.
- cand = "QByteArray::shared_null"
+ cand = 'QByteArray::shared_null'
symbol = gdb.lookup_symbol(cand)[0]
if symbol:
ns = symbol.name[:-len(cand)]
@@ -932,28 +1039,8 @@ class Dumper(DumperBase):
except:
pass
- try:
- # Last fall backs.
- s = gdb.execute("ptype QByteArray", to_string=True)
- if s.find("QMemArray") >= 0:
- # Qt 3.
- self.qtNamespaceToReport = ""
- self.qtNamespace = lambda: ""
- self.qtVersion = lambda: 0x30308
- self.fallbackQtVersion = 0x30308
- return ""
- # Seemingly needed with Debian's GDB 7.4.1
- pos1 = s.find("class")
- pos2 = s.find("QByteArray")
- if pos1 > -1 and pos2 > -1:
- ns = s[s.find("class") + 6:s.find("QByteArray")]
- self.qtNamespaceToReport = ns
- self.qtNamespace = lambda: ns
- return ns
- except:
- pass
- self.currentQtNamespaceGuess = ""
- return ""
+ self.currentQtNamespaceGuess = ''
+ return ''
def assignValue(self, args):
typeName = self.hexdecode(args['type'])
@@ -963,7 +1050,7 @@ class Dumper(DumperBase):
ns = self.qtNamespace()
if typeName.startswith(ns):
typeName = typeName[len(ns):]
- typeName = typeName.replace("::", "__")
+ typeName = typeName.replace('::', '__')
pos = typeName.find('<')
if pos != -1:
typeName = typeName[0:pos]
@@ -972,25 +1059,42 @@ class Dumper(DumperBase):
expr = gdb.parse_and_eval(expr)
self.qqEditable[typeName](self, expr, value)
else:
- cmd = "set variable (%s)=%s" % (expr, value)
+ cmd = 'set variable (%s)=%s' % (expr, value)
gdb.execute(cmd)
def nativeDynamicTypeName(self, address, baseType):
- try:
- vtbl = gdb.execute("info symbol {%s*}0x%x" % (baseType.name, address), to_string = True)
- except:
+ # Needed for Gdb13393 test.
+ nativeType = self.lookupNativeType(baseType.name)
+ if nativeType is None:
return None
- pos1 = vtbl.find("vtable ")
- if pos1 == -1:
- return None
- pos1 += 11
- pos2 = vtbl.find(" +", pos1)
- if pos2 == -1:
- return None
- return vtbl[pos1 : pos2]
+ nativeTypePointer = nativeType.pointer()
+ nativeValue = gdb.Value(address).cast(nativeTypePointer).dereference()
+ val = nativeValue.cast(nativeValue.dynamic_type)
+ return str(val.type)
+ #try:
+ # vtbl = gdb.execute('info symbol {%s*}0x%x' % (baseType.name, address), to_string = True)
+ #except:
+ # return None
+ #pos1 = vtbl.find('vtable ')
+ #if pos1 == -1:
+ # return None
+ #pos1 += 11
+ #pos2 = vtbl.find(' +', pos1)
+ #if pos2 == -1:
+ # return None
+ #return vtbl[pos1 : pos2]
+
+ def nativeDynamicType(self, address, baseType):
+ # Needed for Gdb13393 test.
+ nativeType = self.lookupNativeType(baseType.name)
+ if nativeType is None:
+ return baseType
+ nativeTypePointer = nativeType.pointer()
+ nativeValue = gdb.Value(address).cast(nativeTypePointer).dereference()
+ return self.fromNativeType(nativeValue.dynamic_type)
def enumExpression(self, enumType, enumValue):
- return self.qtNamespace() + "Qt::" + enumValue
+ return self.qtNamespace() + 'Qt::' + enumValue
def lookupNativeType(self, typeName):
nativeType = self.lookupNativeTypeHelper(typeName)
@@ -1000,18 +1104,18 @@ class Dumper(DumperBase):
def lookupNativeTypeHelper(self, typeName):
typeobj = self.typeCache.get(typeName)
- #warn("LOOKUP 1: %s -> %s" % (typeName, typeobj))
+ #warn('LOOKUP 1: %s -> %s' % (typeName, typeobj))
if not typeobj is None:
return typeobj
- if typeName == "void":
+ if typeName == 'void':
typeobj = gdb.lookup_type(typeName)
self.typeCache[typeName] = typeobj
self.typesToReport[typeName] = typeobj
return typeobj
#try:
- # typeobj = gdb.parse_and_eval("{%s}&main" % typeName).typeobj
+ # typeobj = gdb.parse_and_eval('{%s}&main' % typeName).typeobj
# if not typeobj is None:
# self.typeCache[typeName] = typeobj
# self.typesToReport[typeName] = typeobj
@@ -1020,12 +1124,12 @@ class Dumper(DumperBase):
# pass
# See http://sourceware.org/bugzilla/show_bug.cgi?id=13269
- # gcc produces "{anonymous}", gdb "(anonymous namespace)"
- # "<unnamed>" has been seen too. The only thing gdb
- # understands when reading things back is "(anonymous namespace)"
- if typeName.find("{anonymous}") != -1:
+ # gcc produces '{anonymous}', gdb '(anonymous namespace)'
+ # '<unnamed>' has been seen too. The only thing gdb
+ # understands when reading things back is '(anonymous namespace)'
+ if typeName.find('{anonymous}') != -1:
ts = typeName
- ts = ts.replace("{anonymous}", "(anonymous namespace)")
+ ts = ts.replace('{anonymous}', '(anonymous namespace)')
typeobj = self.lookupNativeType(ts)
if not typeobj is None:
self.typeCache[typeName] = typeobj
@@ -1040,24 +1144,23 @@ class Dumper(DumperBase):
ts = typeName
while True:
- #warn("TS: '%s'" % ts)
- if ts.startswith("class "):
+ if ts.startswith('class '):
ts = ts[6:]
- elif ts.startswith("struct "):
+ elif ts.startswith('struct '):
ts = ts[7:]
- elif ts.startswith("const "):
+ elif ts.startswith('const '):
ts = ts[6:]
- elif ts.startswith("volatile "):
+ elif ts.startswith('volatile '):
ts = ts[9:]
- elif ts.startswith("enum "):
+ elif ts.startswith('enum '):
ts = ts[5:]
- elif ts.endswith(" const"):
+ elif ts.endswith(' const'):
ts = ts[:-6]
- elif ts.endswith(" volatile"):
+ elif ts.endswith(' volatile'):
ts = ts[:-9]
- elif ts.endswith("*const"):
+ elif ts.endswith('*const'):
ts = ts[:-5]
- elif ts.endswith("*volatile"):
+ elif ts.endswith('*volatile'):
ts = ts[:-8]
else:
break
@@ -1081,19 +1184,19 @@ class Dumper(DumperBase):
typeobj = self.parse_and_eval(exp).type.target()
#warn("LOOKING UP 3 '%s'" % typeobj)
except:
- # Can throw "RuntimeError: No type named class Foo."
+ # Can throw 'RuntimeError: No type named class Foo.'
pass
except:
#warn("LOOKING UP '%s' FAILED" % ts)
pass
if not typeobj is None:
- #warn("CACHING: %s" % typeobj)
+ #warn('CACHING: %s' % typeobj)
self.typeCache[typeName] = typeobj
self.typesToReport[typeName] = typeobj
- # This could still be None as gdb.lookup_type("char[3]") generates
- # "RuntimeError: No type named char[3]"
+ # This could still be None as gdb.lookup_type('char[3]') generates
+ # 'RuntimeError: No type named char[3]'
#self.typeCache[typeName] = typeobj
#self.typesToReport[typeName] = typeobj
return typeobj
@@ -1118,7 +1221,7 @@ class Dumper(DumperBase):
frame = gdb.newest_frame()
ns = self.qtNamespace()
needle = self.qtNamespace() + 'QV4::ExecutionEngine'
- pat = "%sqt_v4StackTrace(((%sQV4::ExecutionEngine *)0x%x)->currentContext)"
+ pat = '%sqt_v4StackTrace(((%sQV4::ExecutionEngine *)0x%x)->currentContext)'
done = False
while i < limit and frame and not done:
block = None
@@ -1153,10 +1256,10 @@ class Dumper(DumperBase):
while i < limit and frame:
with OutputSafer(self):
name = frame.name()
- functionName = "??" if name is None else name
- fileName = ""
- objfile = ""
- symtab = ""
+ functionName = '??' if name is None else name
+ fileName = ''
+ objfile = ''
+ symtab = ''
pc = frame.pc()
sal = frame.find_sal()
line = -1
@@ -1167,13 +1270,13 @@ class Dumper(DumperBase):
objfile = fromNativePath(symtab.objfile.filename)
fullname = symtab.fullname()
if fullname is None:
- fileName = ""
+ fileName = ''
else:
fileName = fromNativePath(fullname)
- if self.nativeMixed and functionName == "qt_qmlDebugMessageAvailable":
+ if self.nativeMixed and functionName == 'qt_qmlDebugMessageAvailable':
interpreterStack = self.extractInterpreterStack()
- #print("EXTRACTED INTEPRETER STACK: %s" % interpreterStack)
+ #print('EXTRACTED INTEPRETER STACK: %s' % interpreterStack)
for interpreterFrame in interpreterStack.get('frames', []):
function = interpreterFrame.get('function', '')
fileName = interpreterFrame.get('file', '')
@@ -1183,7 +1286,7 @@ class Dumper(DumperBase):
self.put(('frame={function="%s",file="%s",'
'line="%s",language="%s",context="%s"}')
- % (function, fileName, lineNumber, language, context))
+ % (function, self.hexencode(fileName), lineNumber, language, context))
if False and self.isInternalInterpreterFrame(functionName):
frame = frame.older()
@@ -1208,7 +1311,7 @@ class Dumper(DumperBase):
def __init__(self, dumper, args):
self.dumper = dumper
self.args = args
- spec = "qt_qmlDebugConnectorOpen"
+ spec = 'qt_qmlDebugConnectorOpen'
super(Resolver, self).\
__init__(spec, gdb.BP_BREAKPOINT, internal=True, temporary=False)
@@ -1220,16 +1323,16 @@ class Dumper(DumperBase):
self.interpreterBreakpointResolvers.append(Resolver(self, args))
def exitGdb(self, _):
- gdb.execute("quit")
+ gdb.execute('quit')
def reportResult(self, msg, args):
print(msg)
def profile1(self, args):
- """Internal profiling"""
+ '''Internal profiling'''
import tempfile
import cProfile
- tempDir = tempfile.gettempdir() + "/bbprof"
+ tempDir = tempfile.gettempdir() + '/bbprof'
cProfile.run('theDumper.fetchVariables(%s)' % args, tempDir)
import pstats
pstats.Stats(tempDir).sort_stats('time').print_stats()
@@ -1291,7 +1394,7 @@ theDumper = Dumper()
def threadnames(arg):
return theDumper.threadnames(int(arg))
-registerCommand("threadnames", threadnames)
+registerCommand('threadnames', threadnames)
#######################################################################
#
@@ -1301,12 +1404,12 @@ registerCommand("threadnames", threadnames)
class InterpreterMessageBreakpoint(gdb.Breakpoint):
def __init__(self):
- spec = "qt_qmlDebugMessageAvailable"
+ spec = 'qt_qmlDebugMessageAvailable'
super(InterpreterMessageBreakpoint, self).\
__init__(spec, gdb.BP_BREAKPOINT, internal=True)
def stop(self):
- print("Interpreter event received.")
+ print('Interpreter event received.')
return theDumper.handleInterpreterMessage()
#InterpreterMessageBreakpoint()
diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py
index cbcbd9ddd3..51b9ce1bab 100644
--- a/share/qtcreator/debugger/lldbbridge.py
+++ b/share/qtcreator/debugger/lldbbridge.py
@@ -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)
diff --git a/share/qtcreator/debugger/misctypes.py b/share/qtcreator/debugger/misctypes.py
index 6a32cd05bd..e15844dc37 100644
--- a/share/qtcreator/debugger/misctypes.py
+++ b/share/qtcreator/debugger/misctypes.py
@@ -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())
+
diff --git a/share/qtcreator/debugger/pdbbridge.py b/share/qtcreator/debugger/pdbbridge.py
index 55aab8db05..63304e6f85 100644
--- a/share/qtcreator/debugger/pdbbridge.py
+++ b/share/qtcreator/debugger/pdbbridge.py
@@ -168,7 +168,7 @@ def effective(file, line, frame):
-#__all__ = ["Dumper"]
+#__all__ = ['Dumper']
def find_function(funcname, filename):
cre = re.compile(r'def\s+%s\s*[(]' % re.escape(funcname))
@@ -231,18 +231,18 @@ class Dumper:
# Hex decoding operating on str, return str.
def hexdecode(self, s):
if sys.version_info[0] == 2:
- return s.decode("hex")
- return bytes.fromhex(s).decode("utf8")
+ return s.decode('hex')
+ return bytes.fromhex(s).decode('utf8')
# Hex encoding operating on str or bytes, return str.
def hexencode(self, s):
if sys.version_info[0] == 2:
- return s.encode("hex")
+ return s.encode('hex')
if isinstance(s, str):
- s = s.encode("utf8")
- return base64.b16encode(s).decode("utf8")
+ s = s.encode('utf8')
+ return base64.b16encode(s).decode('utf8')
def canonic(self, filename):
- if filename == "<" + filename[1:-1] + ">":
+ if filename == '<' + filename[1:-1] + '>':
return filename
canonic = self.fncache.get(filename)
if not canonic:
@@ -572,7 +572,7 @@ class Dumper:
locals = globals
self.reset()
if isinstance(cmd, str):
- cmd = compile(cmd, "<string>", "exec")
+ cmd = compile(cmd, '<string>', 'exec')
sys.settrace(self.trace_dispatch)
try:
exec(cmd, globals, locals)
@@ -641,7 +641,7 @@ class Dumper:
line = 'EOF'
else:
line = line.rstrip('\r\n')
- print("LINE: %s" % line)
+ print('LINE: %s' % line)
stop = self.onecmd(line)
finally:
pass
@@ -674,9 +674,9 @@ class Dumper:
commands by the interpreter should stop.
"""
line = str(line)
- print("LINE 0: %s" % line)
+ print('LINE 0: %s' % line)
cmd, arg, line = self.parseline(line)
- print("LINE 1: %s" % line)
+ print('LINE 1: %s' % line)
if cmd is None:
return self.default(line)
self.lastcmd = line
@@ -693,15 +693,15 @@ class Dumper:
def runit(self):
- print("DIR: %s" % dir())
+ print('DIR: %s' % dir())
if sys.argv[0] == '-c':
sys.argv = sys.argv[2:]
else:
sys.argv = sys.argv[1:]
- print("ARGV: %s" % sys.argv)
+ print('ARGV: %s' % sys.argv)
mainpyfile = sys.argv[0] # Get script filename
sys.path.append(os.path.dirname(mainpyfile))
- print("MAIN: %s" % mainpyfile)
+ print('MAIN: %s' % mainpyfile)
while True:
try:
@@ -713,9 +713,9 @@ class Dumper:
#import __main__
#__main__.__dict__.clear()
- #__main__.__dict__.update({"__name__" : "__main__",
- # "__file__" : mainpyfile,
- # "__builtins__": __builtins__,
+ #__main__.__dict__.update({'__name__' : '__main__',
+ # '__file__' : mainpyfile,
+ # '__builtins__': __builtins__,
# })
# When bdb sets tracing, a number of call and line events happens
@@ -726,26 +726,26 @@ class Dumper:
self._wait_for_mainpyfile = True
self.mainpyfile = self.canonic(mainpyfile)
self._user_requested_quit = False
- with open(mainpyfile, "rb") as fp:
+ with open(mainpyfile, 'rb') as fp:
statement = "exec(compile(%r, %r, 'exec'))" % \
(fp.read(), self.mainpyfile)
self.run(statement)
if self._user_requested_quit:
break
- print("The program finished")
+ print('The program finished')
except SystemExit:
# In most cases SystemExit does not warrant a post-mortem session.
- print("The program exited via sys.exit(). Exit status:")
+ print('The program exited via sys.exit(). Exit status:')
print(sys.exc_info()[1])
except:
traceback.print_exc()
- print("Uncaught exception. Entering post mortem debugging")
- print("Running 'cont' or 'step' will restart the program")
+ print('Uncaught exception. Entering post mortem debugging')
+ print('Running "cont" or "step" will restart the program')
t = sys.exc_info()[2]
self.interaction(None, t)
- print("Post mortem debugger finished. The " + mainpyfile +
- " will be restarted")
+ print('Post mortem debugger finished. The ' + mainpyfile +
+ ' will be restarted')
def sigint_handler(self, signum, frame):
if self.allow_kbdint:
@@ -797,7 +797,7 @@ class Dumper:
Returns True if the normal interaction function must be called,
False otherwise."""
# self.currentbp is set in break_here if a breakpoint was hit
- if getattr(self, "currentbp", False) and self.currentbp in self.commands:
+ if getattr(self, 'currentbp', False) and self.currentbp in self.commands:
currentbp = self.currentbp
self.currentbp = 0
lastcmd_back = self.lastcmd
@@ -839,7 +839,7 @@ class Dumper:
def interaction(self, frame, traceback):
if self.setup(frame, traceback):
# no interaction desired at this time (happens if .pdbrc contains
- # a command like "continue")
+ # a command like 'continue')
self.forget()
return
@@ -914,7 +914,7 @@ class Dumper:
"""
if not arg:
if self.breaks: # There's at least one
- self.message("Num Type Disp Enb Where")
+ self.message('Num Type Disp Enb Where')
for bp in Breakpoint.bpbynumber:
if bp:
self.message(bp.bpformat())
@@ -926,7 +926,7 @@ class Dumper:
cond = None
comma = arg.find(',')
if comma > 0:
- # parse stuff after comma: "condition"
+ # parse stuff after comma: 'condition'
cond = arg[comma+1:].lstrip()
arg = arg[:comma].rstrip()
# parse stuff before comma: [filename:]lineno | function
@@ -986,7 +986,7 @@ class Dumper:
self.error(err)
else:
bp = self.get_breaks(filename, line)[-1]
- self.message("Breakpoint %d at %s:%d" %
+ self.message('Breakpoint %d at %s:%d' %
(bp.number, bp.file, bp.line))
# To be overridden in derived debuggers
@@ -1169,14 +1169,14 @@ class Dumper:
self.message('Deleted %s' % bp)
return
if ':' in arg:
- # Make sure it works for "clear C:\foo\bar.py:12"
+ # Make sure it works for 'clear C:\foo\bar.py:12'
i = arg.rfind(':')
filename = arg[:i]
arg = arg[i+1:]
try:
lineno = int(arg)
except ValueError:
- err = "Invalid line number (%s)" % arg
+ err = 'Invalid line number (%s)' % arg
else:
bplist = self.get_breaks(filename, lineno)
err = self.clear_break(filename, lineno)
@@ -1290,9 +1290,9 @@ class Dumper:
globals = self.curframe.f_globals
locals = self.curframe_locals
p = Dumper(self.stdin, self.stdout)
- self.message("ENTERING RECURSIVE DEBUGGER")
+ self.message('ENTERING RECURSIVE DEBUGGER')
sys.call_tracing(p.run, (arg, globals, locals))
- self.message("LEAVING RECURSIVE DEBUGGER")
+ self.message('LEAVING RECURSIVE DEBUGGER')
sys.settrace(self.trace_dispatch)
self.lastcmd = p.lastcmd
@@ -1398,7 +1398,7 @@ class Dumper:
"""
ns = self.curframe.f_globals.copy()
ns.update(self.curframe_locals)
- code.interact("*interactive*", local=ns)
+ code.interact('*interactive*', local=ns)
def lookupmodule(self, filename):
"""Helper function for break/clear parsing -- may be overridden.
@@ -1428,12 +1428,12 @@ class Dumper:
self.updateData(args)
def updateData(self, args):
- self.expandedINames = set(args.get("expanded", []))
- self.typeformats = args.get("typeformats", {})
- self.formats = args.get("formats", {})
- self.output = ""
+ self.expandedINames = set(args.get('expanded', []))
+ self.typeformats = args.get('typeformats', {})
+ self.formats = args.get('formats', {})
+ self.output = ''
- frameNr = args.get("frame", 0)
+ frameNr = args.get('frame', 0)
if frameNr == -1:
frameNr = 0
@@ -1441,33 +1441,33 @@ class Dumper:
frame, lineno = frame_lineno
filename = self.canonic(frame.f_code.co_filename)
- self.output += "data={"
+ self.output += 'data={'
for var in frame.f_locals.keys():
- if var in ("__file__", "__name__", "__package__", "__spec__",
- "__doc__", "__loader__", "__cached__", "__the_dumper__"):
+ if var in ('__file__', '__name__', '__package__', '__spec__',
+ '__doc__', '__loader__', '__cached__', '__the_dumper__'):
continue
value = frame.f_locals[var]
# this applies only for anonymous arguments
# e.g. def dummy(var, (width, height), var2) would create an anonymous local var
# named '.1' for (width, height) as this is the second argument
if var.startswith('.'):
- var = "@arg" + var[1:]
- self.dumpValue(value, var, "local.%s" % var)
+ var = '@arg' + var[1:]
+ self.dumpValue(value, var, 'local.%s' % var)
- for watcher in args.get("watchers", []):
+ for watcher in args.get('watchers', []):
iname = watcher['iname']
exp = self.hexdecode(watcher['exp'])
exp = str(exp).strip()
escapedExp = self.hexencode(exp)
- self.put("{")
- self.putField("iname", iname)
- self.putField("wname", escapedExp)
+ self.put('{')
+ self.putField('iname', iname)
+ self.putField('wname', escapedExp)
try:
res = eval(exp, {}, frame.f_locals)
self.putValue(res)
except:
- self.putValue("<unavailable>")
- self.put("}")
+ self.putValue('<unavailable>')
+ self.put('}')
#self.dumpValue(eval(value), escapedExp, iname)
self.output += '}'
@@ -1475,9 +1475,9 @@ class Dumper:
self.flushOutput()
def flushOutput(self):
- sys.stdout.write("@\n" + self.output + "@\n")
+ sys.stdout.write('@\n' + self.output + '@\n')
sys.stdout.flush()
- self.output = ""
+ self.output = ''
def put(self, value):
#sys.stdout.write(value)
@@ -1498,22 +1498,22 @@ class Dumper:
return t
def putType(self, type, priority = 0):
- self.putField("type", self.cleanType(type))
+ self.putField('type', self.cleanType(type))
def putNumChild(self, numchild):
self.put('numchild="%s",' % numchild)
def putValue(self, value, encoding = None, priority = 0):
- self.putField("value", value)
+ self.putField('value', value)
def putName(self, name):
self.put('name="%s",' % name)
def isExpanded(self, iname):
- #self.warn("IS EXPANDED: %s in %s" % (iname, self.expandedINames))
- if iname.startswith("None"):
+ #self.warn('IS EXPANDED: %s in %s' % (iname, self.expandedINames))
+ if iname.startswith('None'):
raise "Illegal iname '%s'" % iname
- #self.warn(" --> %s" % (iname in self.expandedINames))
+ #self.warn(' --> %s' % (iname in self.expandedINames))
return iname in self.expandedINames
def isExpandedIName(self, iname):
@@ -1528,138 +1528,134 @@ class Dumper:
# Hex encoding operating on str or bytes, return str.
def hexencode(self, s):
if sys.version_info[0] == 2:
- return s.encode("hex")
+ return s.encode('hex')
if isinstance(s, str):
- s = s.encode("utf8")
- return base64.b16encode(s).decode("utf8")
+ s = s.encode('utf8')
+ return base64.b16encode(s).decode('utf8')
def dumpValue(self, value, name, iname):
t = type(value)
tt = self.cleanType(t)
- if tt == "module" or tt == "function":
+ if tt == 'module' or tt == 'function':
return
if str(value).startswith("<class '"):
return
# FIXME: Should we?
- if str(value).startswith("<enum-item "):
+ if str(value).startswith('<enum-item '):
return
- self.put("{")
- self.putField("iname", iname)
+ self.put('{')
+ self.putField('iname', iname)
self.putName(name)
- if tt == "NoneType":
+ if tt == 'NoneType':
self.putType(tt)
- self.putValue("None")
+ self.putValue('None')
self.putNumChild(0)
- elif tt == "list" or tt == "tuple":
+ elif tt == 'list' or tt == 'tuple':
self.putType(tt)
self.putItemCount(len(value))
#self.putValue(value)
- self.put("children=[")
+ self.put('children=[')
for i in range(len(value)):
- self.dumpValue(value[i], str(i), "%s.%d" % (iname, i))
- self.put("]")
- elif tt == "str":
+ self.dumpValue(value[i], str(i), '%s.%d' % (iname, i))
+ self.put(']')
+ elif tt == 'str':
v = value
self.putType(tt)
self.putValue(self.hexencode(v))
- self.putField("valueencoded", "utf8")
+ self.putField('valueencoded', 'utf8')
self.putNumChild(0)
- elif tt == "unicode":
+ elif tt == 'unicode':
v = value
self.putType(tt)
self.putValue(self.hexencode(v))
- self.putField("valueencoded", "utf8")
+ self.putField('valueencoded', 'utf8')
self.putNumChild(0)
- elif tt == "buffer":
+ elif tt == 'buffer':
v = str(value)
self.putType(tt)
self.putValue(self.hexencode(v))
- self.putField("valueencoded", "latin1")
+ self.putField('valueencoded', 'latin1')
self.putNumChild(0)
- elif tt == "xrange":
+ elif tt == 'xrange':
b = iter(value).next()
e = b + len(value)
self.putType(tt)
- self.putValue("(%d, %d)" % (b, e))
+ self.putValue('(%d, %d)' % (b, e))
self.putNumChild(0)
- elif tt == "dict":
+ elif tt == 'dict':
self.putType(tt)
self.putItemCount(len(value))
- self.putField("childnumchild", 2)
- self.put("children=[")
+ self.putField('childnumchild', 2)
+ self.put('children=[')
i = 0
if sys.version_info[0] >= 3:
vals = value.items()
else:
vals = value.iteritems()
for (k, v) in vals:
- self.put("{")
- self.putType(" ")
- self.putValue("%s: %s" % (k, v))
+ self.put('{')
+ self.putType(' ')
+ self.putValue('%s: %s' % (k, v))
if self.isExpanded(iname):
- self.put("children=[")
- self.dumpValue(k, "key", "%s.%d.k" % (iname, i))
- self.dumpValue(v, "value", "%s.%d.v" % (iname, i))
- self.put("]")
- self.put("},")
+ self.put('children=[')
+ self.dumpValue(k, 'key', '%s.%d.k' % (iname, i))
+ self.dumpValue(v, 'value', '%s.%d.v' % (iname, i))
+ self.put(']')
+ self.put('},')
i += 1
- self.put("]")
- elif tt == "class":
+ self.put(']')
+ elif tt == 'class':
pass
- elif tt == "module":
+ elif tt == 'module':
pass
- elif tt == "function":
+ elif tt == 'function':
pass
- elif str(value).startswith("<enum-item "):
+ elif str(value).startswith('<enum-item '):
# FIXME: Having enums always shown like this is not nice.
self.putType(tt)
self.putValue(str(value)[11:-1])
self.putNumChild(0)
else:
v = str(value)
- p = v.find(" object at ")
+ p = v.find(' object at ')
if p > 1:
- self.putValue("@" + v[p + 11:-1])
+ self.putValue('@' + v[p + 11:-1])
self.putType(v[1:p])
else:
- p = v.find(" instance at ")
+ p = v.find(' instance at ')
if p > 1:
- self.putValue("@" + v[p + 13:-1])
+ self.putValue('@' + v[p + 13:-1])
self.putType(v[1:p])
else:
self.putType(tt)
self.putValue(v)
if self.isExpanded(iname):
- self.put("children=[")
+ self.put('children=[')
for child in dir(value):
- if child == "__dict__":
- continue
- if child == "__doc__":
- continue
- if child == "__module__":
+ if child in ('__dict__', '__doc__', '__module__'):
continue
attr = getattr(value, child)
if callable(attr):
continue
try:
- self.dumpValue(attr, child, "%s.%s" % (iname, child))
+ self.dumpValue(attr, child, '%s.%s' % (iname, child))
except:
pass
- self.put("],")
- self.put("},")
+ self.put('],')
+ self.put('},')
def warn(self, msg):
- self.putField("warning", msg)
+ self.putField('warning', msg)
def listModules(self, args):
- self.put("modules=[");
+ self.put('modules=[');
for name in sys.modules:
- self.put("{")
+ self.put('{')
self.putName(name)
self.putValue(sys.modules[name])
- self.put("},")
- self.put("]")
+ self.put('},')
+ self.put(']')
self.flushOutput()
def listSymbols(self, args):
@@ -1672,9 +1668,9 @@ class Dumper:
def assignValue(self, args):
exp = args['expression']
value = args['value']
- cmd = "%s=%s" % (exp, exp, value)
+ cmd = '%s=%s' % (exp, exp, value)
eval(cmd, {})
- self.put("CMD: '%s'" % cmd)
+ self.put('CMD: "%s"' % cmd)
self.flushOutput()
def stackListFrames(self, args):
@@ -1705,7 +1701,7 @@ class Dumper:
self.report(result)
def report(self, stuff):
- sys.stdout.write("@\n" + stuff + "@\n")
+ sys.stdout.write('@\n' + stuff + '@\n')
sys.stdout.flush()
diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py
index e0064dc225..57a7ed57d0 100644
--- a/share/qtcreator/debugger/qttypes.py
+++ b/share/qtcreator/debugger/qttypes.py
@@ -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)
diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py
index a1b5a0a699..77fc8812bb 100644
--- a/share/qtcreator/debugger/stdtypes.py
+++ b/share/qtcreator/debugger/stdtypes.py
@@ -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])
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp
index cde625de50..5b32081459 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qmlstatenodeinstance.cpp
@@ -72,9 +72,8 @@ void QmlStateNodeInstance::deactivateState()
void QmlStateNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
{
- bool hasParent = parent();
bool isStateOfTheRootModelNode = parentInstance() && parentInstance()->isRootNodeInstance();
- if (name == "when" && (!hasParent || isStateOfTheRootModelNode))
+ if (name == "when" && (isStateOfTheRootModelNode))
return;
ObjectNodeInstance::setPropertyVariant(name, value);
@@ -82,9 +81,9 @@ void QmlStateNodeInstance::setPropertyVariant(const PropertyName &name, const QV
void QmlStateNodeInstance::setPropertyBinding(const PropertyName &name, const QString &expression)
{
- bool hasParent = parent();
bool isStateOfTheRootModelNode = parentInstance() && parentInstance()->isRootNodeInstance();
- if (name == "when" && (!hasParent || isStateOfTheRootModelNode))
+
+ if (name == "when" && (isStateOfTheRootModelNode))
return;
ObjectNodeInstance::setPropertyBinding(name, expression);
diff --git a/share/qtcreator/templates/wizards/classes/cpp/wizard.json b/share/qtcreator/templates/wizards/classes/cpp/wizard.json
index 6ac5bf21d6..7c690b54c6 100644
--- a/share/qtcreator/templates/wizards/classes/cpp/wizard.json
+++ b/share/qtcreator/templates/wizards/classes/cpp/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a C++ header and a source file for a new class that you can add to a C++ project.",
"trDisplayName": "C++ Class",
"trDisplayCategory": "C++",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
"options":
diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json b/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json
index 7ebea4c3b0..81531daaba 100644
--- a/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json
+++ b/share/qtcreator/templates/wizards/classes/itemmodel/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a Qt item model.",
"trDisplayName": "Qt Item Model",
"trDisplayCategory": "Qt",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
"options":
diff --git a/share/qtcreator/templates/wizards/classes/python/wizard.json b/share/qtcreator/templates/wizards/classes/python/wizard.json
index 079a509420..d3613085b0 100644
--- a/share/qtcreator/templates/wizards/classes/python/wizard.json
+++ b/share/qtcreator/templates/wizards/classes/python/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates new Python class file.",
"trDisplayName": "Python Class",
"trDisplayCategory": "Python",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}",
"options":
diff --git a/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json b/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json
index 0d11b66daf..3786457ee1 100644
--- a/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json
+++ b/share/qtcreator/templates/wizards/classes/qtquickui/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a Qt Quick Designer UI form along with a matching QML file for implementation purposes. You can add the form and file to an existing Qt Quick Project.",
"trDisplayName": "QtQuick UI File",
"trDisplayCategory": "Qt",
- "icon": "../../global/genericfilewizard.png",
"featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.UiFiles" ],
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
diff --git a/share/qtcreator/templates/wizards/files/cppheader/wizard.json b/share/qtcreator/templates/wizards/files/cppheader/wizard.json
index 4299533ee2..db6809b0b9 100644
--- a/share/qtcreator/templates/wizards/files/cppheader/wizard.json
+++ b/share/qtcreator/templates/wizards/files/cppheader/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a C++ header file that you can add to a C++ project.",
"trDisplayName": "C++ Header File",
"trDisplayCategory": "C++",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
"options": { "key": "FileName", "value": "%{JS: Cpp.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" },
diff --git a/share/qtcreator/templates/wizards/files/cppsource/wizard.json b/share/qtcreator/templates/wizards/files/cppsource/wizard.json
index 6861d14163..bad4ad1f27 100644
--- a/share/qtcreator/templates/wizards/files/cppsource/wizard.json
+++ b/share/qtcreator/templates/wizards/files/cppsource/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a C++ source file that you can add to a C++ project.",
"trDisplayName": "C++ Source File",
"trDisplayCategory": "C++",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}",
"options": { "key": "FileName", "value": "%{JS: Cpp.fileName('%{TargetPath}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" },
diff --git a/share/qtcreator/templates/wizards/files/form/wizard.json b/share/qtcreator/templates/wizards/files/form/wizard.json
index 8dafd4e46a..2e3a42671d 100644
--- a/share/qtcreator/templates/wizards/files/form/wizard.json
+++ b/share/qtcreator/templates/wizards/files/form/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a Qt Designer form that you can add to a Qt Widget Project. This is useful if you already have an existing class for the UI business logic.",
"trDisplayName": "Qt Designer Form",
"trDisplayCategory": "Qt",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('Designer') >= 0}",
"options": [
diff --git a/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json
index 7ff6014c90..e3229e274c 100644
--- a/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json
+++ b/share/qtcreator/templates/wizards/files/glsl/gl/fragment/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a fragment shader in the Desktop OpenGL Shading Language (GLSL). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL.",
"trDisplayName": "Fragment Shader (Desktop OpenGL)",
"trDisplayCategory": "GLSL",
- "icon": "../../../../global/genericfilewizard.png",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
diff --git a/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json
index 73947b4e99..a1c5904e4c 100644
--- a/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json
+++ b/share/qtcreator/templates/wizards/files/glsl/gl/vertex/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a vertex shader in the Desktop OpenGL Shading Language (GLSL). Vertex shaders transform the positions, normals and texture coordinates of triangles, points and lines rendered with OpenGL.",
"trDisplayName": "Vertex Shader (Desktop OpenGL)",
"trDisplayCategory": "GLSL",
- "icon": "../../../../global/genericfilewizard.png",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
diff --git a/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json
index c5b11f26fa..c83c58e8bb 100644
--- a/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json
+++ b/share/qtcreator/templates/wizards/files/glsl/gles/fragment/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a fragment shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Fragment shaders generate the final pixel colors for triangles, points and lines rendered with OpenGL.",
"trDisplayName": "Fragment Shader (OpenGL/ES 2.0)",
"trDisplayCategory": "GLSL",
- "icon": "../../../../global/genericfilewizard.png",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
diff --git a/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json b/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json
index c5c67b6992..edddc2dc15 100644
--- a/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json
+++ b/share/qtcreator/templates/wizards/files/glsl/gles/vertex/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a vertex shader in the OpenGL/ES 2.0 Shading Language (GLSL/ES). Vertex shaders transform the positions, normals and texture coordinates of triangles, points and lines rendered with OpenGL.",
"trDisplayName": "Vertex Shader (OpenGL/ES 2.0)",
"trDisplayCategory": "GLSL",
- "icon": "../../../../global/genericfilewizard.png",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('GLSLEditor') >= 0}",
diff --git a/share/qtcreator/templates/wizards/files/java/wizard.json b/share/qtcreator/templates/wizards/files/java/wizard.json
index 36c6f54146..8986fb961b 100644
--- a/share/qtcreator/templates/wizards/files/java/wizard.json
+++ b/share/qtcreator/templates/wizards/files/java/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a Java file with boilerplate code.",
"trDisplayName": "Java File",
"trDisplayCategory": "Java",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('Android') >= 0}",
"options": [ { "key": "ClassName", "value": "%{JS: '%{FileName}'.charAt(0).toUpperCase() + '%{FileName}'.substr(1)}" } ],
diff --git a/share/qtcreator/templates/wizards/files/js/wizard.json b/share/qtcreator/templates/wizards/files/js/wizard.json
index 9a0773de21..57886e007b 100644
--- a/share/qtcreator/templates/wizards/files/js/wizard.json
+++ b/share/qtcreator/templates/wizards/files/js/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a JavaScript file.",
"trDisplayName": "JS File",
"trDisplayCategory": "Qt",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
"pages" :
diff --git a/share/qtcreator/templates/wizards/files/modeling/wizard.json b/share/qtcreator/templates/wizards/files/modeling/wizard.json
index d61a2cf317..4a858c483d 100644
--- a/share/qtcreator/templates/wizards/files/modeling/wizard.json
+++ b/share/qtcreator/templates/wizards/files/modeling/wizard.json
@@ -7,7 +7,6 @@
"trDisplayName": "Model",
"trDisplayCategory": "Modeling",
"platformIndependent": true,
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('ModelEditor') >= 0}",
"options":
diff --git a/share/qtcreator/templates/wizards/files/nimscript/file.nims b/share/qtcreator/templates/wizards/files/nimscript/file.nims
new file mode 100644
index 0000000000..73b2eaf388
--- /dev/null
+++ b/share/qtcreator/templates/wizards/files/nimscript/file.nims
@@ -0,0 +1 @@
+ echo "Hello World"
diff --git a/share/qtcreator/templates/wizards/files/nimscript/icon.png b/share/qtcreator/templates/wizards/files/nimscript/icon.png
new file mode 100644
index 0000000000..a08e474e6d
--- /dev/null
+++ b/share/qtcreator/templates/wizards/files/nimscript/icon.png
Binary files differ
diff --git a/share/qtcreator/templates/wizards/files/nimscript/wizard.json b/share/qtcreator/templates/wizards/files/nimscript/wizard.json
new file mode 100644
index 0000000000..1b0233f754
--- /dev/null
+++ b/share/qtcreator/templates/wizards/files/nimscript/wizard.json
@@ -0,0 +1,37 @@
+{
+ "version": 1,
+ "kind": "file",
+ "id": "Z.NimScript",
+ "category": "Z.Nim",
+ "trDescription": "Creates an empty Nim script file using UTF-8 charset.",
+ "trDisplayName": "Nim Script File",
+ "trDisplayCategory": "Nim",
+ "icon": "icon.png",
+ "enabled": "%{JS: [ %{Plugins} ].indexOf('Nim') >= 0}",
+
+ "pages" :
+ [
+ {
+ "trDisplayName": "Location",
+ "trShortTitle": "Location",
+ "typeId": "File"
+ },
+ {
+ "trDisplayName": "Project Management",
+ "trShortTitle": "Summary",
+ "typeId": "Summary"
+ }
+ ],
+ "generators" :
+ [
+ {
+ "typeId": "File",
+ "data":
+ {
+ "source": "file.nims",
+ "target": "%{JS: Util.fileName('%{TargetPath}', 'nims')}",
+ "openInEditor": true
+ }
+ }
+ ]
+}
diff --git a/share/qtcreator/templates/wizards/files/python/wizard.json b/share/qtcreator/templates/wizards/files/python/wizard.json
index ca5444c533..d9bf845631 100644
--- a/share/qtcreator/templates/wizards/files/python/wizard.json
+++ b/share/qtcreator/templates/wizards/files/python/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates an empty Python script file using UTF-8 charset.",
"trDisplayName": "Python File",
"trDisplayCategory": "Python",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('PythonEditor') >= 0}",
"pages" :
diff --git a/share/qtcreator/templates/wizards/files/qrc/wizard.json b/share/qtcreator/templates/wizards/files/qrc/wizard.json
index e6b34e5a80..0badcf7acc 100644
--- a/share/qtcreator/templates/wizards/files/qrc/wizard.json
+++ b/share/qtcreator/templates/wizards/files/qrc/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a Qt Resource file (.qrc).",
"trDisplayName": "Qt Resource File",
"trDisplayCategory": "Qt",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('ResourceEditor') >= 0}",
"pages" :
diff --git a/share/qtcreator/templates/wizards/files/qtquick2/wizard.json b/share/qtcreator/templates/wizards/files/qtquick2/wizard.json
index b3217621a6..5a4c8bbf6f 100644
--- a/share/qtcreator/templates/wizards/files/qtquick2/wizard.json
+++ b/share/qtcreator/templates/wizards/files/qtquick2/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a QML file with boilerplate code, starting with \"import QtQuick 2.0\".",
"trDisplayName": "QML File (Qt Quick 2)",
"trDisplayCategory": "Qt",
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmlJSEditor') >= 0}",
"pages" :
diff --git a/share/qtcreator/templates/wizards/files/scratch/wizard.json b/share/qtcreator/templates/wizards/files/scratch/wizard.json
index fd1e731b79..6508db6aa3 100644
--- a/share/qtcreator/templates/wizards/files/scratch/wizard.json
+++ b/share/qtcreator/templates/wizards/files/scratch/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates a scratch buffer using a temporary file.",
"trDisplayName": "Scratch Buffer",
"trDisplayCategory": "General",
- "icon": "../../global/genericfilewizard.png",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('TextEditor') >= 0}",
diff --git a/share/qtcreator/templates/wizards/files/scxml/wizard.json b/share/qtcreator/templates/wizards/files/scxml/wizard.json
index 76da846f68..f9d7246925 100644
--- a/share/qtcreator/templates/wizards/files/scxml/wizard.json
+++ b/share/qtcreator/templates/wizards/files/scxml/wizard.json
@@ -7,7 +7,6 @@
"trDisplayName": "State Chart",
"trDisplayCategory": "Modeling",
"platformIndependent": true,
- "icon": "../../global/genericfilewizard.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('QtSupport') >= 0}",
"options":
diff --git a/share/qtcreator/templates/wizards/files/text/wizard.json b/share/qtcreator/templates/wizards/files/text/wizard.json
index 618fd48a92..2e20706c55 100644
--- a/share/qtcreator/templates/wizards/files/text/wizard.json
+++ b/share/qtcreator/templates/wizards/files/text/wizard.json
@@ -6,7 +6,6 @@
"trDescription": "Creates an empty file.",
"trDisplayName": "Empty File",
"trDisplayCategory": "General",
- "icon": "../../global/genericfilewizard.png",
"platformIndependent": true,
"enabled": "%{JS: [ %{Plugins} ].indexOf('TextEditor') >= 0}",
diff --git a/src/libs/3rdparty/cplusplus/Names.h b/src/libs/3rdparty/cplusplus/Names.h
index eaf8e956d4..41f3e761b4 100644
--- a/src/libs/3rdparty/cplusplus/Names.h
+++ b/src/libs/3rdparty/cplusplus/Names.h
@@ -99,9 +99,6 @@ public:
TemplateArgumentIterator firstTemplateArgument() const { return _templateArguments.begin(); }
TemplateArgumentIterator lastTemplateArgument() const { return _templateArguments.end(); }
bool isSpecialization() const { return _isSpecialization; }
- // this is temporary solution needed in ClassOrNamespace::nestedType
- // when we try to find correct specialization for instantiation
- void setIsSpecialization(bool isSpecialization) { _isSpecialization = isSpecialization; }
// Comparator needed to distinguish between two different TemplateNameId(e.g.:used in std::map)
struct Compare: std::binary_function<const TemplateNameId *, const TemplateNameId *, bool> {
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp
index 684951d2f2..0a9138911e 100644
--- a/src/libs/cplusplus/LookupContext.cpp
+++ b/src/libs/cplusplus/LookupContext.cpp
@@ -1086,12 +1086,15 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
= reference->_instantiations.constFind(templId);
if (citInstantiation != reference->_instantiations.constEnd())
return citInstantiation.value();
- TemplateNameId *nonConstTemplId = const_cast<TemplateNameId *>(templId);
- // make this instantiation looks like specialization which help to find
- // full specialization for this instantiation
- nonConstTemplId->setIsSpecialization(true);
+
const TemplateNameIdTable &specializations = reference->_specializations;
- TemplateNameIdTable::const_iterator cit = specializations.find(templId);
+ const TemplateNameId templIdAsSpecialization(templId->identifier(),
+ /*isSpecializaton=*/ true,
+ templId->firstTemplateArgument(),
+ templId->lastTemplateArgument());
+ TemplateNameIdTable::const_iterator cit
+ = specializations.find(&templIdAsSpecialization);
+
if (cit != specializations.end()) {
// we found full specialization
reference = cit->second;
@@ -1102,8 +1105,6 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
reference = specializationWithPointer;
// TODO: find the best specialization(probably partial) for this instantiation
}
- // let's instantiation be instantiation
- nonConstTemplId->setIsSpecialization(false);
}
}
diff --git a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp
index 03ff3b65bb..e1ad53f015 100644
--- a/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp
+++ b/src/libs/modelinglib/qmt/model_widgets_ui/propertiesviewmview.cpp
@@ -1104,7 +1104,7 @@ void PropertiesView::MView::onClassMembersStatusChanged(bool valid)
if (valid)
m_classMembersStatusLabel->clear();
else
- m_classMembersStatusLabel->setText(tr("<font color=red>Invalid syntax!</font>"));
+ m_classMembersStatusLabel->setText(tr("<font color=red>Invalid syntax.</font>"));
}
void PropertiesView::MView::onParseClassMembers()
diff --git a/src/libs/qmldebug/qmldebugclient.cpp b/src/libs/qmldebug/qmldebugclient.cpp
index 10b06b2025..4061464a07 100644
--- a/src/libs/qmldebug/qmldebugclient.cpp
+++ b/src/libs/qmldebug/qmldebugclient.cpp
@@ -83,10 +83,10 @@ static QString socketStateToString(QAbstractSocket::SocketState state)
return QmlDebugConnection::tr("Network connection closing");
case QAbstractSocket::BoundState:
return QmlDebugConnection::tr("Socket state changed to BoundState. "
- "This should not happen!");
+ "This should not happen.");
case QAbstractSocket::ListeningState:
return QmlDebugConnection::tr("Socket state changed to ListeningState. "
- "This should not happen!");
+ "This should not happen.");
default:
return QmlDebugConnection::tr("Unknown state %1").arg(state);
}
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp
index 936beec915..df463e69e6 100644
--- a/src/libs/qmljs/qmljscheck.cpp
+++ b/src/libs/qmljs/qmljscheck.cpp
@@ -549,29 +549,38 @@ public:
class UnsupportedTypesByVisualDesigner : public QStringList
{
public:
- UnsupportedTypesByVisualDesigner()
+ UnsupportedTypesByVisualDesigner() : QStringList({"Transform",
+ "Timer",
+ "Rotation",
+ "Scale",
+ "Translate",
+ "Package",
+ "Particles",
+ "Dialog"})
{
- (*this) << QLatin1String("Transform") << QLatin1String("Timer")
- << QLatin1String("Rotation") << QLatin1String("Scale")
- << QLatin1String("Translate") << QLatin1String("Package")
- << QLatin1String("Particles");
- }
+ }
};
class UnsupportedTypesByQmlUi : public QStringList
{
public:
- UnsupportedTypesByQmlUi()
+ UnsupportedTypesByQmlUi() : QStringList({"Binding",
+ "ShaderEffect",
+ "ShaderEffectSource",
+ "Component",
+ "Loader",
+ "Transition",
+ "PropertyAnimation",
+ "SequentialAnimation",
+ "PropertyAnimation",
+ "SequentialAnimation",
+ "ParallelAnimation",
+ "NumberAnimation",
+ "Drawer"})
{
- (*this) << UnsupportedTypesByVisualDesigner()
- << QLatin1String("Binding") << QLatin1String("ShaderEffect")
- << QLatin1String("ShaderEffectSource") << QLatin1String("Canvas")
- << QLatin1String("Component") << QLatin1String("Loader") << QLatin1String("Transition")
- << QLatin1String("PropertyAnimation") << QLatin1String("SequentialAnimation")
- << QLatin1String("ParallelAnimation") << QLatin1String("NumberAnimation");
+ append(UnsupportedTypesByVisualDesigner());
}
-
};
class UnsupportedRootObjectTypesByVisualDesigner : public QStringList
@@ -860,6 +869,8 @@ void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId,
const QString typeName = getRightMostIdentifier(typeId)->name.toString();
if (!m_typeStack.isEmpty() && m_typeStack.last() == QLatin1String("State")
+ && typeId->name.toString() != "AnchorChanges"
+ && typeId->name.toString() != "ParentChange"
&& typeId->name.toString() != "PropertyChanges"
&& typeId->name.toString() != "StateChangeScript")
addMessage(StateCannotHaveChildItem, typeErrorLocation, typeName);
diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp
index 8b6896329d..c198072006 100644
--- a/src/libs/qmljs/qmljslink.cpp
+++ b/src/libs/qmljs/qmljslink.cpp
@@ -403,7 +403,7 @@ Import LinkPrivate::importNonFile(Document::Ptr doc, const ImportInfo &importInf
error(doc, locationFromRange(importInfo.ast()->firstSourceLocation(),
importInfo.ast()->lastSourceLocation()),
Link::tr(
- "QML module not found(%1).\n\n"
+ "QML module not found (%1).\n\n"
"Import paths:\n"
"%2\n\n"
"For qmake projects, use the QML_IMPORT_PATH variable to add import paths.\n"
diff --git a/src/libs/qtcreatorcdbext/pycdbextmodule.cpp b/src/libs/qtcreatorcdbext/pycdbextmodule.cpp
index 3f275e2bb4..3cee368e1e 100644
--- a/src/libs/qtcreatorcdbext/pycdbextmodule.cpp
+++ b/src/libs/qtcreatorcdbext/pycdbextmodule.cpp
@@ -27,6 +27,7 @@
#include "extensioncontext.h"
#include "symbolgroup.h"
+#include "symbolgroupvalue.h"
#include "pyfield.h"
#include "pystdoutredirect.h"
@@ -41,7 +42,7 @@ static PyObject *cdbext_parseAndEvaluate(PyObject *, PyObject *args) // -> Value
{
char *expr;
if (!PyArg_ParseTuple(args, "s", &expr))
- return NULL;
+ Py_RETURN_NONE;
CIDebugControl *control = ExtensionCommandContext::instance()->control();
control->SetExpressionSyntax(DEBUG_EXPR_CPLUSPLUS);
DEBUG_VALUE value;
@@ -54,7 +55,7 @@ static PyObject *cdbext_lookupType(PyObject *, PyObject *args) // -> Type
{
char *type;
if (!PyArg_ParseTuple(args, "s", &type))
- return NULL;
+ Py_RETURN_NONE;
return lookupType(type);
}
@@ -63,25 +64,19 @@ static PyObject *cdbext_listOfLocals(PyObject *, PyObject *) // -> [ Value ]
ExtensionCommandContext *extCmdCtx = ExtensionCommandContext::instance();
ULONG frame;
if (FAILED(extCmdCtx->symbols()->GetCurrentScopeFrameIndex(&frame)))
- return NULL;
+ Py_RETURN_NONE;
std::string errorMessage;
LocalsSymbolGroup *sg = ExtensionContext::instance().symbolGroup(
extCmdCtx->symbols(), extCmdCtx->threadId(), int(frame), &errorMessage);
if (!sg)
- return NULL;
+ Py_RETURN_NONE;
const auto children = sg->root()->children();
auto locals = PyList_New(0);
for (AbstractSymbolGroupNode *abstractChild : children) {
- Value *childValue = PyObject_New(Value, value_pytype());
- if (childValue != NULL) {
- if (SymbolGroupNode* child = abstractChild->asSymbolGroupNode()) {
- childValue->m_index = child->index();
- childValue->m_symbolGroup = sg->debugSymbolGroup();
- }
- }
- PyList_Append(locals, reinterpret_cast<PyObject*>(childValue));
+ if (SymbolGroupNode* child = abstractChild->asSymbolGroupNode())
+ PyList_Append(locals, createValue(child->index(), sg->debugSymbolGroup()));
}
return locals;
@@ -98,7 +93,7 @@ static PyObject *cdbext_readRawMemory(PyObject *, PyObject *args)
ULONG64 address = 0;
ULONG size = 0;
if (!PyArg_ParseTuple(args, "Kk", &address, &size))
- return NULL;
+ Py_RETURN_NONE;
char *buffer = new char[size];
@@ -112,6 +107,57 @@ static PyObject *cdbext_readRawMemory(PyObject *, PyObject *args)
return ret;
}
+static PyObject *cdbext_createValue(PyObject *, PyObject *args)
+{
+ ULONG64 address = 0;
+ Type *type = 0;
+ if (!PyArg_ParseTuple(args, "KO", &address, &type))
+ Py_RETURN_NONE;
+
+ if (debugPyCdbextModule) {
+ DebugPrint() << "Create Value address: 0x" << std::hex << address
+ << " type name: " << getTypeName(type->m_module, type->m_typeId);
+ }
+
+ ExtensionCommandContext *extCmdCtx = ExtensionCommandContext::instance();
+ CIDebugSymbols *symbols = extCmdCtx->symbols();
+
+ ULONG frame;
+ if (FAILED(symbols->GetCurrentScopeFrameIndex(&frame)))
+ Py_RETURN_NONE;
+
+ std::string errorMessage;
+ LocalsSymbolGroup *lsg = ExtensionContext::instance().symbolGroup(
+ symbols, extCmdCtx->threadId(), int(frame), &errorMessage);
+ if (!lsg)
+ Py_RETURN_NONE;
+
+ CIDebugSymbolGroup *dsg = lsg->debugSymbolGroup();
+ ULONG numberOfSymbols = 0;
+ dsg->GetNumberSymbols(&numberOfSymbols);
+ ULONG index = 0;
+ for (;index < numberOfSymbols; ++index) {
+ ULONG64 offset;
+ dsg->GetSymbolOffset(index, &offset);
+ if (offset == address) {
+ DEBUG_SYMBOL_PARAMETERS params;
+ if (SUCCEEDED(dsg->GetSymbolParameters(index, 1, &params))) {
+ if (params.TypeId == type->m_typeId && params.Module == type->m_module)
+ break;
+ }
+ }
+ }
+
+ if (index >= numberOfSymbols) {
+ index = DEBUG_ANY_ID;
+ const std::string name = SymbolGroupValue::pointedToSymbolName(
+ address, getTypeName(type->m_module, type->m_typeId));
+ if (FAILED(dsg->AddSymbol(name.c_str(), &index)))
+ Py_RETURN_NONE;
+ }
+ return createValue(index, dsg);
+}
+
static PyMethodDef cdbextMethods[] = {
{"parseAndEvaluate", cdbext_parseAndEvaluate, METH_VARARGS,
"Returns value of expression or None if the expression can not be resolved"},
@@ -123,6 +169,8 @@ static PyMethodDef cdbextMethods[] = {
"Returns the size of a pointer"},
{"readRawMemory", cdbext_readRawMemory, METH_VARARGS,
"Read a block of data from the virtual address space"},
+ {"createValue", cdbext_createValue, METH_VARARGS,
+ "Creates a value with the given type at the given address"},
{NULL, NULL, 0,
NULL} /* Sentinel */
};
@@ -140,21 +188,21 @@ PyMODINIT_FUNC
PyInit_cdbext(void)
{
if (PyType_Ready(field_pytype()) < 0)
- return NULL;
+ Py_RETURN_NONE;
if (PyType_Ready(type_pytype()) < 0)
- return NULL;
+ Py_RETURN_NONE;
if (PyType_Ready(value_pytype()) < 0)
- return NULL;
+ Py_RETURN_NONE;
stdoutRedirect_pytype()->tp_new = PyType_GenericNew;
if (PyType_Ready(stdoutRedirect_pytype()) < 0)
- return NULL;
+ Py_RETURN_NONE;
PyObject *module = PyModule_Create(&cdbextModule);
if (module == NULL)
- return NULL;
+ Py_RETURN_NONE;
Py_INCREF(field_pytype());
Py_INCREF(stdoutRedirect_pytype());
diff --git a/src/libs/qtcreatorcdbext/pyfield.cpp b/src/libs/qtcreatorcdbext/pyfield.cpp
index 8fe19cc35d..667f05b2c7 100644
--- a/src/libs/qtcreatorcdbext/pyfield.cpp
+++ b/src/libs/qtcreatorcdbext/pyfield.cpp
@@ -35,7 +35,7 @@ PyObject *field_Name(Field *self)
PyObject *field_isBaseClass(Field *)
{
- return NULL;
+ Py_RETURN_NONE;
}
bool initTypeAndOffset(Field *field)
@@ -51,7 +51,7 @@ PyObject *field_Type(Field *self)
{
if (!self->m_initialized)
if (!initTypeAndOffset(self))
- return NULL;
+ Py_RETURN_NONE;
return createType(self->m_module, self->m_typeId);
}
@@ -64,11 +64,11 @@ PyObject *field_Bitsize(Field *self)
{
if (!self->m_initialized)
if (!initTypeAndOffset(self))
- return NULL;
+ Py_RETURN_NONE;
ULONG byteSize;
auto extcmd = ExtensionCommandContext::instance();
if (FAILED(extcmd->symbols()->GetTypeSize(self->m_module, self->m_typeId, &byteSize)))
- return NULL;
+ Py_RETURN_NONE;
return Py_BuildValue("k", byteSize * 8);
}
@@ -76,7 +76,7 @@ PyObject *field_Bitpos(Field *self)
{
if (!self->m_initialized)
if (!initTypeAndOffset(self))
- return NULL;
+ Py_RETURN_NONE;
return Py_BuildValue("k", self->m_offset * 8);
}
diff --git a/src/libs/qtcreatorcdbext/pytype.cpp b/src/libs/qtcreatorcdbext/pytype.cpp
index 0a8d5069c3..d065f3f912 100644
--- a/src/libs/qtcreatorcdbext/pytype.cpp
+++ b/src/libs/qtcreatorcdbext/pytype.cpp
@@ -290,7 +290,7 @@ PyObject *type_TemplateArgument(Type *self, PyObject *args)
unsigned int index;
bool numeric;
if (!PyArg_ParseTuple(args, "Ib", &index, &numeric))
- return NULL;
+ Py_RETURN_NONE;
std::vector<std::string> innerTypes = innerTypesOf(getTypeName(self));
if (innerTypes.size() <= index)
@@ -302,7 +302,7 @@ PyObject *type_TemplateArgument(Type *self, PyObject *args)
return Py_BuildValue("i", std::stoi(innerType));
}
catch (std::invalid_argument) {
- return NULL;
+ Py_RETURN_NONE;
}
}
diff --git a/src/libs/qtcreatorcdbext/pyvalue.cpp b/src/libs/qtcreatorcdbext/pyvalue.cpp
index 68f42ff4eb..418a967f80 100644
--- a/src/libs/qtcreatorcdbext/pyvalue.cpp
+++ b/src/libs/qtcreatorcdbext/pyvalue.cpp
@@ -45,7 +45,7 @@ std::string getSymbolName(CIDebugSymbolGroup *sg, ULONG index)
PyObject *value_Name(Value *self)
{
if (!self->m_symbolGroup)
- return NULL;
+ Py_RETURN_NONE;
const std::string &symbolName = getSymbolName(self->m_symbolGroup, self->m_index);
if (symbolName.empty())
Py_RETURN_NONE;
@@ -55,32 +55,43 @@ PyObject *value_Name(Value *self)
PyObject *value_Type(Value *self)
{
if (!self->m_symbolGroup)
- return NULL;
+ Py_RETURN_NONE;
DEBUG_SYMBOL_PARAMETERS params;
const HRESULT hr = self->m_symbolGroup->GetSymbolParameters(self->m_index, 1, &params);
if (FAILED(hr))
- return NULL;
+ Py_RETURN_NONE;
return createType(params.Module, params.TypeId);
}
-PyObject *value_AsBytes(Value *self)
+char *valueData(Value *self, PULONG received)
{
if (!self->m_symbolGroup)
- return NULL;
+ nullptr;
ULONG64 address = 0;
if (FAILED(self->m_symbolGroup->GetSymbolOffset(self->m_index, &address)))
- return NULL;
+ nullptr;
ULONG size;
if (FAILED(self->m_symbolGroup->GetSymbolSize(self->m_index, &size)))
- return NULL;
+ nullptr;
char *buffer = new char[size];
auto data = ExtensionCommandContext::instance()->dataSpaces();
- ULONG received = 0;
- if (FAILED(data->ReadVirtual(address, buffer, size, &received)))
- return NULL;
+ if (SUCCEEDED(data->ReadVirtual(address, buffer, size, received)))
+ return buffer;
- return PyByteArray_FromStringAndSize(buffer, received);
+ delete[] buffer;
+ return nullptr;
+}
+
+PyObject *value_AsBytes(Value *self)
+{
+ ULONG received;
+ if (char *data = valueData(self, &received)) {
+ auto byteArray = PyByteArray_FromStringAndSize(data, received);
+ delete[] data;
+ return byteArray;
+ }
+ Py_RETURN_NONE;
}
ULONG64 valueAddress(Value *value)
@@ -117,51 +128,46 @@ ULONG numberOfChildren(Value *v)
PyObject *value_Dereference(Value *self)
{
if (!self->m_symbolGroup)
- return NULL;
+ Py_RETURN_NONE;
DEBUG_SYMBOL_PARAMETERS params;
const HRESULT hr = self->m_symbolGroup->GetSymbolParameters(self->m_index, 1, &params);
if (FAILED(hr))
- return NULL;
+ Py_RETURN_NONE;
char *name = getTypeName(params.Module, params.TypeId);
- Value *ret = self;
+ PyObject *ret = reinterpret_cast<PyObject*>(self);
if (endsWith(std::string(name), "*")) {
if (numberOfChildren(self) > 0 && expandValue(self)) {
ULONG symbolCount = 0;
self->m_symbolGroup->GetNumberSymbols(&symbolCount);
- if (symbolCount > self->m_index + 1) {
- ret = PyObject_New(Value, value_pytype());
- if (ret != NULL) {
- ret->m_index = self->m_index + 1;
- ret->m_symbolGroup = self->m_symbolGroup;
- }
- }
+ if (symbolCount > self->m_index + 1)
+ ret = createValue(self->m_index + 1, self->m_symbolGroup);
}
}
delete[] name;
- return reinterpret_cast<PyObject*>(ret);
+ return ret;
}
PyObject *value_HasChildren(Value *self)
{
if (!self->m_symbolGroup)
- return NULL;
+ Py_RETURN_NONE;
return pyBool(numberOfChildren(self) != 0);
}
PyObject *value_Expand(Value *self)
{
if (!self->m_symbolGroup)
- return NULL;
+ Py_RETURN_NONE;
return pyBool(expandValue(self));
}
PyObject *value_NativeDebuggerValue(Value *self)
{
if (!self->m_symbolGroup)
- return NULL;
+ Py_RETURN_NONE;
ULONG size = 0;
self->m_symbolGroup->GetSymbolValueText(self->m_index, NULL, 0, &size);
char *name = new char[size];
@@ -177,24 +183,18 @@ PyObject *value_NativeDebuggerValue(Value *self)
PyObject *value_ChildFromName(Value *self, PyObject *args)
{
if (!self->m_symbolGroup)
- return NULL;
+ Py_RETURN_NONE;
char *name;
if (!PyArg_ParseTuple(args, "s", &name))
- return NULL;
+ Py_RETURN_NONE;
const ULONG childCount = numberOfChildren(self);
if (childCount == 0 || !expandValue(self))
Py_RETURN_NONE;
for (ULONG childIndex = self->m_index + 1 ; childIndex <= self->m_index + childCount; ++childIndex) {
- if (getSymbolName(self->m_symbolGroup, childIndex) == name) {
- Value *childValue = PyObject_New(Value, value_pytype());
- if (childValue != NULL) {
- childValue->m_index = childIndex;
- childValue->m_symbolGroup = self->m_symbolGroup;
- }
- return reinterpret_cast<PyObject*>(childValue);
- }
+ if (getSymbolName(self->m_symbolGroup, childIndex) == name)
+ return createValue(childIndex, self->m_symbolGroup);
}
Py_RETURN_NONE;
@@ -213,17 +213,17 @@ std::string pointedToSymbolName(ULONG64 address, const std::string &type)
PyObject *value_ChildFromField(Value *self, PyObject *args)
{
if (!self->m_symbolGroup)
- return NULL;
+ Py_RETURN_NONE;
Field *field;
if (!PyArg_ParseTuple(args, "O", &field))
- return NULL;
+ Py_RETURN_NONE;
if (!field->m_initialized && !initTypeAndOffset(field))
- return NULL;
+ Py_RETURN_NONE;
ULONG64 address = valueAddress(self);
if (address == 0)
- return NULL;
+ Py_RETURN_NONE;
address += field->m_offset;
auto symbols = ExtensionCommandContext::instance()->symbols();
@@ -234,43 +234,32 @@ PyObject *value_ChildFromField(Value *self, PyObject *args)
childTypeNameSize, &childTypeNameSize);
if (childTypeName.empty())
- return NULL;
+ Py_RETURN_NONE;
std::string name = pointedToSymbolName(address, childTypeName);
ULONG index = DEBUG_ANY_ID;
if (FAILED(self->m_symbolGroup->AddSymbol(name.c_str(), &index)))
- return NULL;
+ Py_RETURN_NONE;
- Value *childValue = PyObject_New(Value, value_pytype());
- if (childValue != NULL) {
- childValue->m_index = index;
- childValue->m_symbolGroup = self->m_symbolGroup;
- }
- return reinterpret_cast<PyObject*>(childValue);
+ return createValue(index, self->m_symbolGroup);
}
PyObject *value_ChildFromIndex(Value *self, PyObject *args)
{
if (!self->m_symbolGroup)
- return NULL;
+ Py_RETURN_NONE;
unsigned int index;
if (!PyArg_ParseTuple(args, "I", &index))
- return NULL;
+ Py_RETURN_NONE;
if (index < 0)
- return NULL;
+ Py_RETURN_NONE;
const ULONG childCount = numberOfChildren(self);
if (childCount <= index || !expandValue(self))
Py_RETURN_NONE;
- Value *childValue = PyObject_New(Value, value_pytype());
- if (childValue != NULL) {
- childValue->m_index = self->m_index + index + 1;
- childValue->m_symbolGroup = self->m_symbolGroup;
- }
-
- return reinterpret_cast<PyObject*>(childValue);
+ return createValue(self->m_index + index + 1, self->m_symbolGroup);
}
void value_Dealloc(Value *)
@@ -290,6 +279,16 @@ void initValue(Value *value)
value->m_symbolGroup = nullptr;
}
+PyObject *createValue(ULONG index, CIDebugSymbolGroup *symbolGroup)
+{
+ Value *value = PyObject_New(Value, value_pytype());
+ if (value != NULL) {
+ value->m_index = index;
+ value->m_symbolGroup = symbolGroup;
+ }
+ return reinterpret_cast<PyObject*>(value);
+}
+
static PyMethodDef valueMethods[] = {
{"name", PyCFunction(value_Name), METH_NOARGS,
"Name of this thing or None"},
diff --git a/src/libs/qtcreatorcdbext/pyvalue.h b/src/libs/qtcreatorcdbext/pyvalue.h
index 1c5c1ea003..e7aac4e29f 100644
--- a/src/libs/qtcreatorcdbext/pyvalue.h
+++ b/src/libs/qtcreatorcdbext/pyvalue.h
@@ -40,3 +40,4 @@ struct Value
PyTypeObject *value_pytype();
void initValue(Value *value);
+PyObject *createValue(ULONG index, CIDebugSymbolGroup *symbolGroup);
diff --git a/src/libs/sqlite/sqlitestatement.cpp b/src/libs/sqlite/sqlitestatement.cpp
index 0fd6b0467b..cf0fa90418 100644
--- a/src/libs/sqlite/sqlitestatement.cpp
+++ b/src/libs/sqlite/sqlitestatement.cpp
@@ -342,7 +342,7 @@ bool SqliteStatement::checkForStepError(int resultCode) const
case SQLITE_CONSTRAINT: throwException("SqliteStatement::stepStatement: contraint prevent insert or update!");
}
- throwException("SqliteStatement::stepStatement: unknown error has happen!");
+ throwException("SqliteStatement::stepStatement: unknown error has happened");
Q_UNREACHABLE();
}
@@ -356,7 +356,7 @@ void SqliteStatement::checkForPrepareError(int resultCode) const
case SQLITE_MISUSE: throwException("SqliteStatement::prepareStatement: was called inappropriately!");
}
- throwException("SqliteStatement::prepareStatement: unknown error has happen!");
+ throwException("SqliteStatement::prepareStatement: unknown error has happened");
}
void SqliteStatement::setIfIsReadyToFetchValues(int resultCode) const
diff --git a/src/libs/timeline/qml/TimeDisplay.qml b/src/libs/timeline/qml/TimeDisplay.qml
index e85f905bb1..599024e6f6 100644
--- a/src/libs/timeline/qml/TimeDisplay.qml
+++ b/src/libs/timeline/qml/TimeDisplay.qml
@@ -82,12 +82,12 @@ Item {
}
Item {
- x: Math.floor(firstBlock * timeDisplay.pixelsPerBlock - timeDisplay.offsetX)
+ x: -(timeDisplay.offsetX % timeDisplay.pixelsPerBlock)
y: 0
id: row
property int firstBlock: timeDisplay.offsetX / timeDisplay.pixelsPerBlock
- property int offset: firstBlock % repeater.model
+ property int offset: repeater.model - (firstBlock % repeater.model);
Repeater {
id: repeater
@@ -98,19 +98,16 @@ Item {
// Changing the text in text nodes is expensive. We minimize the number of changes
// by rotating the nodes during scrolling.
- property int stableIndex: row.offset > index ? repeater.model - row.offset + index :
- index - row.offset
+ property int stableIndex: (index + row.offset) % repeater.model
+
height: timeDisplay.height
y: 0
x: width * stableIndex
width: timeDisplay.pixelsPerBlock
- // Manually control this. We don't want it to happen when firstBlock
- // changes before stableIndex changes.
- onStableIndexChanged: block = row.firstBlock + stableIndex
- property int block: -1
- property double blockStartTime: block * timeDisplay.timePerBlock +
- timeDisplay.alignedWindowStart
+ property double blockStartTime: (row.firstBlock + stableIndex)
+ * timeDisplay.timePerBlock
+ + timeDisplay.alignedWindowStart
TimelineText {
id: timeLabel
diff --git a/src/libs/timeline/timelinetheme.cpp b/src/libs/timeline/timelinetheme.cpp
index 853c42c972..0ca005b2c8 100644
--- a/src/libs/timeline/timelinetheme.cpp
+++ b/src/libs/timeline/timelinetheme.cpp
@@ -104,12 +104,8 @@ public:
void TimelineTheme::setupTheme(QQmlEngine *engine)
{
- QQmlPropertyMap *themePropertyMap = new QQmlPropertyMap(engine);
- const QVariantHash creatorTheme = Utils::creatorTheme()->values();
- for (auto it = creatorTheme.constBegin(); it != creatorTheme.constEnd(); ++it)
- themePropertyMap->insert(it.key(), it.value());
-
- engine->rootContext()->setContextProperty(QLatin1String("creatorTheme"), themePropertyMap);
+ engine->rootContext()->setContextProperty(QLatin1String("creatorTheme"),
+ Utils::creatorTheme()->values());
engine->addImageProvider(QLatin1String("icons"), new TimelineImageIconProvider);
}
diff --git a/src/plugins/debugger/images/breakpoint.png b/src/libs/utils/images/filledcircle.png
index 57dc3054c8..57dc3054c8 100644
--- a/src/plugins/debugger/images/breakpoint.png
+++ b/src/libs/utils/images/filledcircle.png
Binary files differ
diff --git a/src/plugins/debugger/images/breakpoint@2x.png b/src/libs/utils/images/filledcircle@2x.png
index d4062c909c..d4062c909c 100644
--- a/src/plugins/debugger/images/breakpoint@2x.png
+++ b/src/libs/utils/images/filledcircle@2x.png
Binary files differ
diff --git a/src/libs/utils/theme/theme.cpp b/src/libs/utils/theme/theme.cpp
index 10ee20217d..2c860fd730 100644
--- a/src/libs/utils/theme/theme.cpp
+++ b/src/libs/utils/theme/theme.cpp
@@ -141,26 +141,27 @@ void Theme::setDisplayName(const QString &name)
d->displayName = name;
}
-QVariantHash Theme::values() const
+const QVariantMap &Theme::values() const
{
- QVariantHash result;
- const QMetaObject &m = *metaObject();
- {
- const QMetaEnum e = m.enumerator(m.indexOfEnumerator("Color"));
- for (int i = 0, total = e.keyCount(); i < total; ++i) {
- const QString key = QLatin1String(e.key(i));
- const QPair<QColor, QString> &var = d->colors.at(i);
- result.insert(key, var.first);
+ if (d->values.isEmpty()) {
+ const QMetaObject &m = *metaObject();
+ {
+ const QMetaEnum e = m.enumerator(m.indexOfEnumerator("Color"));
+ for (int i = 0, total = e.keyCount(); i < total; ++i) {
+ const QString key = QLatin1String(e.key(i));
+ const QPair<QColor, QString> &var = d->colors.at(i);
+ d->values.insert(key, var.first);
+ }
}
- }
- {
- const QMetaEnum e = m.enumerator(m.indexOfEnumerator("Flag"));
- for (int i = 0, total = e.keyCount(); i < total; ++i) {
- const QString key = QLatin1String(e.key(i));
- result.insert(key, flag(static_cast<Theme::Flag>(i)));
+ {
+ const QMetaEnum e = m.enumerator(m.indexOfEnumerator("Flag"));
+ for (int i = 0, total = e.keyCount(); i < total; ++i) {
+ const QString key = QLatin1String(e.key(i));
+ d->values.insert(key, flag(static_cast<Theme::Flag>(i)));
+ }
}
}
- return result;
+ return d->values;
}
static QColor readColor(const QString &color)
diff --git a/src/libs/utils/theme/theme.h b/src/libs/utils/theme/theme.h
index a859871d54..0c94b4731d 100644
--- a/src/libs/utils/theme/theme.h
+++ b/src/libs/utils/theme/theme.h
@@ -340,7 +340,7 @@ public:
QString displayName() const;
void setDisplayName(const QString &displayName);
- QVariantHash values() const;
+ const QVariantMap &values() const;
void readSettings(QSettings &settings);
diff --git a/src/libs/utils/theme/theme_p.h b/src/libs/utils/theme/theme_p.h
index 4170ec7cd9..ad1761d0b8 100644
--- a/src/libs/utils/theme/theme_p.h
+++ b/src/libs/utils/theme/theme_p.h
@@ -48,6 +48,8 @@ public:
QVector<QGradientStops> gradients;
QVector<bool> flags;
QMap<QString, QColor> palette;
+
+ QVariantMap values;
};
QTCREATOR_UTILS_EXPORT void setCreatorTheme(Theme *theme);
diff --git a/src/libs/utils/utils.qrc b/src/libs/utils/utils.qrc
index 9c6e7c6a08..eff85a3d45 100644
--- a/src/libs/utils/utils.qrc
+++ b/src/libs/utils/utils.qrc
@@ -168,5 +168,7 @@
<file>images/fittoview@2x.png</file>
<file>images/namespace.png</file>
<file>images/namespace@2x.png</file>
+ <file>images/filledcircle.png</file>
+ <file>images/filledcircle@2x.png</file>
</qresource>
</RCC>
diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp
index 30df0bd75e..955f88f261 100644
--- a/src/plugins/android/androidrunner.cpp
+++ b/src/plugins/android/androidrunner.cpp
@@ -388,6 +388,9 @@ void AndroidRunnerWorker::forceStop()
void AndroidRunnerWorker::asyncStart(const QString &intentName,
const QVector<QStringList> &adbCommands)
{
+ m_tries = 0;
+ m_wasStarted = false;
+
// Its assumed that the device or avd serial returned by selector() is online.
m_adbLogcatProcess->start(m_adb, selector() << "logcat");
m_psProc->start(m_adb, selector() << "shell"
@@ -526,9 +529,6 @@ void AndroidRunnerWorker::asyncStart(const QString &intentName,
}
}
-
- m_tries = 0;
- m_wasStarted = false;
}
bool AndroidRunnerWorker::adbShellAmNeedsQuotes()
diff --git a/src/plugins/autotest/autotest.pro b/src/plugins/autotest/autotest.pro
index 9cf411299d..a22a584ff3 100644
--- a/src/plugins/autotest/autotest.pro
+++ b/src/plugins/autotest/autotest.pro
@@ -32,6 +32,7 @@ SOURCES += \
gtest/gtestframework.cpp \
gtest/gtestsettings.cpp \
gtest/gtestsettingspage.cpp \
+ gtest/gtest_utils.cpp \
qtest/qttesttreeitem.cpp \
qtest/qttestvisitors.cpp \
qtest/qttestconfiguration.cpp \
@@ -41,11 +42,13 @@ SOURCES += \
qtest/qttestframework.cpp \
qtest/qttestsettings.cpp \
qtest/qttestsettingspage.cpp \
+ qtest/qttest_utils.cpp \
quick/quicktestconfiguration.cpp \
quick/quicktestparser.cpp \
quick/quicktesttreeitem.cpp \
quick/quicktestvisitors.cpp \
quick/quicktestframework.cpp \
+ quick/quicktest_utils.cpp \
testframeworkmanager.cpp
diff --git a/src/plugins/autotest/autotest.qbs b/src/plugins/autotest/autotest.qbs
index 9552909ed7..6f6354e00c 100644
--- a/src/plugins/autotest/autotest.qbs
+++ b/src/plugins/autotest/autotest.qbs
@@ -23,7 +23,7 @@ QtcPlugin {
}
Depends {
- name: "Qt.test"
+ name: "Qt.testlib"
condition: qtc.testsEnabled
}
diff --git a/src/plugins/autotest/gtest/gtest_utils.cpp b/src/plugins/autotest/gtest/gtest_utils.cpp
new file mode 100644
index 0000000000..4ce68760a2
--- /dev/null
+++ b/src/plugins/autotest/gtest/gtest_utils.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "gtest_utils.h"
+
+#include <QStringList>
+
+namespace Autotest {
+namespace Internal {
+namespace GTestUtils {
+
+static const QStringList valid = {
+ QStringLiteral("TEST"), QStringLiteral("TEST_F"), QStringLiteral("TEST_P"),
+ QStringLiteral("TYPED_TEST"), QStringLiteral("TYPED_TEST_P")
+};
+
+bool isGTestMacro(const QString &macro)
+{
+ return valid.contains(macro);
+}
+
+bool isGTestParameterized(const QString &macro)
+{
+ return macro == QStringLiteral("TEST_P") || macro == QStringLiteral("TYPED_TEST_P");
+}
+
+bool isGTestTyped(const QString &macro)
+{
+ return macro == QStringLiteral("TYPED_TEST") || macro == QStringLiteral("TYPED_TEST_P");
+}
+
+} // namespace GTestUtils
+} // namespace Internal
+} // namespace Autotest
diff --git a/src/plugins/autotest/gtest/gtest_utils.h b/src/plugins/autotest/gtest/gtest_utils.h
index 3a46a4e52a..93dd1ad621 100644
--- a/src/plugins/autotest/gtest/gtest_utils.h
+++ b/src/plugins/autotest/gtest/gtest_utils.h
@@ -25,31 +25,16 @@
#pragma once
+#include <QString>
+
namespace Autotest {
namespace Internal {
+namespace GTestUtils {
-class GTestUtils
-{
-public:
- static bool isGTestMacro(const QString &macro)
- {
- static QStringList valid = {
- QStringLiteral("TEST"), QStringLiteral("TEST_F"), QStringLiteral("TEST_P"),
- QStringLiteral("TYPED_TEST"), QStringLiteral("TYPED_TEST_P")
- };
- return valid.contains(macro);
- }
-
- static bool isGTestParameterized(const QString &macro)
- {
- return macro == QStringLiteral("TEST_P") || macro == QStringLiteral("TYPED_TEST_P");
- }
-
- static bool isGTestTyped(const QString &macro)
- {
- return macro == QStringLiteral("TYPED_TEST") || macro == QStringLiteral("TYPED_TEST_P");
- }
-};
+bool isGTestMacro(const QString &macro);
+bool isGTestParameterized(const QString &macro);
+bool isGTestTyped(const QString &macro);
+} // namespace GTestUtils
} // namespace Internal
} // namespace Autotest
diff --git a/src/plugins/autotest/qtest/qttest_utils.cpp b/src/plugins/autotest/qtest/qttest_utils.cpp
new file mode 100644
index 0000000000..bb80570ed1
--- /dev/null
+++ b/src/plugins/autotest/qtest/qttest_utils.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "qttest_utils.h"
+#include "../testframeworkmanager.h"
+#include "../testtreeitem.h"
+
+#include <utils/qtcassert.h>
+
+#include <QByteArrayList>
+
+namespace Autotest {
+namespace Internal {
+namespace QTestUtils {
+
+static const QByteArrayList valid = {"QTEST_MAIN", "QTEST_APPLESS_MAIN", "QTEST_GUILESS_MAIN"};
+
+bool isQTestMacro(const QByteArray &macro)
+{
+ return valid.contains(macro);
+}
+
+QHash<QString, QString> testCaseNamesForFiles(const Core::Id &id,
+ const QStringList &files)
+{
+ QHash<QString, QString> result;
+ TestTreeItem *rootNode = TestFrameworkManager::instance()->rootNodeForTestFramework(id);
+ QTC_ASSERT(rootNode, return result);
+
+ for (int row = 0, rootCount = rootNode->childCount(); row < rootCount; ++row) {
+ const TestTreeItem *child = rootNode->childItem(row);
+ if (files.contains(child->filePath())) {
+ result.insert(child->filePath(), child->name());
+ }
+ for (int childRow = 0, count = child->childCount(); childRow < count; ++childRow) {
+ const TestTreeItem *grandChild = child->childItem(childRow);
+ if (files.contains(grandChild->filePath()))
+ result.insert(grandChild->filePath(), child->name());
+ }
+ }
+ return result;
+}
+
+} // namespace QTestUtils
+} // namespace Internal
+} // namespace Autotest
diff --git a/src/plugins/autotest/qtest/qttest_utils.h b/src/plugins/autotest/qtest/qttest_utils.h
index 75024b9bc9..0d4f661a35 100644
--- a/src/plugins/autotest/qtest/qttest_utils.h
+++ b/src/plugins/autotest/qtest/qttest_utils.h
@@ -25,45 +25,17 @@
#pragma once
-#include "../testframeworkmanager.h"
+#include <QHash>
-#include <utils/qtcassert.h>
-
-#include <QByteArrayList>
+namespace Core { class Id; }
namespace Autotest {
namespace Internal {
+namespace QTestUtils {
-class QTestUtils
-{
-public:
- static bool isQTestMacro(const QByteArray &macro)
- {
- static QByteArrayList valid = {"QTEST_MAIN", "QTEST_APPLESS_MAIN", "QTEST_GUILESS_MAIN"};
- return valid.contains(macro);
- }
-
- static QHash<QString, QString> testCaseNamesForFiles(const Core::Id &id,
- const QStringList &files)
- {
- QHash<QString, QString> result;
- TestTreeItem *rootNode = TestFrameworkManager::instance()->rootNodeForTestFramework(id);
- QTC_ASSERT(rootNode, return result);
-
- for (int row = 0, rootCount = rootNode->childCount(); row < rootCount; ++row) {
- const TestTreeItem *child = rootNode->childItem(row);
- if (files.contains(child->filePath())) {
- result.insert(child->filePath(), child->name());
- }
- for (int childRow = 0, count = child->childCount(); childRow < count; ++childRow) {
- const TestTreeItem *grandChild = child->childItem(childRow);
- if (files.contains(grandChild->filePath()))
- result.insert(grandChild->filePath(), child->name());
- }
- }
- return result;
- }
-};
+bool isQTestMacro(const QByteArray &macro);
+QHash<QString, QString> testCaseNamesForFiles(const Core::Id &id, const QStringList &files);
+} // namespace QTestUtils
} // namespace Internal
} // namespace Autotest
diff --git a/src/plugins/autotest/qtest/qttestparser.cpp b/src/plugins/autotest/qtest/qttestparser.cpp
index 7472441d4d..2835427d58 100644
--- a/src/plugins/autotest/qtest/qttestparser.cpp
+++ b/src/plugins/autotest/qtest/qttestparser.cpp
@@ -101,7 +101,7 @@ static QString testClass(const CppTools::CppModelManager *modelManager,
document = snapshot.preprocessedDocument(fileContent, fileName);
document->check();
CPlusPlus::AST *ast = document->translationUnit()->ast();
- TestAstVisitor astVisitor(document);
+ TestAstVisitor astVisitor(document, snapshot);
astVisitor.accept(ast);
return astVisitor.className();
}
@@ -178,7 +178,7 @@ static bool handleQtTest(QFutureInterface<TestParseResultPtr> futureInterface,
if (declaringDoc.isNull())
return false;
- TestVisitor visitor(testCaseName);
+ TestVisitor visitor(testCaseName, snapshot);
visitor.accept(declaringDoc->globalNamespace());
if (!visitor.resultValid())
return false;
diff --git a/src/plugins/autotest/qtest/qttestvisitors.cpp b/src/plugins/autotest/qtest/qttestvisitors.cpp
index 3de8448eb7..579a4ff974 100644
--- a/src/plugins/autotest/qtest/qttestvisitors.cpp
+++ b/src/plugins/autotest/qtest/qttestvisitors.cpp
@@ -39,8 +39,9 @@ static QStringList specialFunctions({ "initTestCase", "cleanupTestCase", "init",
/************************** Cpp Test Symbol Visitor ***************************/
-TestVisitor::TestVisitor(const QString &fullQualifiedClassName)
- : m_className(fullQualifiedClassName)
+TestVisitor::TestVisitor(const QString &fullQualifiedClassName, const CPlusPlus::Snapshot &snapshot)
+ : m_className(fullQualifiedClassName),
+ m_snapshot(snapshot)
{
}
@@ -48,7 +49,6 @@ bool TestVisitor::visit(CPlusPlus::Class *symbol)
{
const CPlusPlus::Overview o;
CPlusPlus::LookupContext lc;
- const CPlusPlus::Snapshot snapshot = CppTools::CppModelManager::instance()->snapshot();
unsigned count = symbol->memberCount();
for (unsigned i = 0; i < count; ++i) {
@@ -67,7 +67,7 @@ bool TestVisitor::visit(CPlusPlus::Class *symbol)
TestCodeLocationAndType locationAndType;
CPlusPlus::Function *functionDefinition = m_symbolFinder.findMatchingDefinition(
- func, snapshot, true);
+ func, m_snapshot, true);
if (functionDefinition && functionDefinition->fileId()) {
locationAndType.m_name = QString::fromUtf8(functionDefinition->fileName());
locationAndType.m_line = functionDefinition->line();
@@ -92,9 +92,10 @@ bool TestVisitor::visit(CPlusPlus::Class *symbol)
/**************************** Cpp Test AST Visitor ****************************/
-TestAstVisitor::TestAstVisitor(CPlusPlus::Document::Ptr doc)
+TestAstVisitor::TestAstVisitor(CPlusPlus::Document::Ptr doc, const CPlusPlus::Snapshot &snapshot)
: ASTVisitor(doc->translationUnit()),
- m_currentDoc(doc)
+ m_currentDoc(doc),
+ m_snapshot(snapshot)
{
}
@@ -113,8 +114,7 @@ bool TestAstVisitor::visit(CPlusPlus::CallAST *ast)
// first argument is the one we need
if (const auto argumentExpressionAST = expressionListAST->value) {
CPlusPlus::TypeOfExpression toe;
- CppTools::CppModelManager *cppMM = CppTools::CppModelManager::instance();
- toe.init(m_currentDoc, cppMM->snapshot());
+ toe.init(m_currentDoc, m_snapshot);
QList<CPlusPlus::LookupItem> toeItems
= toe(argumentExpressionAST, m_currentDoc, m_currentScope);
diff --git a/src/plugins/autotest/qtest/qttestvisitors.h b/src/plugins/autotest/qtest/qttestvisitors.h
index 64d4e8c511..21bfb2ba22 100644
--- a/src/plugins/autotest/qtest/qttestvisitors.h
+++ b/src/plugins/autotest/qtest/qttestvisitors.h
@@ -42,7 +42,7 @@ namespace Internal {
class TestVisitor : public CPlusPlus::SymbolVisitor
{
public:
- explicit TestVisitor(const QString &fullQualifiedClassName);
+ explicit TestVisitor(const QString &fullQualifiedClassName, const CPlusPlus::Snapshot &snapshot);
QMap<QString, TestCodeLocationAndType> privateSlots() const { return m_privSlots; }
bool resultValid() const { return m_valid; }
@@ -52,6 +52,7 @@ public:
private:
CppTools::SymbolFinder m_symbolFinder;
QString m_className;
+ CPlusPlus::Snapshot m_snapshot;
QMap<QString, TestCodeLocationAndType> m_privSlots;
bool m_valid = false;
};
@@ -59,7 +60,7 @@ private:
class TestAstVisitor : public CPlusPlus::ASTVisitor
{
public:
- explicit TestAstVisitor(CPlusPlus::Document::Ptr doc);
+ explicit TestAstVisitor(CPlusPlus::Document::Ptr doc, const CPlusPlus::Snapshot &snapshot);
bool visit(CPlusPlus::CallAST *ast);
bool visit(CPlusPlus::CompoundStatementAST *ast);
@@ -70,6 +71,7 @@ private:
QString m_className;
CPlusPlus::Scope *m_currentScope = 0;
CPlusPlus::Document::Ptr m_currentDoc;
+ CPlusPlus::Snapshot m_snapshot;
};
class TestDataFunctionVisitor : public CPlusPlus::ASTVisitor
diff --git a/src/plugins/autotest/quick/quicktest_utils.cpp b/src/plugins/autotest/quick/quicktest_utils.cpp
new file mode 100644
index 0000000000..2e7c4f1594
--- /dev/null
+++ b/src/plugins/autotest/quick/quicktest_utils.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "quicktest_utils.h"
+#include "../testframeworkmanager.h"
+#include "../testtreeitem.h"
+
+#include <utils/qtcassert.h>
+
+#include <QByteArrayList>
+
+namespace Autotest {
+namespace Internal {
+namespace QuickTestUtils {
+
+static const QByteArrayList valid = {"QUICK_TEST_MAIN", "QUICK_TEST_OPENGL_MAIN"};
+
+bool isQuickTestMacro(const QByteArray &macro)
+{
+ return valid.contains(macro);
+}
+
+QHash<QString, QString> proFilesForQmlFiles(const Core::Id &id, const QStringList &files)
+{
+ QHash<QString, QString> result;
+ TestTreeItem *rootNode = TestFrameworkManager::instance()->rootNodeForTestFramework(id);
+ QTC_ASSERT(rootNode, return result);
+
+ if (files.isEmpty())
+ return result;
+
+ for (int row = 0, rootCount = rootNode->childCount(); row < rootCount; ++row) {
+ const TestTreeItem *child = rootNode->childItem(row);
+ const QString &file = child->filePath();
+ if (!file.isEmpty() && files.contains(file)) {
+ const QString &proFile = child->proFile();
+ if (!proFile.isEmpty())
+ result.insert(file, proFile);
+ }
+ for (int subRow = 0, subCount = child->childCount(); subRow < subCount; ++subRow) {
+ const TestTreeItem *grandChild = child->childItem(subRow);
+ const QString &file = grandChild->filePath();
+ if (!file.isEmpty() && files.contains(file)) {
+ const QString &proFile = grandChild->proFile();
+ if (!proFile.isEmpty())
+ result.insert(file, proFile);
+ }
+ }
+ }
+ return result;
+}
+
+} // namespace QuickTestUtils
+} // namespace Internal
+} // namespace Autotest
diff --git a/src/plugins/autotest/quick/quicktest_utils.h b/src/plugins/autotest/quick/quicktest_utils.h
index f7a17ad538..af5cfdb7bf 100644
--- a/src/plugins/autotest/quick/quicktest_utils.h
+++ b/src/plugins/autotest/quick/quicktest_utils.h
@@ -25,54 +25,17 @@
#pragma once
-#include "../testframeworkmanager.h"
+#include <QHash>
-#include <utils/qtcassert.h>
-
-#include <QByteArrayList>
+namespace Core { class Id; }
namespace Autotest {
namespace Internal {
+namespace QuickTestUtils {
-class QuickTestUtils
-{
-public:
- static bool isQuickTestMacro(const QByteArray &macro)
- {
- static const QByteArrayList valid = {"QUICK_TEST_MAIN", "QUICK_TEST_OPENGL_MAIN"};
- return valid.contains(macro);
- }
-
- static QHash<QString, QString> proFilesForQmlFiles(const Core::Id &id, const QStringList &files)
- {
- QHash<QString, QString> result;
- TestTreeItem *rootNode = TestFrameworkManager::instance()->rootNodeForTestFramework(id);
- QTC_ASSERT(rootNode, return result);
-
- if (files.isEmpty())
- return result;
-
- for (int row = 0, rootCount = rootNode->childCount(); row < rootCount; ++row) {
- const TestTreeItem *child = rootNode->childItem(row);
- const QString &file = child->filePath();
- if (!file.isEmpty() && files.contains(file)) {
- const QString &proFile = child->proFile();
- if (!proFile.isEmpty())
- result.insert(file, proFile);
- }
- for (int subRow = 0, subCount = child->childCount(); subRow < subCount; ++subRow) {
- const TestTreeItem *grandChild = child->childItem(subRow);
- const QString &file = grandChild->filePath();
- if (!file.isEmpty() && files.contains(file)) {
- const QString &proFile = grandChild->proFile();
- if (!proFile.isEmpty())
- result.insert(file, proFile);
- }
- }
- }
- return result;
- }
-};
+bool isQuickTestMacro(const QByteArray &macro);
+QHash<QString, QString> proFilesForQmlFiles(const Core::Id &id, const QStringList &files);
+} // namespace QuickTestUtils
} // namespace Internal
} // namespace Autotest
diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp
index 2cbf9f703e..bc0845411b 100644
--- a/src/plugins/autotest/testcodeparser.cpp
+++ b/src/plugins/autotest/testcodeparser.cpp
@@ -38,6 +38,7 @@
#include <qmljstools/qmljsmodelmanager.h>
#include <utils/algorithm.h>
+#include <utils/mapreduce.h>
#include <utils/qtcassert.h>
#include <utils/runextensions.h>
@@ -168,38 +169,6 @@ void TestCodeParser::updateTestTree()
// is not (yet) part of the CppModelManager's snapshot
static bool parsingHasFailed;
-static bool checkDocumentForTestCode(QFutureInterface<TestParseResultPtr> &futureInterface,
- const QString &fileName,
- const QVector<ITestParser *> &parsers)
-{
- foreach (ITestParser *currentParser, parsers) {
- if (futureInterface.isCanceled())
- return false;
- if (currentParser->processDocument(futureInterface, fileName))
- return true;
- }
- return false;
-}
-
-static void performParse(QFutureInterface<TestParseResultPtr> &futureInterface,
- const QStringList &list, const QVector<ITestParser *> &parsers)
-{
- int progressValue = 0;
- futureInterface.setProgressRange(0, list.size());
- futureInterface.setProgressValue(progressValue);
-
- foreach (const QString &file, list) {
- if (futureInterface.isCanceled())
- return;
- futureInterface.setProgressValue(++progressValue);
- if (!checkDocumentForTestCode(futureInterface, file, parsers)) {
- parsingHasFailed |= !CppTools::CppModelManager::instance()->snapshot().contains(file)
- && (CppTools::ProjectFile::classify(file) != CppTools::ProjectFile::Unclassified);
- }
- }
- futureInterface.setProgressValue(list.size());
-}
-
/****** threaded parsing stuff *******/
void TestCodeParser::onDocumentUpdated(const QString &fileName)
@@ -314,6 +283,18 @@ bool TestCodeParser::postponed(const QStringList &fileList)
QTC_ASSERT(false, return false); // should not happen at all
}
+static void parseFileForTests(const QVector<ITestParser *> &parsers,
+ QFutureInterface<TestParseResultPtr> &futureInterface,
+ const QString &fileName)
+{
+ foreach (ITestParser *parser, parsers) {
+ if (futureInterface.isCanceled())
+ return;
+ if (parser->processDocument(futureInterface, fileName))
+ break;
+ }
+}
+
void TestCodeParser::scanForTests(const QStringList &fileList)
{
if (m_parserState == Disabled || m_parserState == Shutdown) {
@@ -372,7 +353,11 @@ void TestCodeParser::scanForTests(const QStringList &fileList)
foreach (ITestParser *parser, m_testCodeParsers)
parser->init(list);
- QFuture<TestParseResultPtr> future = Utils::runAsync(&performParse, list, m_testCodeParsers);
+ QFuture<TestParseResultPtr> future = Utils::map(list,
+ [this](QFutureInterface<TestParseResultPtr> &fi, const QString &file) {
+ parseFileForTests(m_testCodeParsers, fi, file);
+ },
+ Utils::MapReduceOption::Unordered);
m_futureWatcher.setFuture(future);
if (list.size() > 5) {
Core::ProgressManager::addTask(future, tr("Scanning for Tests"),
@@ -411,6 +396,8 @@ void TestCodeParser::onAllTasksFinished(Core::Id type)
void TestCodeParser::onFinished()
{
+ if (m_futureWatcher.isCanceled())
+ parsingHasFailed = true;
switch (m_parserState) {
case PartialParse:
qCDebug(LOG) << "setting state to Idle (onFinished, PartialParse)";
diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp
index bec21cba0e..598e51b0b4 100644
--- a/src/plugins/autotest/testrunner.cpp
+++ b/src/plugins/autotest/testrunner.cpp
@@ -74,9 +74,10 @@ TestRunner::TestRunner(QObject *parent) :
connect(this, &TestRunner::requestStopTestRun,
&m_futureWatcher, &QFutureWatcher<TestResultPtr>::cancel);
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::canceled,
- this, [this]() { emit testResultReady(TestResultPtr(new FaultyTestResult(
- Result::MessageFatal,
- tr("Test run canceled by user."))));
+ this, [this]() {
+ emit testResultReady(TestResultPtr(new FaultyTestResult(
+ Result::MessageFatal, tr("Test run canceled by user."))));
+ m_executingTests = false; // avoid being stuck if finished() signal won't get emitted
});
}
@@ -231,15 +232,12 @@ void TestRunner::prepareToRunTests(Mode mode)
if (!projectExplorerSettings.buildBeforeDeploy || mode == TestRunner::DebugWithoutDeploy
|| mode == TestRunner::RunWithoutDeploy) {
runOrDebugTests();
+ } else if (project->hasActiveBuildSettings()) {
+ buildProject(project);
} else {
- if (project->hasActiveBuildSettings()) {
- buildProject(project);
- } else {
- emit testResultReady(TestResultPtr(new FaultyTestResult(Result::MessageFatal,
- tr("Project is not configured. Canceling test run."))));
- onFinished();
- return;
- }
+ emit testResultReady(TestResultPtr(new FaultyTestResult(Result::MessageFatal,
+ tr("Project is not configured. Canceling test run."))));
+ onFinished();
}
}
@@ -368,6 +366,7 @@ void TestRunner::runOrDebugTests()
debugTests();
break;
default:
+ onFinished();
QTC_ASSERT(false, return); // unexpected run mode
}
}
@@ -380,6 +379,8 @@ void TestRunner::buildProject(ProjectExplorer::Project *project)
connect(buildManager, &ProjectExplorer::BuildManager::buildQueueFinished,
this, &TestRunner::buildFinished);
ProjectExplorer::ProjectExplorerPlugin::buildProject(project);
+ if (!buildManager->isBuilding())
+ buildFinished(false);
}
void TestRunner::buildFinished(bool success)
diff --git a/src/plugins/autotest/unit_test/mixed_atp/tests/auto/bench/bench.qbs b/src/plugins/autotest/unit_test/mixed_atp/tests/auto/bench/bench.qbs
index d10891316a..971fcfaf04 100644
--- a/src/plugins/autotest/unit_test/mixed_atp/tests/auto/bench/bench.qbs
+++ b/src/plugins/autotest/unit_test/mixed_atp/tests/auto/bench/bench.qbs
@@ -6,7 +6,7 @@ CppApplication {
targetName: "tst_benchtest"
Depends { name: "cpp" }
- Depends { name: "Qt.test" }
+ Depends { name: "Qt.testlib" }
files: [ "tst_benchtest.cpp" ]
diff --git a/src/plugins/autotest/unit_test/mixed_atp/tests/auto/dummy/dummy.qbs b/src/plugins/autotest/unit_test/mixed_atp/tests/auto/dummy/dummy.qbs
index 012ba11a67..f5ad64f926 100644
--- a/src/plugins/autotest/unit_test/mixed_atp/tests/auto/dummy/dummy.qbs
+++ b/src/plugins/autotest/unit_test/mixed_atp/tests/auto/dummy/dummy.qbs
@@ -5,7 +5,7 @@ CppApplication {
name: "Dummy auto test"
targetName: "tst_FooBar"
- Depends { name: "Qt.test" }
+ Depends { name: "Qt.testlib" }
Depends { name: "Qt.gui" }
files: [ "tst_foo.cpp", "tst_foo.h" ]
diff --git a/src/plugins/autotest/unit_test/plain/test_plain/test_plain.qbs b/src/plugins/autotest/unit_test/plain/test_plain/test_plain.qbs
index 1b7937ce6a..295c8a6acf 100644
--- a/src/plugins/autotest/unit_test/plain/test_plain/test_plain.qbs
+++ b/src/plugins/autotest/unit_test/plain/test_plain/test_plain.qbs
@@ -4,7 +4,7 @@ CppApplication {
type: "application" // suppress bundle generation on OSX
Depends { name: "Qt.gui" }
- Depends { name: "Qt.test" }
+ Depends { name: "Qt.testlib" }
files: [ "tst_simple.cpp", "tst_simple.h" ]
}
diff --git a/src/plugins/beautifier/beautifierplugin.cpp b/src/plugins/beautifier/beautifierplugin.cpp
index 043881b219..e58d746964 100644
--- a/src/plugins/beautifier/beautifierplugin.cpp
+++ b/src/plugins/beautifier/beautifierplugin.cpp
@@ -196,7 +196,11 @@ bool BeautifierPlugin::initialize(const QStringList &arguments, QString *errorSt
menu->menu()->setTitle(QCoreApplication::translate("Beautifier", Constants::OPTION_TR_CATEGORY));
menu->setOnAllDisabledBehavior(Core::ActionContainer::Show);
Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu);
+ return true;
+}
+void BeautifierPlugin::extensionsInitialized()
+{
m_tools << new ArtisticStyle::ArtisticStyle(this);
m_tools << new ClangFormat::ClangFormat(this);
m_tools << new Uncrustify::Uncrustify(this);
@@ -216,11 +220,7 @@ bool BeautifierPlugin::initialize(const QStringList &arguments, QString *errorSt
addAutoReleasedObject(settingsPage);
updateActions();
- return true;
-}
-void BeautifierPlugin::extensionsInitialized()
-{
const Core::EditorManager *editorManager = Core::EditorManager::instance();
connect(editorManager, &Core::EditorManager::currentEditorChanged,
this, &BeautifierPlugin::updateActions);
diff --git a/src/plugins/clangcodemodel/clangcodemodel.qbs b/src/plugins/clangcodemodel/clangcodemodel.qbs
index 509e75963d..ed36629504 100644
--- a/src/plugins/clangcodemodel/clangcodemodel.qbs
+++ b/src/plugins/clangcodemodel/clangcodemodel.qbs
@@ -45,6 +45,7 @@ QtcPlugin {
"clangbackendipcintegration.h",
"clangcodemodelplugin.cpp",
"clangcodemodelplugin.h",
+ "clangcodemodel.qrc",
"clangcompletionassistinterface.cpp",
"clangcompletionassistinterface.h",
"clangcompletionassistprocessor.cpp",
diff --git a/src/plugins/cmakeprojectmanager/builddirreader.cpp b/src/plugins/cmakeprojectmanager/builddirreader.cpp
index fb7d30bf62..741ddc2da4 100644
--- a/src/plugins/cmakeprojectmanager/builddirreader.cpp
+++ b/src/plugins/cmakeprojectmanager/builddirreader.cpp
@@ -61,6 +61,7 @@ BuildDirReader::Parameters::Parameters(const CMakeBuildConfiguration *bc)
cmakeExecutable = cmake->cmakeExecutable();
pathMapper = cmake->pathMapper();
+ isAutorun = cmake->isAutoRun();
auto tc = ProjectExplorer::ToolChainKitInformation::toolChain(k, ProjectExplorer::ToolChain::Language::Cxx);
if (tc)
diff --git a/src/plugins/cmakeprojectmanager/builddirreader.h b/src/plugins/cmakeprojectmanager/builddirreader.h
index 20b0de2fd0..db0a5bfc46 100644
--- a/src/plugins/cmakeprojectmanager/builddirreader.h
+++ b/src/plugins/cmakeprojectmanager/builddirreader.h
@@ -83,6 +83,7 @@ public:
QString platform;
QString toolset;
QStringList generatorArguments;
+ bool isAutorun = false;
};
static BuildDirReader *createReader(const BuildDirReader::Parameters &p);
diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp
index 6144ad575c..d38155c345 100644
--- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp
@@ -507,7 +507,7 @@ CMakeConfig CMakeConfigurationKitInformation::defaultConfiguration(const Kit *k)
// Qt4:
config << CMakeConfigItem(CMAKE_QMAKE_KEY, "%{Qt:qmakeExecutable}");
// Qt5:
- config << CMakeConfigItem(CMAKE_PREFIX_PATH_KEY, "%{Qt:QT_INSTALL_LIBS}");
+ config << CMakeConfigItem(CMAKE_PREFIX_PATH_KEY, "%{Qt:QT_INSTALL_PREFIX}");
config << CMakeConfigItem(CMAKE_C_TOOLCHAIN_KEY, "%{Compiler:Executable:C}");
config << CMakeConfigItem(CMAKE_CXX_TOOLCHAIN_KEY, "%{Compiler:Executable:Cxx}");
@@ -535,7 +535,7 @@ QList<Task> CMakeConfigurationKitInformation::validate(const Kit *k) const
const bool isQt4 = version && version->qtVersion() < QtSupport::QtVersionNumber(5, 0, 0);
Utils::FileName qmakePath;
- QStringList qtLibDirs;
+ QStringList qtInstallDirs;
Utils::FileName tcCPath;
Utils::FileName tcCxxPath;
foreach (const CMakeConfigItem &i, config) {
@@ -549,7 +549,7 @@ QList<Task> CMakeConfigurationKitInformation::validate(const Kit *k) const
else if (i.key == CMAKE_CXX_TOOLCHAIN_KEY)
tcCxxPath = expandedValue;
else if (i.key == CMAKE_PREFIX_PATH_KEY)
- qtLibDirs = CMakeConfigItem::cmakeSplitValue(expandedValue.toString());
+ qtInstallDirs = CMakeConfigItem::cmakeSplitValue(expandedValue.toString());
}
QList<Task> result;
@@ -572,7 +572,7 @@ QList<Task> CMakeConfigurationKitInformation::validate(const Kit *k) const
Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
}
}
- if (version && !qtLibDirs.contains(version->qmakeProperty("QT_INSTALL_LIBS")) && !isQt4) {
+ if (version && !qtInstallDirs.contains(version->qmakeProperty("QT_INSTALL_PREFIX")) && !isQt4) {
if (version->isValid()) {
result << Task(Task::Warning, tr("CMake configuration has no CMAKE_PREFIX_PATH set "
"that points to the kit Qt version."),
diff --git a/src/plugins/cmakeprojectmanager/tealeafreader.cpp b/src/plugins/cmakeprojectmanager/tealeafreader.cpp
index 8a6fefda01..9ed8373f52 100644
--- a/src/plugins/cmakeprojectmanager/tealeafreader.cpp
+++ b/src/plugins/cmakeprojectmanager/tealeafreader.cpp
@@ -153,7 +153,7 @@ TeaLeafReader::TeaLeafReader()
{
connect(EditorManager::instance(), &EditorManager::aboutToSave,
this, [this](const IDocument *document) {
- if (m_cmakeFiles.contains(document->filePath()))
+ if (m_cmakeFiles.contains(document->filePath()) || !m_parameters.isAutorun)
emit dirty();
});
}
@@ -583,7 +583,7 @@ void TeaLeafReader::cmakeFinished(int code, QProcess::ExitStatus status)
QString msg;
if (status != QProcess::NormalExit)
- msg = tr("*** cmake process crashed!");
+ msg = tr("*** cmake process crashed.");
else if (code != 0)
msg = tr("*** cmake process exited with exit code %1.").arg(code);
diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp
index 5a936731fa..ef5ab7b776 100644
--- a/src/plugins/coreplugin/documentmanager.cpp
+++ b/src/plugins/coreplugin/documentmanager.cpp
@@ -738,40 +738,36 @@ QString DocumentManager::getSaveFileNameWithExtension(const QString &title, cons
/*!
Asks the user for a new file name (\gui {Save File As}) for \a document.
*/
-QString DocumentManager::getSaveAsFileName(const IDocument *document, const QString &filter, QString *selectedFilter)
+QString DocumentManager::getSaveAsFileName(const IDocument *document)
{
- if (!document)
- return QLatin1String("");
- QString absoluteFilePath = document->filePath().toString();
- const QFileInfo fi(absoluteFilePath);
- QString path;
- QString fileName;
- if (absoluteFilePath.isEmpty()) {
- fileName = document->fallbackSaveAsFileName();
+ QTC_ASSERT(document, return QString());
+ Utils::MimeDatabase mdb;
+ const QString filter = Utils::MimeDatabase::allFiltersString();
+ const QString filePath = document->filePath().toString();
+ QString selectedFilter;
+ QString fileDialogPath = filePath;
+ if (!filePath.isEmpty()) {
+ selectedFilter = mdb.mimeTypeForFile(filePath).filterString();
+ } else {
+ const QString suggestedName = document->fallbackSaveAsFileName();
+ if (!suggestedName.isEmpty()) {
+ const QList<MimeType> types = mdb.mimeTypesForFileName(suggestedName);
+ if (!types.isEmpty())
+ selectedFilter = types.first().filterString();
+ }
const QString defaultPath = document->fallbackSaveAsPath();
if (!defaultPath.isEmpty())
- path = defaultPath;
- } else {
- path = fi.absolutePath();
- fileName = fi.fileName();
- }
-
- QString filterString;
- if (filter.isEmpty()) {
- Utils::MimeDatabase mdb;
- const Utils::MimeType &mt = mdb.mimeTypeForFile(fi);
- if (mt.isValid())
- filterString = mt.filterString();
- selectedFilter = &filterString;
- } else {
- filterString = filter;
+ fileDialogPath = defaultPath + (suggestedName.isEmpty()
+ ? QString()
+ : '/' + suggestedName);
}
+ if (selectedFilter.isEmpty())
+ selectedFilter = mdb.mimeTypeForName(document->mimeType()).filterString();
- absoluteFilePath = getSaveFileName(tr("Save File As"),
- path + QLatin1Char('/') + fileName,
- filterString,
- selectedFilter);
- return absoluteFilePath;
+ return getSaveFileName(tr("Save File As"),
+ fileDialogPath,
+ filter,
+ &selectedFilter);
}
/*!
diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h
index bf8692f3cb..b259dfcaa5 100644
--- a/src/plugins/coreplugin/documentmanager.h
+++ b/src/plugins/coreplugin/documentmanager.h
@@ -92,8 +92,7 @@ public:
const QString &filter = QString(), QString *selectedFilter = 0);
static QString getSaveFileNameWithExtension(const QString &title, const QString &pathIn,
const QString &filter);
- static QString getSaveAsFileName(const IDocument *document, const QString &filter = QString(),
- QString *selectedFilter = 0);
+ static QString getSaveAsFileName(const IDocument *document);
static bool saveAllModifiedDocumentsSilently(bool *canceled = 0,
QList<IDocument *> *failedToClose = 0);
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index 5db180a447..679e963dc9 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -2100,25 +2100,8 @@ bool EditorManagerPrivate::saveDocumentAs(IDocument *document)
if (!document)
return false;
- emit m_instance->aboutToSave(document);
- Utils::MimeDatabase mdb;
- const QString filter = Utils::MimeDatabase::allFiltersString();
- QString selectedFilter;
- const QString filePath = document->filePath().toString();
- if (!filePath.isEmpty()) {
- selectedFilter = mdb.mimeTypeForFile(filePath).filterString();
- } else {
- const QString suggestedName = document->fallbackSaveAsFileName();
- if (!suggestedName.isEmpty()) {
- const QList<MimeType> types = mdb.mimeTypesForFileName(suggestedName);
- if (!types.isEmpty())
- selectedFilter = types.first().filterString();
- }
- }
- if (selectedFilter.isEmpty())
- selectedFilter = mdb.mimeTypeForName(document->mimeType()).filterString();
const QString &absoluteFilePath =
- DocumentManager::getSaveAsFileName(document, filter, &selectedFilter);
+ DocumentManager::getSaveAsFileName(document);
if (absoluteFilePath.isEmpty())
return false;
@@ -2130,6 +2113,7 @@ bool EditorManagerPrivate::saveDocumentAs(IDocument *document)
EditorManager::closeDocuments(QList<IDocument *>() << otherDocument, false);
}
+ emit m_instance->aboutToSave(document);
const bool success = DocumentManager::saveDocument(document, absoluteFilePath);
document->checkPermissions();
diff --git a/src/plugins/coreplugin/variablechooser.cpp b/src/plugins/coreplugin/variablechooser.cpp
index 4e5a05d68e..1fdf68512c 100644
--- a/src/plugins/coreplugin/variablechooser.cpp
+++ b/src/plugins/coreplugin/variablechooser.cpp
@@ -118,6 +118,7 @@ public:
VariableTreeView *m_variableTree;
QLabel *m_variableDescription;
+ QSortFilterProxyModel *m_sortModel;
QString m_defaultDescription;
QByteArray m_currentVariableName; // Prevent recursive insertion of currently expanded item
};
@@ -258,10 +259,10 @@ VariableChooserPrivate::VariableChooserPrivate(VariableChooser *parent)
m_variableTree = new VariableTreeView(q, this);
m_variableDescription = new QLabel(q);
- auto sorter = new QSortFilterProxyModel(this);
- sorter->setSourceModel(&m_model);
- sorter->sort(0);
- m_variableTree->setModel(sorter);
+ m_sortModel = new QSortFilterProxyModel(this);
+ m_sortModel->setSourceModel(&m_model);
+ m_sortModel->sort(0);
+ m_variableTree->setModel(m_sortModel);
m_variableDescription->setText(m_defaultDescription);
m_variableDescription->setMinimumSize(QSize(0, 60));
m_variableDescription->setAlignment(Qt::AlignLeft|Qt::AlignTop);
@@ -416,7 +417,8 @@ void VariableChooser::addSupportForChildWidgets(QWidget *parent, MacroExpander *
void VariableChooserPrivate::updateDescription(const QModelIndex &index)
{
if (m_variableDescription)
- m_variableDescription->setText(m_model.data(index, Qt::ToolTipRole).toString());
+ m_variableDescription->setText(m_model.data(m_sortModel->mapToSource(index),
+ Qt::ToolTipRole).toString());
}
/*!
@@ -534,7 +536,7 @@ QWidget *VariableChooserPrivate::currentWidget()
*/
void VariableChooserPrivate::handleItemActivated(const QModelIndex &index)
{
- QString text = m_model.data(index, UnexpandedTextRole).toString();
+ QString text = m_model.data(m_sortModel->mapToSource(index), UnexpandedTextRole).toString();
if (!text.isEmpty())
insertText(text);
}
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 15d82c3436..5afd9da1a1 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -1217,7 +1217,7 @@ void CdbEngine::activateFrame(int index)
void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
{
if (m_pythonVersion > 0x030000) {
- watchHandler()->notifyUpdateStarted(updateParameters.partialVariables());
+ watchHandler()->notifyUpdateStarted(updateParameters);
DebuggerCommand cmd("theDumper.fetchVariables", ScriptCommand);
watchHandler()->appendFormatRequests(&cmd);
@@ -1270,7 +1270,7 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
return;
}
- watchHandler()->notifyUpdateStarted(updateParameters.partialVariables());
+ watchHandler()->notifyUpdateStarted(updateParameters);
/* Watchers: Forcibly discard old symbol group as switching from
* thread 0/frame 0 -> thread 1/assembly -> thread 0/frame 0 will otherwise re-use it
diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp
index 96977c9fc8..47654f52bd 100644
--- a/src/plugins/debugger/commonoptionspage.cpp
+++ b/src/plugins/debugger/commonoptionspage.cpp
@@ -45,208 +45,11 @@
using namespace Core;
using namespace Debugger::Constants;
using namespace ProjectExplorer;
+using namespace Utils;
namespace Debugger {
namespace Internal {
-class CommonOptionsPageWidget : public QWidget
-{
- Q_OBJECT
-
-public:
- explicit CommonOptionsPageWidget(const QSharedPointer<Utils::SavedActionSet> &group);
-
- GlobalDebuggerOptions globalOptions() const;
- void setGlobalOptions(const GlobalDebuggerOptions &go);
-
-private:
- QCheckBox *checkBoxUseAlternatingRowColors;
- QCheckBox *checkBoxFontSizeFollowsEditor;
- QCheckBox *checkBoxUseToolTipsInMainEditor;
- QCheckBox *checkBoxCloseSourceBuffersOnExit;
- QCheckBox *checkBoxCloseMemoryBuffersOnExit;
- QCheckBox *checkBoxSwitchModeOnExit;
- QCheckBox *checkBoxBringToForegroundOnInterrrupt;
- QCheckBox *checkBoxShowQmlObjectTree;
- QCheckBox *checkBoxBreakpointsFullPath;
- QCheckBox *checkBoxRegisterForPostMortem;
- QCheckBox *checkBoxWarnOnReleaseBuilds;
- QCheckBox *checkBoxKeepEditorStationaryWhileStepping;
- QLabel *labelMaximalStackDepth;
- QSpinBox *spinBoxMaximalStackDepth;
-
- DebuggerSourcePathMappingWidget *sourcesMappingWidget;
- const QSharedPointer<Utils::SavedActionSet> m_group;
-};
-
-CommonOptionsPageWidget::CommonOptionsPageWidget
- (const QSharedPointer<Utils::SavedActionSet> &group)
- : m_group(group)
-{
- QGroupBox *behaviorBox = new QGroupBox(this);
- behaviorBox->setTitle(tr("Behavior"));
-
- checkBoxUseAlternatingRowColors = new QCheckBox(behaviorBox);
- checkBoxUseAlternatingRowColors->setText(tr("Use alternating row colors in debug views"));
-
- checkBoxFontSizeFollowsEditor = new QCheckBox(behaviorBox);
- checkBoxFontSizeFollowsEditor->setToolTip(tr("Changes the font size in the debugger views when the font size in the main editor changes."));
- checkBoxFontSizeFollowsEditor->setText(tr("Debugger font size follows main editor"));
-
- checkBoxUseToolTipsInMainEditor = new QCheckBox(behaviorBox);
- checkBoxUseToolTipsInMainEditor->setText(tr("Use tooltips in main editor while debugging"));
-
- QString t = tr("Stopping and stepping in the debugger "
- "will automatically open views associated with the current location.") + QLatin1Char('\n');
- checkBoxCloseSourceBuffersOnExit = new QCheckBox(behaviorBox);
- checkBoxCloseSourceBuffersOnExit->setText(tr("Close temporary source views on debugger exit"));
- checkBoxCloseSourceBuffersOnExit->setToolTip(t + tr("Select this option to close "
- "automatically opened source views when the debugger exits."));
-
- checkBoxCloseMemoryBuffersOnExit = new QCheckBox(behaviorBox);
- checkBoxCloseMemoryBuffersOnExit->setText(tr("Close temporary memory views on debugger exit"));
- checkBoxCloseMemoryBuffersOnExit->setToolTip(t + tr("Select this option to close "
- "automatically opened memory views when the debugger exits."));
-
- checkBoxSwitchModeOnExit = new QCheckBox(behaviorBox);
- checkBoxSwitchModeOnExit->setText(tr("Switch to previous mode on debugger exit"));
-
- checkBoxBringToForegroundOnInterrrupt = new QCheckBox(behaviorBox);
- checkBoxBringToForegroundOnInterrrupt->setText(tr("Bring Qt Creator to foreground when application interrupts"));
-
- checkBoxShowQmlObjectTree = new QCheckBox(behaviorBox);
- checkBoxShowQmlObjectTree->setToolTip(tr("Shows QML object tree in Locals and Expressions when connected and not stepping."));
- checkBoxShowQmlObjectTree->setText(tr("Show QML object tree"));
-
- checkBoxBreakpointsFullPath = new QCheckBox(behaviorBox);
- checkBoxBreakpointsFullPath->setToolTip(tr("Enables a full file path in breakpoints by default also for GDB."));
- checkBoxBreakpointsFullPath->setText(tr("Set breakpoints using a full absolute path"));
-
- checkBoxRegisterForPostMortem = new QCheckBox(behaviorBox);
- checkBoxRegisterForPostMortem->setToolTip(tr("Registers Qt Creator for debugging crashed applications."));
- checkBoxRegisterForPostMortem->setText(tr("Use Qt Creator for post-mortem debugging"));
-
- checkBoxWarnOnReleaseBuilds = new QCheckBox(behaviorBox);
- checkBoxWarnOnReleaseBuilds->setText(tr("Warn when debugging \"Release\" builds"));
- checkBoxWarnOnReleaseBuilds->setToolTip(tr("Shows a warning when starting the debugger "
- "on a binary with insufficient debug information."));
-
- checkBoxKeepEditorStationaryWhileStepping = new QCheckBox(behaviorBox);
- checkBoxKeepEditorStationaryWhileStepping->setText(tr("Keep editor stationary when stepping"));
- checkBoxKeepEditorStationaryWhileStepping->setToolTip(tr("Scrolls the editor only when it is necessary "
- "to keep the current line in view, "
- "instead of keeping the next statement centered at "
- "all times."));
-
- labelMaximalStackDepth = new QLabel(tr("Maximum stack depth:"), behaviorBox);
-
- spinBoxMaximalStackDepth = new QSpinBox(behaviorBox);
- spinBoxMaximalStackDepth->setSpecialValueText(tr("<unlimited>"));
- spinBoxMaximalStackDepth->setMaximum(999);
- spinBoxMaximalStackDepth->setSingleStep(5);
- spinBoxMaximalStackDepth->setValue(10);
-
- sourcesMappingWidget = new DebuggerSourcePathMappingWidget(this);
-
- QHBoxLayout *horizontalLayout = new QHBoxLayout();
- horizontalLayout->addWidget(labelMaximalStackDepth);
- horizontalLayout->addWidget(spinBoxMaximalStackDepth);
- horizontalLayout->addStretch();
-
- QGridLayout *gridLayout = new QGridLayout(behaviorBox);
- gridLayout->addWidget(checkBoxUseAlternatingRowColors, 0, 0, 1, 1);
- gridLayout->addWidget(checkBoxUseToolTipsInMainEditor, 1, 0, 1, 1);
- gridLayout->addWidget(checkBoxCloseSourceBuffersOnExit, 2, 0, 1, 1);
- gridLayout->addWidget(checkBoxCloseMemoryBuffersOnExit, 3, 0, 1, 1);
- gridLayout->addWidget(checkBoxBringToForegroundOnInterrrupt, 4, 0, 1, 1);
- gridLayout->addWidget(checkBoxBreakpointsFullPath, 5, 0, 1, 1);
- gridLayout->addWidget(checkBoxWarnOnReleaseBuilds, 6, 0, 1, 1);
- gridLayout->addLayout(horizontalLayout, 7, 0, 1, 2);
-
- gridLayout->addWidget(checkBoxFontSizeFollowsEditor, 0, 1, 1, 1);
- gridLayout->addWidget(checkBoxSwitchModeOnExit, 1, 1, 1, 1);
- gridLayout->addWidget(checkBoxShowQmlObjectTree, 2, 1, 1, 1);
- gridLayout->addWidget(checkBoxKeepEditorStationaryWhileStepping, 3, 1, 1, 1);
- gridLayout->addWidget(checkBoxRegisterForPostMortem, 4, 1, 1, 1);
-
- QVBoxLayout *verticalLayout = new QVBoxLayout(this);
- verticalLayout->addWidget(behaviorBox);
- verticalLayout->addWidget(sourcesMappingWidget);
- verticalLayout->addStretch();
-
- m_group->clear();
-
- m_group->insert(action(UseAlternatingRowColors),
- checkBoxUseAlternatingRowColors);
- m_group->insert(action(UseToolTipsInMainEditor),
- checkBoxUseToolTipsInMainEditor);
- m_group->insert(action(CloseSourceBuffersOnExit),
- checkBoxCloseSourceBuffersOnExit);
- m_group->insert(action(CloseMemoryBuffersOnExit),
- checkBoxCloseMemoryBuffersOnExit);
- m_group->insert(action(SwitchModeOnExit),
- checkBoxSwitchModeOnExit);
- m_group->insert(action(BreakpointsFullPathByDefault),
- checkBoxBreakpointsFullPath);
- m_group->insert(action(RaiseOnInterrupt),
- checkBoxBringToForegroundOnInterrrupt);
- m_group->insert(action(ShowQmlObjectTree),
- checkBoxShowQmlObjectTree);
- m_group->insert(action(WarnOnReleaseBuilds),
- checkBoxWarnOnReleaseBuilds);
- m_group->insert(action(StationaryEditorWhileStepping),
- checkBoxKeepEditorStationaryWhileStepping);
- m_group->insert(action(FontSizeFollowsEditor),
- checkBoxFontSizeFollowsEditor);
- m_group->insert(action(AutoDerefPointers), 0);
- m_group->insert(action(UseToolTipsInLocalsView), 0);
- m_group->insert(action(AlwaysAdjustColumnWidths), 0);
- m_group->insert(action(UseToolTipsInBreakpointsView), 0);
- m_group->insert(action(UseToolTipsInStackView), 0);
- m_group->insert(action(UseAddressInBreakpointsView), 0);
- m_group->insert(action(UseAddressInStackView), 0);
- m_group->insert(action(MaximalStackDepth), spinBoxMaximalStackDepth);
- m_group->insert(action(ShowStdNamespace), 0);
- m_group->insert(action(ShowQtNamespace), 0);
- m_group->insert(action(ShowQObjectNames), 0);
- m_group->insert(action(SortStructMembers), 0);
- m_group->insert(action(LogTimeStamps), 0);
- m_group->insert(action(BreakOnThrow), 0);
- m_group->insert(action(BreakOnCatch), 0);
- if (Utils::HostOsInfo::isWindowsHost()) {
- Utils::SavedAction *registerAction = action(RegisterForPostMortem);
- m_group->insert(registerAction,
- checkBoxRegisterForPostMortem);
- connect(registerAction, &QAction::toggled,
- checkBoxRegisterForPostMortem, &QAbstractButton::setChecked);
- } else {
- checkBoxRegisterForPostMortem->setVisible(false);
- }
-}
-
-GlobalDebuggerOptions CommonOptionsPageWidget::globalOptions() const
-{
- GlobalDebuggerOptions o;
- SourcePathMap allPathMap = sourcesMappingWidget->sourcePathMap();
- for (auto it = allPathMap.begin(), end = allPathMap.end(); it != end; ++it) {
- const QString key = it.key();
- if (key.startsWith(QLatin1Char('(')))
- o.sourcePathRegExpMap.append(qMakePair(QRegExp(key), it.value()));
- else
- o.sourcePathMap.insert(key, it.value());
- }
- return o;
-}
-
-void CommonOptionsPageWidget::setGlobalOptions(const GlobalDebuggerOptions &go)
-{
- SourcePathMap allPathMap = go.sourcePathMap;
- foreach (auto regExpMap, go.sourcePathRegExpMap)
- allPathMap.insert(regExpMap.first.pattern(), regExpMap.second);
-
- sourcesMappingWidget->setSourcePathMap(allPathMap);
-}
-
///////////////////////////////////////////////////////////////////////
//
// CommonOptionsPage
@@ -260,41 +63,184 @@ CommonOptionsPage::CommonOptionsPage(const QSharedPointer<GlobalDebuggerOptions>
setDisplayName(QCoreApplication::translate("Debugger", "General"));
setCategory(DEBUGGER_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("Debugger", DEBUGGER_SETTINGS_TR_CATEGORY));
- setCategoryIcon(Utils::Icon(DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON));
-}
-
-CommonOptionsPage::~CommonOptionsPage()
-{
+ setCategoryIcon(Icon(DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON));
}
void CommonOptionsPage::apply()
{
- QTC_ASSERT(!m_widget.isNull() && !m_group.isNull(), return);
+ m_group.apply(ICore::settings());
- m_group->apply(ICore::settings());
+ GlobalDebuggerOptions newOptions;
+ SourcePathMap allPathMap = m_sourceMappingWidget->sourcePathMap();
+ for (auto it = allPathMap.begin(), end = allPathMap.end(); it != end; ++it) {
+ const QString key = it.key();
+ if (key.startsWith(QLatin1Char('(')))
+ newOptions.sourcePathRegExpMap.append(qMakePair(QRegExp(key), it.value()));
+ else
+ newOptions.sourcePathMap.insert(key, it.value());
+ }
- const GlobalDebuggerOptions newGlobalOptions = m_widget->globalOptions();
- if (newGlobalOptions != *m_options) {
- *m_options = newGlobalOptions;
+ if (newOptions.sourcePathMap != m_options->sourcePathMap
+ || newOptions.sourcePathRegExpMap != m_options->sourcePathRegExpMap) {
+ *m_options = newOptions;
m_options->toSettings();
}
}
void CommonOptionsPage::finish()
{
- if (!m_group.isNull())
- m_group->finish();
+ m_group.finish();
delete m_widget;
}
QWidget *CommonOptionsPage::widget()
{
- if (m_group.isNull())
- m_group = QSharedPointer<Utils::SavedActionSet>(new Utils::SavedActionSet);
-
if (!m_widget) {
- m_widget = new CommonOptionsPageWidget(m_group);
- m_widget->setGlobalOptions(*m_options);
+ m_widget = new QWidget;
+
+ auto behaviorBox = new QGroupBox(m_widget);
+ behaviorBox->setTitle(tr("Behavior"));
+
+ auto checkBoxUseAlternatingRowColors = new QCheckBox(behaviorBox);
+ checkBoxUseAlternatingRowColors->setText(tr("Use alternating row colors in debug views"));
+
+ auto checkBoxFontSizeFollowsEditor = new QCheckBox(behaviorBox);
+ checkBoxFontSizeFollowsEditor->setToolTip(tr("Changes the font size in the debugger views when the font size in the main editor changes."));
+ checkBoxFontSizeFollowsEditor->setText(tr("Debugger font size follows main editor"));
+
+ auto checkBoxUseToolTipsInMainEditor = new QCheckBox(behaviorBox);
+ checkBoxUseToolTipsInMainEditor->setText(tr("Use tooltips in main editor while debugging"));
+
+ QString t = tr("Stopping and stepping in the debugger "
+ "will automatically open views associated with the current location.") + QLatin1Char('\n');
+ auto checkBoxCloseSourceBuffersOnExit = new QCheckBox(behaviorBox);
+ checkBoxCloseSourceBuffersOnExit->setText(tr("Close temporary source views on debugger exit"));
+ checkBoxCloseSourceBuffersOnExit->setToolTip(t + tr("Select this option to close "
+ "automatically opened source views when the debugger exits."));
+
+ auto checkBoxCloseMemoryBuffersOnExit = new QCheckBox(behaviorBox);
+ checkBoxCloseMemoryBuffersOnExit->setText(tr("Close temporary memory views on debugger exit"));
+ checkBoxCloseMemoryBuffersOnExit->setToolTip(t + tr("Select this option to close "
+ "automatically opened memory views when the debugger exits."));
+
+ auto checkBoxSwitchModeOnExit = new QCheckBox(behaviorBox);
+ checkBoxSwitchModeOnExit->setText(tr("Switch to previous mode on debugger exit"));
+
+ auto checkBoxBringToForegroundOnInterrrupt = new QCheckBox(behaviorBox);
+ checkBoxBringToForegroundOnInterrrupt->setText(tr("Bring Qt Creator to foreground when application interrupts"));
+
+ auto checkBoxShowQmlObjectTree = new QCheckBox(behaviorBox);
+ checkBoxShowQmlObjectTree->setToolTip(tr("Shows QML object tree in Locals and Expressions when connected and not stepping."));
+ checkBoxShowQmlObjectTree->setText(tr("Show QML object tree"));
+
+ auto checkBoxBreakpointsFullPath = new QCheckBox(behaviorBox);
+ checkBoxBreakpointsFullPath->setToolTip(tr("Enables a full file path in breakpoints by default also for GDB."));
+ checkBoxBreakpointsFullPath->setText(tr("Set breakpoints using a full absolute path"));
+
+ auto checkBoxRegisterForPostMortem = new QCheckBox(behaviorBox);
+ checkBoxRegisterForPostMortem->setToolTip(tr("Registers Qt Creator for debugging crashed applications."));
+ checkBoxRegisterForPostMortem->setText(tr("Use Qt Creator for post-mortem debugging"));
+
+ auto checkBoxWarnOnReleaseBuilds = new QCheckBox(behaviorBox);
+ checkBoxWarnOnReleaseBuilds->setText(tr("Warn when debugging \"Release\" builds"));
+ checkBoxWarnOnReleaseBuilds->setToolTip(tr("Shows a warning when starting the debugger "
+ "on a binary with insufficient debug information."));
+
+ auto checkBoxKeepEditorStationaryWhileStepping = new QCheckBox(behaviorBox);
+ checkBoxKeepEditorStationaryWhileStepping->setText(tr("Keep editor stationary when stepping"));
+ checkBoxKeepEditorStationaryWhileStepping->setToolTip(tr("Scrolls the editor only when it is necessary "
+ "to keep the current line in view, "
+ "instead of keeping the next statement centered at "
+ "all times."));
+
+ auto labelMaximalStackDepth = new QLabel(tr("Maximum stack depth:"), behaviorBox);
+
+ auto spinBoxMaximalStackDepth = new QSpinBox(behaviorBox);
+ spinBoxMaximalStackDepth->setSpecialValueText(tr("<unlimited>"));
+ spinBoxMaximalStackDepth->setMaximum(999);
+ spinBoxMaximalStackDepth->setSingleStep(5);
+ spinBoxMaximalStackDepth->setValue(10);
+
+ m_sourceMappingWidget = new DebuggerSourcePathMappingWidget(m_widget);
+
+ auto horizontalLayout = new QHBoxLayout;
+ horizontalLayout->addWidget(labelMaximalStackDepth);
+ horizontalLayout->addWidget(spinBoxMaximalStackDepth);
+ horizontalLayout->addStretch();
+
+ auto gridLayout = new QGridLayout(behaviorBox);
+ gridLayout->addWidget(checkBoxUseAlternatingRowColors, 0, 0, 1, 1);
+ gridLayout->addWidget(checkBoxUseToolTipsInMainEditor, 1, 0, 1, 1);
+ gridLayout->addWidget(checkBoxCloseSourceBuffersOnExit, 2, 0, 1, 1);
+ gridLayout->addWidget(checkBoxCloseMemoryBuffersOnExit, 3, 0, 1, 1);
+ gridLayout->addWidget(checkBoxBringToForegroundOnInterrrupt, 4, 0, 1, 1);
+ gridLayout->addWidget(checkBoxBreakpointsFullPath, 5, 0, 1, 1);
+ gridLayout->addWidget(checkBoxWarnOnReleaseBuilds, 6, 0, 1, 1);
+ gridLayout->addLayout(horizontalLayout, 7, 0, 1, 2);
+
+ gridLayout->addWidget(checkBoxFontSizeFollowsEditor, 0, 1, 1, 1);
+ gridLayout->addWidget(checkBoxSwitchModeOnExit, 1, 1, 1, 1);
+ gridLayout->addWidget(checkBoxShowQmlObjectTree, 2, 1, 1, 1);
+ gridLayout->addWidget(checkBoxKeepEditorStationaryWhileStepping, 3, 1, 1, 1);
+ gridLayout->addWidget(checkBoxRegisterForPostMortem, 4, 1, 1, 1);
+
+ auto verticalLayout = new QVBoxLayout(m_widget);
+ verticalLayout->addWidget(behaviorBox);
+ verticalLayout->addWidget(m_sourceMappingWidget);
+ verticalLayout->addStretch();
+
+ m_group.clear();
+
+ m_group.insert(action(UseAlternatingRowColors),
+ checkBoxUseAlternatingRowColors);
+ m_group.insert(action(UseToolTipsInMainEditor),
+ checkBoxUseToolTipsInMainEditor);
+ m_group.insert(action(CloseSourceBuffersOnExit),
+ checkBoxCloseSourceBuffersOnExit);
+ m_group.insert(action(CloseMemoryBuffersOnExit),
+ checkBoxCloseMemoryBuffersOnExit);
+ m_group.insert(action(SwitchModeOnExit),
+ checkBoxSwitchModeOnExit);
+ m_group.insert(action(BreakpointsFullPathByDefault),
+ checkBoxBreakpointsFullPath);
+ m_group.insert(action(RaiseOnInterrupt),
+ checkBoxBringToForegroundOnInterrrupt);
+ m_group.insert(action(ShowQmlObjectTree),
+ checkBoxShowQmlObjectTree);
+ m_group.insert(action(WarnOnReleaseBuilds),
+ checkBoxWarnOnReleaseBuilds);
+ m_group.insert(action(StationaryEditorWhileStepping),
+ checkBoxKeepEditorStationaryWhileStepping);
+ m_group.insert(action(FontSizeFollowsEditor),
+ checkBoxFontSizeFollowsEditor);
+ m_group.insert(action(AutoDerefPointers), 0);
+ m_group.insert(action(UseToolTipsInLocalsView), 0);
+ m_group.insert(action(AlwaysAdjustColumnWidths), 0);
+ m_group.insert(action(UseToolTipsInBreakpointsView), 0);
+ m_group.insert(action(UseToolTipsInStackView), 0);
+ m_group.insert(action(UseAddressInBreakpointsView), 0);
+ m_group.insert(action(UseAddressInStackView), 0);
+ m_group.insert(action(MaximalStackDepth), spinBoxMaximalStackDepth);
+ m_group.insert(action(ShowStdNamespace), 0);
+ m_group.insert(action(ShowQtNamespace), 0);
+ m_group.insert(action(ShowQObjectNames), 0);
+ m_group.insert(action(SortStructMembers), 0);
+ m_group.insert(action(LogTimeStamps), 0);
+ m_group.insert(action(BreakOnThrow), 0);
+ m_group.insert(action(BreakOnCatch), 0);
+ if (HostOsInfo::isWindowsHost()) {
+ SavedAction *registerAction = action(RegisterForPostMortem);
+ m_group.insert(registerAction, checkBoxRegisterForPostMortem);
+ connect(registerAction, &QAction::toggled,
+ checkBoxRegisterForPostMortem, &QAbstractButton::setChecked);
+ } else {
+ checkBoxRegisterForPostMortem->setVisible(false);
+ }
+
+ SourcePathMap allPathMap = m_options->sourcePathMap;
+ foreach (auto regExpMap, m_options->sourcePathRegExpMap)
+ allPathMap.insert(regExpMap.first.pattern(), regExpMap.second);
+ m_sourceMappingWidget->setSourcePathMap(allPathMap);
}
return m_widget;
}
@@ -331,7 +277,7 @@ LocalsAndExpressionsOptionsPage::LocalsAndExpressionsOptionsPage()
setDisplayName(QCoreApplication::translate("Debugger", "Locals && Expressions"));
setCategory(DEBUGGER_SETTINGS_CATEGORY);
setDisplayCategory(QCoreApplication::translate("Debugger", DEBUGGER_SETTINGS_TR_CATEGORY));
- setCategoryIcon(Utils::Icon(DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON));
+ setCategoryIcon(Icon(DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON));
}
void LocalsAndExpressionsOptionsPage::apply()
@@ -428,5 +374,3 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
} // namespace Internal
} // namespace Debugger
-
-#include "commonoptionspage.moc"
diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h
index 05f4a120fa..ea2383f54c 100644
--- a/src/plugins/debugger/commonoptionspage.h
+++ b/src/plugins/debugger/commonoptionspage.h
@@ -33,15 +33,11 @@
#include <QPointer>
#include <QSharedPointer>
-QT_BEGIN_NAMESPACE
-class QSpinBox;
-QT_END_NAMESPACE
-
namespace Debugger {
namespace Internal {
class GlobalDebuggerOptions;
-class CommonOptionsPageWidget;
+class DebuggerSourcePathMappingWidget;
///////////////////////////////////////////////////////////////////////
//
@@ -55,21 +51,21 @@ class CommonOptionsPage : public Core::IOptionsPage
public:
explicit CommonOptionsPage(const QSharedPointer<GlobalDebuggerOptions> &go);
- ~CommonOptionsPage();
// IOptionsPage
- QWidget *widget();
- void apply();
- void finish();
+ QWidget *widget() final;
+ void apply() final;
+ void finish() final;
static QString msgSetBreakpointAtFunction(const char *function);
static QString msgSetBreakpointAtFunctionToolTip(const char *function,
const QString &hint = QString());
private:
+ QPointer<QWidget> m_widget;
+ Utils::SavedActionSet m_group;
const QSharedPointer<GlobalDebuggerOptions> m_options;
- QSharedPointer<Utils::SavedActionSet> m_group;
- QPointer<CommonOptionsPageWidget> m_widget;
+ DebuggerSourcePathMappingWidget *m_sourceMappingWidget = nullptr;
};
@@ -87,9 +83,9 @@ public:
LocalsAndExpressionsOptionsPage();
// IOptionsPage
- QWidget *widget();
- void apply();
- void finish();
+ QWidget *widget() final;
+ void apply() final;
+ void finish() final;
private:
QPointer<QWidget> m_widget;
diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs
index b80189782d..626be0e04f 100644
--- a/src/plugins/debugger/debugger.qbs
+++ b/src/plugins/debugger/debugger.qbs
@@ -21,12 +21,6 @@ Project {
Depends { name: "QtSupport" }
Depends { name: "TextEditor" }
-
- Depends {
- name: "Qt.test"
- condition: qtc.testsEnabled
- }
-
pluginTestDepends: [
"QmakeProjectManager"
]
diff --git a/src/plugins/debugger/debugger.qrc b/src/plugins/debugger/debugger.qrc
index f49e25cd7b..301234efae 100644
--- a/src/plugins/debugger/debugger.qrc
+++ b/src/plugins/debugger/debugger.qrc
@@ -25,8 +25,6 @@
<file>images/debugger_stepout_small@2x.png</file>
<file>images/debugger_stepover_small.png</file>
<file>images/debugger_stepover_small@2x.png</file>
- <file>images/breakpoint.png</file>
- <file>images/breakpoint@2x.png</file>
<file>images/breakpoint_disabled.png</file>
<file>images/breakpoint_disabled@2x.png</file>
<file>images/breakpoint_pending_overlay.png</file>
diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h
index b1f180c53c..4cf54ea50c 100644
--- a/src/plugins/debugger/debuggeractions.h
+++ b/src/plugins/debugger/debuggeractions.h
@@ -45,15 +45,6 @@ class GlobalDebuggerOptions
public:
void toSettings() const;
void fromSettings();
- bool operator==(const GlobalDebuggerOptions &rhs) const
- {
- return sourcePathMap == rhs.sourcePathMap
- && sourcePathRegExpMap == rhs.sourcePathRegExpMap;
- }
- bool operator!=(const GlobalDebuggerOptions &rhs) const
- {
- return !(*this == rhs);
- }
SourcePathMap sourcePathMap;
SourcePathRegExpMap sourcePathRegExpMap;
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index e96885a9cc..f23da12034 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -1240,6 +1240,7 @@ void DebuggerEngine::notifyDebuggerProcessFinished(int exitCode,
// Nothing to do.
break;
case EngineShutdownRequested:
+ case InferiorShutdownRequested:
notifyEngineShutdownOk();
break;
case InferiorRunOk:
@@ -2059,7 +2060,7 @@ void DebuggerEngine::updateItem(const QString &iname)
WatchModelBase *model = handler->model();
QTC_CHECK(model);
if (item && !model->hasChildren(model->indexForItem(item))) {
- handler->notifyUpdateStarted({iname});
+ handler->notifyUpdateStarted(UpdateParameters(iname));
item->setValue(decodeData({}, "notaccessible"));
item->setHasChildren(false);
item->outdated = false;
diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h
index e2dfd41d32..770d079c44 100644
--- a/src/plugins/debugger/debuggerengine.h
+++ b/src/plugins/debugger/debuggerengine.h
@@ -122,7 +122,8 @@ public:
class UpdateParameters
{
public:
- UpdateParameters() {}
+ UpdateParameters(const QString &partialVariable = QString()) :
+ partialVariable(partialVariable) {}
QStringList partialVariables() const
{
diff --git a/src/plugins/debugger/debuggericons.cpp b/src/plugins/debugger/debuggericons.cpp
index e16fd5cd0f..3fc7fd50b9 100644
--- a/src/plugins/debugger/debuggericons.cpp
+++ b/src/plugins/debugger/debuggericons.cpp
@@ -31,11 +31,11 @@ namespace Debugger {
namespace Icons {
const Icon BREAKPOINT({
- {":/debugger/images/breakpoint.png", Theme::IconsErrorColor}}, Icon::Tint);
+ {":/utils/images/filledcircle.png", Theme::IconsErrorColor}}, Icon::Tint);
const Icon BREAKPOINT_DISABLED({
{":/debugger/images/breakpoint_disabled.png", Theme::IconsErrorColor}}, Icon::Tint);
const Icon BREAKPOINT_PENDING({
- {":/debugger/images/breakpoint.png", Theme::IconsErrorColor},
+ {":/utils/images/filledcircle.png", Theme::IconsErrorColor},
{":/debugger/images/breakpoint_pending_overlay.png", Theme::PanelTextColorDark}}, Icon::IconStyleOptions(Icon::Tint | Icon::PunchEdges));
const Icon BREAKPOINTS(
":/debugger/images/debugger_breakpoints.png");
diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp
index da20b9170c..6aaaa4074c 100644
--- a/src/plugins/debugger/debuggerkitinformation.cpp
+++ b/src/plugins/debugger/debuggerkitinformation.cpp
@@ -294,7 +294,7 @@ QList<Task> DebuggerKitInformation::validateDebugger(const Kit *k)
if (errors & DebuggerDoesNotMatch) {
const QString message = tr("The ABI of the selected debugger does not "
"match the toolchain ABI.");
- result << Task(Task::Error, message, FileName(), -1, id);
+ result << Task(Task::Warning, message, FileName(), -1, id);
}
return result;
}
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index 47dc345feb..c31cbff994 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -474,9 +474,13 @@ static DebuggerRunControl *doCreate(DebuggerRunParameters rp, RunConfiguration *
if (rp.languages & CppLanguage) {
const QList<Task> tasks = DebuggerKitInformation::validateDebugger(kit);
if (!tasks.isEmpty()) {
- foreach (const Task &t, tasks)
+ foreach (const Task &t, tasks) {
+ if (t.type == Task::Warning)
+ continue;
errors->append(t.description);
- return 0;
+ }
+ if (!errors->isEmpty())
+ return 0;
}
}
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index cdcdb13c55..53f94c4f6b 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -4493,7 +4493,7 @@ void GdbEngine::doUpdateLocals(const UpdateParameters &params)
{
m_pendingBreakpointRequests = 0;
- watchHandler()->notifyUpdateStarted(params.partialVariables());
+ watchHandler()->notifyUpdateStarted(params);
DebuggerCommand cmd("fetchVariables", Discardable|InUpdateLocals|PythonCommand);
watchHandler()->appendFormatRequests(&cmd);
diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp
index 0b79fdbb0a..eba04d0ca1 100644
--- a/src/plugins/debugger/lldb/lldbengine.cpp
+++ b/src/plugins/debugger/lldb/lldbengine.cpp
@@ -796,7 +796,7 @@ void LldbEngine::assignValueInDebugger(WatchItem *,
void LldbEngine::doUpdateLocals(const UpdateParameters &params)
{
- watchHandler()->notifyUpdateStarted(params.partialVariables());
+ watchHandler()->notifyUpdateStarted(params);
DebuggerCommand cmd("fetchVariables");
watchHandler()->appendFormatRequests(&cmd);
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index c3aec855a0..83f3fed071 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -1087,6 +1087,12 @@ void QmlEngine::quitDebugger()
shutdownInferior();
}
+void QmlEngine::doUpdateLocals(const UpdateParameters &params)
+{
+ Q_UNUSED(params);
+ d->updateLocals();
+}
+
void QmlEngine::disconnected()
{
showMessage(tr("QML Debugger disconnected."), StatusBar);
@@ -2150,7 +2156,7 @@ void QmlEnginePrivate::handleFrame(const QVariantMap &response)
StackHandler *stackHandler = engine->stackHandler();
WatchHandler * watchHandler = engine->watchHandler();
- watchHandler->notifyUpdateStarted({"local"});
+ watchHandler->notifyUpdateStarted();
const int frameIndex = stackHandler->currentIndex();
if (frameIndex < 0)
diff --git a/src/plugins/debugger/qml/qmlengine.h b/src/plugins/debugger/qml/qmlengine.h
index 2ce3efd73e..1f6b9c9bbe 100644
--- a/src/plugins/debugger/qml/qmlengine.h
+++ b/src/plugins/debugger/qml/qmlengine.h
@@ -129,6 +129,8 @@ private:
bool hasCapability(unsigned) const override;
void quitDebugger() override;
+ void doUpdateLocals(const UpdateParameters &params) override;
+
void closeConnection();
void startApplicationLauncher();
void stopApplicationLauncher();
diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp
index 30d72c378c..0f430bb45e 100644
--- a/src/plugins/debugger/qml/qmlinspectoragent.cpp
+++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp
@@ -84,6 +84,8 @@ QmlInspectorAgent::QmlInspectorAgent(QmlEngine *engine, QmlDebugConnection *conn
m_debugIdToIname.insert(WatchItem::InvalidId, "inspect");
connect(action(ShowQmlObjectTree),
&Utils::SavedAction::valueChanged, this, &QmlInspectorAgent::updateState);
+ connect(action(SortStructMembers), &Utils::SavedAction::valueChanged,
+ this, &QmlInspectorAgent::updateState);
m_delayQueryTimer.setSingleShot(true);
m_delayQueryTimer.setInterval(100);
connect(&m_delayQueryTimer, &QTimer::timeout,
diff --git a/src/plugins/debugger/registerhandler.cpp b/src/plugins/debugger/registerhandler.cpp
index ea914102b0..187a769eaa 100644
--- a/src/plugins/debugger/registerhandler.cpp
+++ b/src/plugins/debugger/registerhandler.cpp
@@ -748,7 +748,7 @@ bool RegisterHandler::contextMenuEvent(const ItemViewEvent &ev)
};
addFormatAction(tr("Hexadecimal"), HexadecimalFormat);
- addFormatAction(tr("DecimalFormat"), DecimalFormat);
+ addFormatAction(tr("Decimal"), DecimalFormat);
addFormatAction(tr("Octal"), OctalFormat);
addFormatAction(tr("Binary"), BinaryFormat);
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 1b47b7cf95..b0de874251 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -1755,8 +1755,9 @@ QMenu *WatchModel::createFormatMenu(WatchItem *item)
const DisplayFormats alternativeFormats = typeFormatList(item);
+ const QString iname = item->iname;
const int typeFormat = theTypeFormats.value(stripForFormat(item->type), AutomaticFormat);
- const int individualFormat = theIndividualFormats.value(item->iname, AutomaticFormat);
+ const int individualFormat = theIndividualFormats.value(iname, AutomaticFormat);
auto addBaseChangeAction = [this, menu](const QString &text, int base) {
addCheckableAction(menu, text, true, theUnprintableBase == base, [this, base] {
@@ -1775,26 +1776,26 @@ QMenu *WatchModel::createFormatMenu(WatchItem *item)
const QString spacer = " ";
menu->addSeparator();
- addAction(menu, tr("Change Display for Object Named \"%1\":").arg(item->name), false);
+ addAction(menu, tr("Change Display for Object Named \"%1\":").arg(iname), false);
QString msg = (individualFormat == AutomaticFormat && typeFormat != AutomaticFormat)
? tr("Use Format for Type (Currently %1)").arg(nameForFormat(typeFormat))
: QString(tr("Use Display Format Based on Type") + ' ');
addCheckableAction(menu, spacer + msg, true, individualFormat == AutomaticFormat,
- [this, item] {
+ [this, iname] {
// FIXME: Extend to multi-selection.
//const QModelIndexList active = activeRows();
//foreach (const QModelIndex &idx, active)
// setModelData(LocalsIndividualFormatRole, AutomaticFormat, idx);
- setIndividualFormat(item->iname, AutomaticFormat);
+ setIndividualFormat(iname, AutomaticFormat);
m_engine->updateLocals();
});
for (int format : alternativeFormats) {
addCheckableAction(menu, spacer + nameForFormat(format), true, format == individualFormat,
- [this, act, format, item] {
- setIndividualFormat(item->iname, format);
+ [this, act, format, iname] {
+ setIndividualFormat(iname, format);
m_engine->updateLocals();
});
}
@@ -1803,18 +1804,18 @@ QMenu *WatchModel::createFormatMenu(WatchItem *item)
addAction(menu, tr("Change Display for Type \"%1\":").arg(item->type), false);
addCheckableAction(menu, spacer + tr("Automatic"), true, typeFormat == AutomaticFormat,
- [this, item] {
+ [this, iname] {
//const QModelIndexList active = activeRows();
//foreach (const QModelIndex &idx, active)
// setModelData(LocalsTypeFormatRole, AutomaticFormat, idx);
- setTypeFormat(item->iname, AutomaticFormat);
+ setTypeFormat(iname, AutomaticFormat);
m_engine->updateLocals();
});
for (int format : alternativeFormats) {
addCheckableAction(menu, spacer + nameForFormat(format), true, format == typeFormat,
- [this, act, format, item] {
- setTypeFormat(item->iname, format);
+ [this, act, format, iname] {
+ setTypeFormat(iname, format);
m_engine->updateLocals();
});
}
@@ -1999,8 +2000,12 @@ void WatchHandler::resetWatchers()
loadSessionData();
}
-void WatchHandler::notifyUpdateStarted(const QStringList &inames)
+void WatchHandler::notifyUpdateStarted(const UpdateParameters &updateParameters)
{
+ QStringList inames = updateParameters.partialVariables();
+ if (inames.isEmpty())
+ inames.append("local");
+
auto marker = [](WatchItem *item) { item->outdated = true; };
if (inames.isEmpty()) {
diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h
index cf62cf2aed..e47fa012fd 100644
--- a/src/plugins/debugger/watchhandler.h
+++ b/src/plugins/debugger/watchhandler.h
@@ -26,6 +26,7 @@
#pragma once
#include "watchdata.h"
+#include "debuggerengine.h"
#include <QVector>
@@ -111,7 +112,7 @@ public:
void resetValueCache();
void resetWatchers();
- void notifyUpdateStarted(const QStringList &inames = {});
+ void notifyUpdateStarted(const UpdateParameters &updateParameters = UpdateParameters());
void notifyUpdateFinished();
void reexpandItems();
diff --git a/src/plugins/designer/designer.qbs b/src/plugins/designer/designer.qbs
index fe903990cf..b991840f91 100644
--- a/src/plugins/designer/designer.qbs
+++ b/src/plugins/designer/designer.qbs
@@ -4,7 +4,10 @@ import qbs.FileInfo
QtcPlugin {
name: "Designer"
- Depends { name: "Qt"; submodules: ["widgets", "xml", "printsupport", "designer", "designercomponents"] }
+ Depends {
+ name: "Qt"
+ submodules: ["widgets", "xml", "printsupport", "designer", "designercomponents-private"]
+ }
Depends { name: "CPlusPlus" }
Depends { name: "Utils" }
diff --git a/src/plugins/git/commitdata.cpp b/src/plugins/git/commitdata.cpp
index 3ba792ae50..d48aeb4906 100644
--- a/src/plugins/git/commitdata.cpp
+++ b/src/plugins/git/commitdata.cpp
@@ -94,6 +94,8 @@ static FileStates stateFor(const QChar &c)
return CopiedFile;
case 'U':
return UnmergedFile;
+ case 'T':
+ return TypeChangedFile;
case '?':
return UntrackedFile;
default:
@@ -195,27 +197,29 @@ QString CommitData::stateDisplayName(const FileStates &state)
{
QString resultState;
if (state == UntrackedFile)
- return QCoreApplication::translate("Git::Internal::CommitData", "untracked");
+ return tr("untracked");
if (state & StagedFile)
- resultState = QCoreApplication::translate("Git::Internal::CommitData", "staged + ");
+ resultState = tr("staged + ");
if (state & ModifiedFile)
- resultState.append(QCoreApplication::translate("Git::Internal::CommitData", "modified"));
+ resultState.append(tr("modified"));
else if (state & AddedFile)
- resultState.append(QCoreApplication::translate("Git::Internal::CommitData", "added"));
+ resultState.append(tr("added"));
else if (state & DeletedFile)
- resultState.append(QCoreApplication::translate("Git::Internal::CommitData", "deleted"));
+ resultState.append(tr("deleted"));
else if (state & RenamedFile)
- resultState.append(QCoreApplication::translate("Git::Internal::CommitData", "renamed"));
+ resultState.append(tr("renamed"));
else if (state & CopiedFile)
- resultState.append(QCoreApplication::translate("Git::Internal::CommitData", "copied"));
+ resultState.append(tr("copied"));
+ else if (state & TypeChangedFile)
+ resultState.append(tr("typechange"));
if (state & UnmergedUs) {
if (state & UnmergedThem)
- resultState.append(QCoreApplication::translate("Git::Internal::CommitData", " by both"));
+ resultState.append(tr(" by both"));
else
- resultState.append(QCoreApplication::translate("Git::Internal::CommitData", " by us"));
+ resultState.append(tr(" by us"));
} else if (state & UnmergedThem) {
- resultState.append(QCoreApplication::translate("Git::Internal::CommitData", " by them"));
+ resultState.append(tr(" by them"));
}
return resultState;
}
diff --git a/src/plugins/git/commitdata.h b/src/plugins/git/commitdata.h
index e9ad1abdc6..06eeedf336 100644
--- a/src/plugins/git/commitdata.h
+++ b/src/plugins/git/commitdata.h
@@ -27,6 +27,7 @@
#include "gitsettings.h" // CommitType
+#include <QCoreApplication>
#include <QStringList>
#include <QPair>
@@ -71,6 +72,7 @@ enum FileState {
RenamedFile = 0x10,
CopiedFile = 0x20,
UnmergedFile = 0x40,
+ TypeChangedFile = 0x80,
UnmergedUs = 0x100,
UnmergedThem = 0x200,
@@ -82,6 +84,8 @@ Q_DECLARE_FLAGS(FileStates, FileState)
class CommitData
{
+ Q_DECLARE_TR_FUNCTIONS(Git::Internal::CommitData)
+
public:
CommitData(CommitType type = SimpleCommit);
// A pair of state string/file name ('modified', 'file.cpp').
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 4b25cecf62..3ab1733a05 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -2477,7 +2477,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
filesToAdd.append(file);
if ((state & StagedFile) && !checked) {
- if (state & (ModifiedFile | AddedFile | DeletedFile)) {
+ if (state & (ModifiedFile | AddedFile | DeletedFile | TypeChangedFile)) {
filesToReset.append(file);
} else if (state & (RenamedFile | CopiedFile)) {
const QString newFile = file.mid(file.indexOf(renameSeparator) + renameSeparator.count());
@@ -2487,7 +2487,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
QTC_ASSERT(false, continue); // There should not be unmerged files when committing!
}
- if (state == ModifiedFile && checked) {
+ if ((state == ModifiedFile || state == TypeChangedFile) && checked) {
filesToReset.removeAll(file);
filesToAdd.append(file);
} else if (state == AddedFile && checked) {
@@ -2703,7 +2703,8 @@ void GitClient::synchronousAbortCommand(const QString &workingDir, const QString
}
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
- workingDir, { abortCommand, "--abort" }, VcsCommand::ExpectRepoChanges);
+ workingDir, { abortCommand, "--abort" },
+ VcsCommand::ExpectRepoChanges | VcsCommand::ShowSuccessMessage);
VcsOutputWindow::append(resp.stdOut());
}
diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp
index 496e6c3490..05060f413b 100644
--- a/src/plugins/git/gitgrep.cpp
+++ b/src/plugins/git/gitgrep.cpp
@@ -112,6 +112,15 @@ public:
+ text.mid(matchEnd + resetColor.size());
}
single.matchingLine = text;
+
+ if (m_parameters.flags & FindRegularExpression) {
+ const QRegularExpression::PatternOptions patternOptions =
+ (m_parameters.flags & QTextDocument::FindCaseSensitively)
+ ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption;
+ QRegularExpression regexp(m_parameters.text, patternOptions);
+ QRegularExpressionMatch regexpMatch = regexp.match(line);
+ single.regexpCapturedTexts = regexpMatch.capturedTexts();
+ }
foreach (auto match, matches) {
single.matchStart = match.first;
single.matchLength = match.second;
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 98c94260b3..9049828235 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -1396,6 +1396,10 @@ void GitPlugin::testStatusParsing_data()
QTest::newRow(" M") << FileStates(ModifiedFile) << FileStates(UnknownFileState);
QTest::newRow(" D") << FileStates(DeletedFile) << FileStates(UnknownFileState);
+ QTest::newRow(" T") << FileStates(TypeChangedFile) << FileStates(UnknownFileState);
+ QTest::newRow("T ") << (TypeChangedFile | StagedFile) << FileStates(UnknownFileState);
+ QTest::newRow("TM") << (TypeChangedFile | StagedFile) << FileStates(ModifiedFile);
+ QTest::newRow("MT") << (ModifiedFile | StagedFile) << FileStates(TypeChangedFile);
QTest::newRow("M ") << (ModifiedFile | StagedFile) << FileStates(UnknownFileState);
QTest::newRow("MM") << (ModifiedFile | StagedFile) << FileStates(ModifiedFile);
QTest::newRow("MD") << (ModifiedFile | StagedFile) << FileStates(DeletedFile);
diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp
index c43065e24b..5ac2fbdd83 100644
--- a/src/plugins/git/gitsubmiteditor.cpp
+++ b/src/plugins/git/gitsubmiteditor.cpp
@@ -146,7 +146,7 @@ void GitSubmitEditor::setCommitData(const CommitData &d)
return SubmitFileModel::FileUnmerged;
if (state.testFlag(AddedFile) || state.testFlag(UntrackedFile))
return SubmitFileModel::FileAdded;
- if (state.testFlag(ModifiedFile))
+ if (state.testFlag(ModifiedFile) || state.testFlag(TypeChangedFile))
return SubmitFileModel::FileModified;
if (state.testFlag(DeletedFile))
return SubmitFileModel::FileDeleted;
diff --git a/src/plugins/git/logchangedialog.cpp b/src/plugins/git/logchangedialog.cpp
index 301c6ac903..e529ca2246 100644
--- a/src/plugins/git/logchangedialog.cpp
+++ b/src/plugins/git/logchangedialog.cpp
@@ -157,6 +157,7 @@ bool LogChangeWidget::populateLog(const QString &repository, const QString &comm
arguments << (commit.isEmpty() ? "HEAD" : commit);
if (!(flags & IncludeRemotes))
arguments << "--not" << "--remotes";
+ arguments << "--";
QString output;
if (!GitPlugin::client()->synchronousLog(repository, arguments, &output, 0, VcsCommand::NoOutput))
return false;
diff --git a/src/plugins/git/mergetool.cpp b/src/plugins/git/mergetool.cpp
index 75d2f330b3..f25b9fd2d9 100644
--- a/src/plugins/git/mergetool.cpp
+++ b/src/plugins/git/mergetool.cpp
@@ -200,26 +200,39 @@ void MergeTool::prompt(const QString &title, const QString &question)
void MergeTool::readData()
{
+ bool waitForFurtherInput = false;
while (m_process->bytesAvailable()) {
- QByteArray line = m_process->canReadLine() ? m_process->readLine() : m_process->readAllStandardOutput();
+ const bool hasLine = m_process->canReadLine();
+ const QByteArray line = hasLine ? m_process->readLine() : m_process->readAllStandardOutput();
VcsOutputWindow::append(QString::fromLocal8Bit(line));
+ m_line += line;
// {Normal|Deleted|Submodule|Symbolic link} merge conflict for 'foo.cpp'
- int index = line.indexOf(" merge conflict for ");
+ const int index = m_line.indexOf(" merge conflict for ");
if (index != -1) {
- m_mergeType = mergeType(line.left(index));
- int quote = line.indexOf('\'');
- m_fileName = QString::fromLocal8Bit(line.mid(quote + 1, line.lastIndexOf('\'') - quote - 1));
- } else if (line.startsWith(" {local}")) {
- m_localState = parseStatus(line, m_localInfo);
- } else if (line.startsWith(" {remote}")) {
- m_remoteState = parseStatus(line, m_remoteInfo);
+ m_mergeType = mergeType(m_line.left(index));
+ int quote = m_line.indexOf('\'');
+ m_fileName = QString::fromLocal8Bit(m_line.mid(quote + 1, m_line.lastIndexOf('\'') - quote - 1));
+ } else if (m_line.startsWith(" {local}")) {
+ waitForFurtherInput = !hasLine;
+ if (waitForFurtherInput)
+ continue;
+ m_localState = parseStatus(m_line, m_localInfo);
+ m_line.clear();
+ } else if (m_line.startsWith(" {remote}")) {
+ waitForFurtherInput = !hasLine;
+ if (waitForFurtherInput)
+ continue;
+ m_remoteState = parseStatus(m_line, m_remoteInfo);
+ m_line.clear();
chooseAction();
- } else if (line.startsWith("Was the merge successful")) {
+ } else if (m_line.startsWith("Was the merge successful")) {
prompt(tr("Unchanged File"), tr("Was the merge successful?"));
- } else if (line.startsWith("Continue merging")) {
+ } else if (m_line.startsWith("Continue merging")) {
prompt(tr("Continue Merging"), tr("Continue merging other unresolved paths?"));
}
}
+ if (!waitForFurtherInput)
+ m_line.clear();
}
void MergeTool::done()
diff --git a/src/plugins/git/mergetool.h b/src/plugins/git/mergetool.h
index 7217d473f8..f905cf25a0 100644
--- a/src/plugins/git/mergetool.h
+++ b/src/plugins/git/mergetool.h
@@ -82,6 +82,7 @@ private:
QString m_localInfo;
FileState m_remoteState = UnknownState;
QString m_remoteInfo;
+ QByteArray m_line;
bool m_merging = false;
};
diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp
index 20fbd794be..c8ece1871b 100644
--- a/src/plugins/ios/iosrunner.cpp
+++ b/src/plugins/ios/iosrunner.cpp
@@ -58,7 +58,7 @@ IosRunner::IosRunner(QObject *parent, IosRunConfiguration *runConfig, bool cppDe
m_arguments(runConfig->commandLineArguments()),
m_device(DeviceKitInformation::device(runConfig->target()->kit())),
m_cppDebug(cppDebug), m_qmlDebugServices(qmlDebugServices), m_cleanExit(false),
- m_qmlPort(0), m_pid(0)
+ m_pid(0)
{
m_deviceType = runConfig->deviceType();
}
diff --git a/src/plugins/modeleditor/modeleditor.cpp b/src/plugins/modeleditor/modeleditor.cpp
index f0fd3de9e8..ea30818f5a 100644
--- a/src/plugins/modeleditor/modeleditor.cpp
+++ b/src/plugins/modeleditor/modeleditor.cpp
@@ -341,13 +341,13 @@ void ModelEditor::init(QWidget *parent)
syncToggleButton->setDefaultAction(d->actionHandler->synchronizeBrowserAction());
QMenu *syncMenu = new QMenu(syncToggleButton);
QActionGroup *syncGroup = new QActionGroup(syncMenu);
- d->syncBrowserWithDiagramAction = syncMenu->addAction(QStringLiteral("Synchronize Browser with Diagram"));
+ d->syncBrowserWithDiagramAction = syncMenu->addAction(QStringLiteral("Synchronize Structure with Diagram"));
d->syncBrowserWithDiagramAction->setCheckable(true);
d->syncBrowserWithDiagramAction->setActionGroup(syncGroup);
- d->syncDiagramWithBrowserAction = syncMenu->addAction(QStringLiteral("Synchronize Diagram with Browser"));
+ d->syncDiagramWithBrowserAction = syncMenu->addAction(QStringLiteral("Synchronize Diagram with Structure"));
d->syncDiagramWithBrowserAction->setCheckable(true);
d->syncDiagramWithBrowserAction->setActionGroup(syncGroup);
- d->syncEachOtherAction = syncMenu->addAction(QStringLiteral("Synchronize Each Other"));
+ d->syncEachOtherAction = syncMenu->addAction(QStringLiteral("Keep Synchronized"));
d->syncEachOtherAction->setCheckable(true);
d->syncEachOtherAction->setActionGroup(syncGroup);
syncToggleButton->setMenu(syncMenu);
diff --git a/src/plugins/nim/Nim.mimetypes.xml b/src/plugins/nim/Nim.mimetypes.xml
index 3e06d398fd..f7e94aa3dd 100644
--- a/src/plugins/nim/Nim.mimetypes.xml
+++ b/src/plugins/nim/Nim.mimetypes.xml
@@ -12,4 +12,10 @@
<comment>Nim source file </comment>
<glob pattern="*.nim"/>
</mime-type>
+
+ <mime-type type="text/x-nim-script">
+ <sub-class-of type="text/plain"/>
+ <comment>Nim script file </comment>
+ <glob pattern="*.nims"/>
+ </mime-type>
</mime-info>
diff --git a/src/plugins/nim/editor/nimeditorfactory.cpp b/src/plugins/nim/editor/nimeditorfactory.cpp
index 32e23d0eeb..8e733b2adb 100644
--- a/src/plugins/nim/editor/nimeditorfactory.cpp
+++ b/src/plugins/nim/editor/nimeditorfactory.cpp
@@ -45,6 +45,7 @@ NimEditorFactory::NimEditorFactory()
setId(Constants::C_NIMEDITOR_ID);
setDisplayName(tr(Nim::Constants::C_EDITOR_DISPLAY_NAME));
addMimeType(QLatin1String(Nim::Constants::C_NIM_MIMETYPE));
+ addMimeType(QLatin1String(Nim::Constants::C_NIM_SCRIPT_MIMETYPE));
setEditorActionHandlers(TextEditorActionHandler::Format
| TextEditorActionHandler::UnCommentSelection
diff --git a/src/plugins/nim/nimconstants.h b/src/plugins/nim/nimconstants.h
index 7f2dc90d8e..65fbeb611f 100644
--- a/src/plugins/nim/nimconstants.h
+++ b/src/plugins/nim/nimconstants.h
@@ -104,6 +104,7 @@ const char C_NIMCODESTYLEPREVIEWSNIPPET[] =
* MIME type
******************************************************************************/
const char C_NIM_MIMETYPE[] = "text/x-nim";
+const char C_NIM_SCRIPT_MIMETYPE[] = "text/x-nim-script";
const char C_NIM_MIME_ICON[] = "text-x-nim";
const char C_NIM_PROJECT_MIMETYPE[] = "text/x-nim-project";
diff --git a/src/plugins/nim/nimplugin.cpp b/src/plugins/nim/nimplugin.cpp
index b89676e0eb..98760d7b6e 100644
--- a/src/plugins/nim/nimplugin.cpp
+++ b/src/plugins/nim/nimplugin.cpp
@@ -81,8 +81,10 @@ bool NimPlugin::initialize(const QStringList &arguments, QString *errorMessage)
// Add MIME overlay icons (these icons displayed at Project dock panel)
const QIcon icon((QLatin1String(Constants::C_NIM_ICON_PATH)));
- if (!icon.isNull())
+ if (!icon.isNull()) {
Core::FileIconProvider::registerIconOverlayForMimeType(icon, Constants::C_NIM_MIMETYPE);
+ Core::FileIconProvider::registerIconOverlayForMimeType(icon, Constants::C_NIM_SCRIPT_MIMETYPE);
+ }
return true;
}
diff --git a/src/plugins/nim/settings/nimsettings.cpp b/src/plugins/nim/settings/nimsettings.cpp
index 40ac7b74a2..cd43df4849 100644
--- a/src/plugins/nim/settings/nimsettings.cpp
+++ b/src/plugins/nim/settings/nimsettings.cpp
@@ -80,6 +80,7 @@ NimSettings::NimSettings(QObject *parent)
m_globalCodeStyle->fromSettings(QLatin1String(Nim::Constants::C_NIMLANGUAGE_ID), s);
TextEditorSettings::registerMimeTypeForLanguageId(Nim::Constants::C_NIM_MIMETYPE, Nim::Constants::C_NIMLANGUAGE_ID);
+ TextEditorSettings::registerMimeTypeForLanguageId(Nim::Constants::C_NIM_SCRIPT_MIMETYPE, Nim::Constants::C_NIMLANGUAGE_ID);
}
NimSettings::~NimSettings()
diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp
index 50a7b8ba65..cb056cd938 100644
--- a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp
+++ b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp
@@ -35,6 +35,7 @@
#include <QDir>
#include <QTemporaryFile>
+#include <QTextCodec>
enum { debug = 0 };
@@ -269,6 +270,7 @@ bool AbstractMsvcToolChain::generateEnvironmentSettings(Utils::Environment &env,
call += ' ';
call += batchArgs.toLocal8Bit();
}
+ saver.write("chcp 65001\r\n");
saver.write(call + "\r\n");
saver.write("@echo " + marker.toLocal8Bit() + "\r\n");
saver.write("set\r\n");
@@ -295,6 +297,7 @@ bool AbstractMsvcToolChain::generateEnvironmentSettings(Utils::Environment &env,
if (debug)
qDebug() << "readEnvironmentSetting: " << call << cmdPath << cmdArguments.join(' ')
<< " Env: " << env.size();
+ run.setCodec(QTextCodec::codecForName("UTF-8"));
Utils::SynchronousProcessResponse response = run.runBlocking(cmdPath.toString(), cmdArguments);
if (response.result != Utils::SynchronousProcessResponse::Finished) {
qWarning() << response.exitMessage(cmdPath.toString(), 10);
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 8af46fc50e..4e53fc1087 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -267,6 +267,7 @@ public:
void startupProjectChanged(); // Calls updateRunAction
void activeTargetChanged();
void activeRunConfigurationChanged();
+ void activeBuildConfigurationChanged();
void slotUpdateRunActions();
@@ -2629,13 +2630,18 @@ void ProjectExplorerPluginPrivate::activeTargetChanged()
if (previousTarget) {
disconnect(previousTarget.data(), &Target::activeRunConfigurationChanged,
this, &ProjectExplorerPluginPrivate::activeRunConfigurationChanged);
+ disconnect(previousTarget.data(), &Target::activeBuildConfigurationChanged,
+ this, &ProjectExplorerPluginPrivate::activeBuildConfigurationChanged);
}
previousTarget = target;
if (target) {
connect(target, &Target::activeRunConfigurationChanged,
this, &ProjectExplorerPluginPrivate::activeRunConfigurationChanged);
+ connect(previousTarget.data(), &Target::activeBuildConfigurationChanged,
+ this, &ProjectExplorerPluginPrivate::activeBuildConfigurationChanged);
}
+ activeBuildConfigurationChanged();
activeRunConfigurationChanged();
updateDeployActions();
}
@@ -2661,6 +2667,27 @@ void ProjectExplorerPluginPrivate::activeRunConfigurationChanged()
emit m_instance->updateRunActions();
}
+void ProjectExplorerPluginPrivate::activeBuildConfigurationChanged()
+{
+ static QPointer<BuildConfiguration> previousBuildConfiguration = nullptr;
+ BuildConfiguration *bc = nullptr;
+ Project *startupProject = SessionManager::startupProject();
+ if (startupProject && startupProject->activeTarget())
+ bc = startupProject->activeTarget()->activeBuildConfiguration();
+ if (bc == previousBuildConfiguration)
+ return;
+ if (previousBuildConfiguration) {
+ disconnect(previousBuildConfiguration.data(), &BuildConfiguration::enabledChanged,
+ m_instance, &ProjectExplorerPlugin::updateRunActions);
+ }
+ previousBuildConfiguration = bc;
+ if (bc) {
+ connect(bc, &BuildConfiguration::enabledChanged,
+ m_instance, &ProjectExplorerPlugin::updateRunActions);
+ }
+ emit m_instance->updateRunActions();
+}
+
void ProjectExplorerPluginPrivate::updateDeployActions()
{
Project *project = SessionManager::startupProject();
diff --git a/src/plugins/projectexplorer/projectexplorericons.cpp b/src/plugins/projectexplorer/projectexplorericons.cpp
index 7ae3a28128..e86fe915bc 100644
--- a/src/plugins/projectexplorer/projectexplorericons.cpp
+++ b/src/plugins/projectexplorer/projectexplorericons.cpp
@@ -44,10 +44,16 @@ const Icon RUN_FLAT({
const Icon WINDOW(":/projectexplorer/images/window.png");
const Icon DEBUG_START(":/projectexplorer/images/debugger_start.png");
const Icon DEVICE_READY_INDICATOR({
+ {":/utils/images/filledcircle.png", Theme::IconsRunColor}}, Icon::Tint);
+const Icon DEVICE_READY_INDICATOR_OVERLAY({
{":/projectexplorer/images/devicestatusindicator.png", Theme::IconsRunToolBarColor}});
const Icon DEVICE_CONNECTED_INDICATOR({
+ {":/utils/images/filledcircle.png", Theme::IconsWarningColor}}, Icon::Tint);
+const Icon DEVICE_CONNECTED_INDICATOR_OVERLAY({
{":/projectexplorer/images/devicestatusindicator.png", Theme::IconsWarningToolBarColor}});
const Icon DEVICE_DISCONNECTED_INDICATOR({
+ {":/utils/images/filledcircle.png", Theme::IconsStopColor}}, Icon::Tint);
+const Icon DEVICE_DISCONNECTED_INDICATOR_OVERLAY({
{":/projectexplorer/images/devicestatusindicator.png", Theme::IconsStopToolBarColor}});
const Icon DEBUG_START_FLAT({
diff --git a/src/plugins/projectexplorer/projectexplorericons.h b/src/plugins/projectexplorer/projectexplorericons.h
index 7b14ea97fb..fbef189663 100644
--- a/src/plugins/projectexplorer/projectexplorericons.h
+++ b/src/plugins/projectexplorer/projectexplorericons.h
@@ -41,8 +41,11 @@ PROJECTEXPLORER_EXPORT extern const Utils::Icon RUN_FLAT;
PROJECTEXPLORER_EXPORT extern const Utils::Icon WINDOW;
PROJECTEXPLORER_EXPORT extern const Utils::Icon DEBUG_START;
PROJECTEXPLORER_EXPORT extern const Utils::Icon DEVICE_READY_INDICATOR;
+PROJECTEXPLORER_EXPORT extern const Utils::Icon DEVICE_READY_INDICATOR_OVERLAY;
PROJECTEXPLORER_EXPORT extern const Utils::Icon DEVICE_CONNECTED_INDICATOR;
+PROJECTEXPLORER_EXPORT extern const Utils::Icon DEVICE_CONNECTED_INDICATOR_OVERLAY;
PROJECTEXPLORER_EXPORT extern const Utils::Icon DEVICE_DISCONNECTED_INDICATOR;
+PROJECTEXPLORER_EXPORT extern const Utils::Icon DEVICE_DISCONNECTED_INDICATOR_OVERLAY;
PROJECTEXPLORER_EXPORT extern const Utils::Icon DEBUG_START_FLAT;
PROJECTEXPLORER_EXPORT extern const Utils::Icon DEBUG_START_SMALL;
diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp
index 6dea76edd8..328f259190 100644
--- a/src/plugins/projectexplorer/projectwindow.cpp
+++ b/src/plugins/projectexplorer/projectwindow.cpp
@@ -347,7 +347,7 @@ public:
QVariant data(int column, int role) const final
{
- return m_projectItem->data(column, role);
+ return m_projectItem ? m_projectItem->data(column, role) : QVariant();
}
ProjectItem *m_projectItem;
@@ -413,6 +413,7 @@ public:
if (item->m_projectItem->parent())
m_projectsModel.takeItem(item->m_projectItem);
delete item->m_projectItem;
+ item->m_projectItem = nullptr;
m_comboBoxModel.destroyItem(item);
}
@@ -466,9 +467,9 @@ public:
if (!menu.actions().isEmpty())
menu.addSeparator();
- QAction *importBuild = menu.addAction(tr("Import Existing Build..."));
+ QAction *importBuild = menu.addAction(ProjectWindow::tr("Import Existing Build..."));
importBuild->setEnabled(projectImporter != 0);
- QAction *manageKits = menu.addAction(tr("Manage Kits..."));
+ QAction *manageKits = menu.addAction(ProjectWindow::tr("Manage Kits..."));
QAction *act = menu.exec(m_selectorTree->mapToGlobal(pos));
diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp
index ec86c680b8..1a45c8db4b 100644
--- a/src/plugins/projectexplorer/target.cpp
+++ b/src/plugins/projectexplorer/target.cpp
@@ -723,7 +723,7 @@ void Target::updateDeviceState()
IDevice::ConstPtr current = DeviceKitInformation::device(kit());
QIcon overlay;
- static const QIcon disconnected = Icons::DEVICE_DISCONNECTED_INDICATOR.icon();
+ static const QIcon disconnected = Icons::DEVICE_DISCONNECTED_INDICATOR_OVERLAY.icon();
if (current.isNull()) {
overlay = disconnected;
} else {
@@ -733,12 +733,12 @@ void Target::updateDeviceState()
setToolTip(QString());
return;
case IDevice::DeviceReadyToUse: {
- static const QIcon ready = Icons::DEVICE_READY_INDICATOR.icon();
+ static const QIcon ready = Icons::DEVICE_READY_INDICATOR_OVERLAY.icon();
overlay = ready;
break;
}
case IDevice::DeviceConnected: {
- static const QIcon connected = Icons::DEVICE_CONNECTED_INDICATOR.icon();
+ static const QIcon connected = Icons::DEVICE_CONNECTED_INDICATOR_OVERLAY.icon();
overlay = connected;
break;
}
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp
index aabe26c719..60ed1a9d7f 100644
--- a/src/plugins/pythoneditor/pythoneditorplugin.cpp
+++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp
@@ -905,13 +905,16 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
addAutoReleasedObject(new PythonRunConfigurationFactory);
addAutoReleasedObject(new PythonRunControlFactory);
+ return true;
+}
+
+void PythonEditorPlugin::extensionsInitialized()
+{
// Initialize editor actions handler
// Add MIME overlay icons (these icons displayed at Project dock panel)
const QIcon icon = QIcon::fromTheme(C_PY_MIME_ICON);
if (!icon.isNull())
Core::FileIconProvider::registerIconOverlayForMimeType(icon, C_PY_MIMETYPE);
-
- return true;
}
} // namespace Internal
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.h b/src/plugins/pythoneditor/pythoneditorplugin.h
index 9e5750b7bb..7c71142c25 100644
--- a/src/plugins/pythoneditor/pythoneditorplugin.h
+++ b/src/plugins/pythoneditor/pythoneditorplugin.h
@@ -40,7 +40,7 @@ public:
~PythonEditorPlugin() override;
bool initialize(const QStringList &arguments, QString *errorMessage) override;
- void extensionsInitialized() override {}
+ void extensionsInitialized() override;
};
} // namespace Internal
diff --git a/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp b/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp
index 649ca97856..e78308514c 100644
--- a/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp
+++ b/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp
@@ -26,6 +26,8 @@
#include "customqbspropertiesdialog.h"
#include "ui_customqbspropertiesdialog.h"
+#include <qbs.h>
+
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
@@ -47,7 +49,7 @@ CustomQbsPropertiesDialog::CustomQbsPropertiesDialog(const QVariantMap &properti
nameItem->setData(Qt::DisplayRole, it.key());
m_ui->propertiesTable->setItem(currentRow, 0, nameItem);
QTableWidgetItem * const valueItem = new QTableWidgetItem;
- valueItem->setData(Qt::DisplayRole, it.value());
+ valueItem->setData(Qt::DisplayRole, qbs::settingsValueToRepresentation(it.value()));
m_ui->propertiesTable->setItem(currentRow, 1, valueItem);
++currentRow;
}
@@ -68,7 +70,8 @@ QVariantMap CustomQbsPropertiesDialog::properties() const
const QString name = nameItem->text();
if (name.isEmpty())
continue;
- properties.insert(name, m_ui->propertiesTable->item(row, 1)->text());
+ const QString rawString = m_ui->propertiesTable->item(row, 1)->text();
+ properties.insert(name, qbs::representationToSettingsValue(rawString));
}
return properties;
}
diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
index 56090e59c7..5517c3f8eb 100644
--- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
+++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
@@ -211,8 +211,11 @@ QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) co
config.insert(QLatin1String(Constants::QBS_FORCE_PROBES_KEY), m_forceProbes);
if (variableHandling == ExpandVariables) {
const Utils::MacroExpander *expander = Utils::globalMacroExpander();
- for (auto it = config.begin(), end = config.end(); it != end; ++it)
- it.value() = expander->expand(it.value().toString());
+ for (auto it = config.begin(), end = config.end(); it != end; ++it) {
+ const QString rawString = it.value().toString();
+ const QString expandedString = expander->expand(rawString);
+ it.value() = qbs::representationToSettingsValue(expandedString);
+ }
}
return config;
}
diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp
index 002fbdaba7..3e4b43f581 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.cpp
+++ b/src/plugins/qbsprojectmanager/qbsproject.cpp
@@ -252,7 +252,7 @@ bool QbsProject::ensureWriteableQbsFile(const QString &file)
bool makeWritable = QFile::setPermissions(file, fi.permissions() | QFile::WriteUser);
if (!makeWritable) {
QMessageBox::warning(ICore::mainWindow(),
- tr("Failed!"),
+ tr("Failed"),
tr("Could not write project file %1.").arg(file));
return false;
}
@@ -774,6 +774,89 @@ static QString groupLocationToProjectFile(const qbs::CodeLocation &location)
.arg(location.column());
}
+// TODO: Receive the values from qbs when QBS-1030 is resolved.
+static void getExpandedCompilerFlags(QStringList &cFlags, QStringList &cxxFlags,
+ const qbs::PropertyMap &properties)
+{
+ const auto getCppProp = [properties](const char *propertyName) {
+ return properties.getModuleProperty("cpp", QLatin1String(propertyName));
+ };
+ const QVariant &enableExceptions = getCppProp("enableExceptions");
+ const QVariant &enableRtti = getCppProp("enableRtti");
+ QStringList commonFlags = getCppProp("platformCommonCompilerFlags").toStringList();
+ commonFlags << getCppProp("commonCompilerFlags").toStringList()
+ << getCppProp("platformDriverFlags").toStringList()
+ << getCppProp("driverFlags").toStringList();
+ const QStringList toolchain = properties.getModulePropertiesAsStringList("qbs", "toolchain");
+ if (toolchain.contains("gcc")) {
+ bool hasTargetOption = false;
+ if (toolchain.contains("clang")) {
+ const int majorVersion = getCppProp("compilerVersionMajor").toInt();
+ const int minorVersion = getCppProp("compilerVersionMinor").toInt();
+ if (majorVersion > 3 || (majorVersion == 3 && minorVersion >= 1))
+ hasTargetOption = true;
+ }
+ if (hasTargetOption) {
+ commonFlags << "-target" << getCppProp("target").toString();
+ } else {
+ const QString targetArch = getCppProp("targetArch").toString();
+ if (targetArch == "x86_64")
+ commonFlags << "-m64";
+ else if (targetArch == "i386")
+ commonFlags << "-m32";
+ const QString machineType = getCppProp("machineType").toString();
+ if (!machineType.isEmpty())
+ commonFlags << ("-march=" + machineType);
+ }
+ const QStringList targetOS = properties.getModulePropertiesAsStringList(
+ "qbs", "targetOS");
+ if (targetOS.contains("unix")) {
+ const QVariant positionIndependentCode = getCppProp("positionIndependentCode");
+ if (!positionIndependentCode.isValid() || positionIndependentCode.toBool())
+ commonFlags << "-fPIC";
+ }
+ cFlags = cxxFlags = commonFlags;
+
+ const QString cxxLanguageVersion = getCppProp("cxxLanguageVersion").toString();
+ if (cxxLanguageVersion == "c++11")
+ cxxFlags << "-std=c++0x";
+ else if (cxxLanguageVersion == "c++14")
+ cxxFlags << "-std=c++1y";
+ else if (!cxxLanguageVersion.isEmpty())
+ cxxFlags << ("-std=" + cxxLanguageVersion);
+ const QString cxxStandardLibrary = getCppProp("cxxStandardLibrary").toString();
+ if (!cxxStandardLibrary.isEmpty() && toolchain.contains("clang"))
+ cxxFlags << ("-stdlib=" + cxxStandardLibrary);
+ if (enableExceptions.isValid()) {
+ cxxFlags << QLatin1String(enableExceptions.toBool()
+ ? "-fexceptions" : "-fno-exceptions");
+ }
+ if (enableRtti.isValid())
+ cxxFlags << QLatin1String(enableRtti.toBool() ? "-frtti" : "-fno-rtti");
+
+ const QString cLanguageVersion = getCppProp("cLanguageVersion").toString();
+ if (cLanguageVersion == "c11")
+ cFlags << "-std=c1x";
+ else if (!cLanguageVersion.isEmpty())
+ cFlags << ("-std=" + cLanguageVersion);
+ } else if (toolchain.contains("msvc")) {
+ if (enableExceptions.toBool()) {
+ const QString exceptionModel = getCppProp("exceptionHandlingModel").toString();
+ if (exceptionModel == "default")
+ commonFlags << "/EHsc";
+ else if (exceptionModel == "seh")
+ commonFlags << "/EHa";
+ else if (exceptionModel == "externc")
+ commonFlags << "/EHs";
+ }
+ cFlags = cxxFlags = commonFlags;
+ cFlags << "/TC";
+ cxxFlags << "/TP";
+ if (enableRtti.isValid())
+ cxxFlags << QLatin1String(enableRtti.toBool() ? "/GR" : "/GR-");
+ }
+}
+
void QbsProject::updateCppCodeModel()
{
if (!m_projectData.isValid())
@@ -806,12 +889,11 @@ void QbsProject::updateCppCodeModel()
foreach (const qbs::GroupData &grp, prd.groups()) {
const qbs::PropertyMap &props = grp.properties();
- ppBuilder.setCxxFlags(props.getModulePropertiesAsStringList(
- QLatin1String(CONFIG_CPP_MODULE),
- QLatin1String(CONFIG_CXXFLAGS)));
- ppBuilder.setCFlags(props.getModulePropertiesAsStringList(
- QLatin1String(CONFIG_CPP_MODULE),
- QLatin1String(CONFIG_CFLAGS)));
+ QStringList cFlags;
+ QStringList cxxFlags;
+ getExpandedCompilerFlags(cFlags, cxxFlags, props);
+ ppBuilder.setCxxFlags(cxxFlags);
+ ppBuilder.setCFlags(cFlags);
QStringList list = props.getModulePropertiesAsStringList(
QLatin1String(CONFIG_CPP_MODULE),
diff --git a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
index ed3dfec658..3c6e6bd828 100644
--- a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
+++ b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
@@ -125,8 +125,8 @@ void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool su
{
if (m_proFilePath != pro->filePath())
return;
- bool enabled = isEnabled();
- QString reason = disabledReason();
+ const bool enabled = isEnabled();
+ const QString reason = disabledReason();
m_parseSuccess = success;
m_parseInProgress = parseInProgress;
if (enabled != isEnabled() || reason != disabledReason())
diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h
index 2f534ca888..120a375806 100644
--- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h
+++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.h
@@ -137,7 +137,7 @@ private:
LastKitState m_lastKitState;
bool m_shadowBuild = true;
- bool m_isEnabled = false;
+ bool m_isEnabled = true;
QtSupport::BaseQtVersion::QmakeBuildConfigs m_qmakeBuildConfiguration = 0;
QmakeProjectManager::QmakeProFileNode *m_subNodeBuild = nullptr;
ProjectExplorer::FileNode *m_fileNodeBuild = nullptr;
diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
index 7f694cb336..0881b6313a 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp
@@ -1322,8 +1322,6 @@ void QmakePriFileNode::save(const QStringList &lines)
FileSaver saver(m_projectFilePath.toString(), QIODevice::Text);
saver.write(lines.join(QLatin1Char('\n')).toLocal8Bit());
saver.finalize(Core::ICore::mainWindow());
-
- m_project->projectManager()->notifyChanged(m_projectFilePath);
}
// This is a hack.
@@ -1673,16 +1671,6 @@ QString QmakeProFileNode::singleVariableValue(const QmakeVariable var) const
return values.isEmpty() ? QString() : values.first();
}
-void QmakeProFileNode::emitProFileUpdatedRecursive()
-{
- emit m_project->proFileUpdated(this, m_validParse, m_parseInProgress);
-
- foreach (ProjectNode *subNode, projectNodes()) {
- if (QmakeProFileNode *node = dynamic_cast<QmakeProFileNode *>(subNode))
- node->emitProFileUpdatedRecursive();
- }
-}
-
void QmakeProFileNode::setParseInProgressRecursive(bool b)
{
setParseInProgress(b);
@@ -2169,6 +2157,7 @@ void QmakeProFileNode::applyEvaluate(EvalResult *evalResult)
qmakeProFileNode->setIncludedInExactParse(
result->exactSubdirs.contains(qmakeProFileNode->filePath())
&& pn->includedInExactParse());
+ qmakeProFileNode->setParseInProgress(true);
qmakeProFileNode->asyncUpdate();
toAdd << qmakeProFileNode;
}
diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.h b/src/plugins/qmakeprojectmanager/qmakenodes.h
index 01228a8f9f..3df8d04f5a 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodes.h
+++ b/src/plugins/qmakeprojectmanager/qmakenodes.h
@@ -364,7 +364,6 @@ public:
void setParseInProgressRecursive(bool b);
void setValidParse(bool b);
void setValidParseRecursive(bool b);
- void emitProFileUpdatedRecursive();
void asyncUpdate();
@@ -401,7 +400,7 @@ private:
static InstallsList installsList(const QtSupport::ProFileReader *reader, const QString &projectFilePath, const QString &projectDir, const QString &buildDir);
bool m_validParse = false;
- bool m_parseInProgress = true;
+ bool m_parseInProgress = false;
QmakeProjectType m_projectType = InvalidProject;
QmakeVariablesHash m_varValues;
diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
index 3308264ae4..1f5a79d8dc 100644
--- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
@@ -71,25 +71,6 @@ using namespace Utils;
enum { debug = 0 };
-// -----------------------------------------------------------------------
-// Helpers:
-// -----------------------------------------------------------------------
-
-namespace {
-
-QmakeBuildConfiguration *enableActiveQmakeBuildConfiguration(Target *t, bool enabled)
-{
- if (!t)
- return 0;
- QmakeBuildConfiguration *bc = static_cast<QmakeBuildConfiguration *>(t->activeBuildConfiguration());
- if (!bc)
- return 0;
- bc->setEnabled(enabled);
- return bc;
-}
-
-} // namespace
-
namespace QmakeProjectManager {
namespace Internal {
@@ -603,7 +584,8 @@ void QmakeProject::scheduleAsyncUpdate(QmakeProFileNode *node, QmakeProFileNode:
return;
}
- enableActiveQmakeBuildConfiguration(activeTarget(), false);
+ node->setParseInProgressRecursive(true);
+ setAllBuildConfigurationsEnabled(false);
if (m_asyncUpdateState == AsyncFullUpdatePending) {
// Just postpone
@@ -643,7 +625,6 @@ void QmakeProject::scheduleAsyncUpdate(QmakeProFileNode *node, QmakeProFileNode:
m_codeModelFuture.cancel();
startAsyncTimer(delay);
-
} else if (m_asyncUpdateState == AsyncUpdateInProgress) {
// A update is in progress
// And this slot only gets called if a file changed on disc
@@ -671,21 +652,21 @@ void QmakeProject::scheduleAsyncUpdate(QmakeProFileNode::AsyncUpdateDelay delay)
qDebug()<<" canceling is in progress, doing nothing";
return;
}
+
+ rootProjectNode()->setParseInProgressRecursive(true);
+ setAllBuildConfigurationsEnabled(false);
+
if (m_asyncUpdateState == AsyncUpdateInProgress) {
if (debug)
qDebug()<<" update in progress, canceling and setting state to full update pending";
m_cancelEvaluate = true;
m_asyncUpdateState = AsyncFullUpdatePending;
- enableActiveQmakeBuildConfiguration(activeTarget(), false);
- rootProjectNode()->setParseInProgressRecursive(true);
return;
}
if (debug)
qDebug()<<" starting timer for full update, setting state to full update pending";
m_partialEvaluate.clear();
- enableActiveQmakeBuildConfiguration(activeTarget(), false);
- rootProjectNode()->setParseInProgressRecursive(true);
m_asyncUpdateState = AsyncFullUpdatePending;
// Cancel running code model update
@@ -734,11 +715,14 @@ void QmakeProject::decrementPendingEvaluateFutures()
if (m_asyncUpdateState == AsyncFullUpdatePending || m_asyncUpdateState == AsyncPartialUpdatePending) {
if (debug)
qDebug()<<" Oh update is pending start the timer";
+ rootProjectNode()->setParseInProgressRecursive(true);
+ setAllBuildConfigurationsEnabled(false);
startAsyncTimer(QmakeProFileNode::ParseLater);
} else if (m_asyncUpdateState != ShuttingDown){
// After being done, we need to call:
+ setAllBuildConfigurationsEnabled(true);
+
m_asyncUpdateState = Base;
- enableActiveQmakeBuildConfiguration(activeTarget(), true);
updateFileList();
updateCodeModels();
updateBuildSystemData();
@@ -1071,6 +1055,17 @@ void QmakeProject::activeTargetWasChanged()
scheduleAsyncUpdate();
}
+void QmakeProject::setAllBuildConfigurationsEnabled(bool enabled)
+{
+ foreach (Target *t, targets()) {
+ foreach (BuildConfiguration *bc, t->buildConfigurations()) {
+ auto qmakeBc = qobject_cast<QmakeBuildConfiguration *>(bc);
+ if (qmakeBc)
+ qmakeBc->setEnabled(enabled);
+ }
+ }
+}
+
bool QmakeProject::hasSubNode(QmakePriFileNode *root, const FileName &path)
{
if (root->filePath() == path)
diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h
index 9a2ecb8aad..c109dd8e2c 100644
--- a/src/plugins/qmakeprojectmanager/qmakeproject.h
+++ b/src/plugins/qmakeprojectmanager/qmakeproject.h
@@ -153,6 +153,8 @@ private:
void buildFinished(bool success);
void activeTargetWasChanged();
+ void setAllBuildConfigurationsEnabled(bool enabled);
+
QString executableFor(const QmakeProFileNode *node);
void updateRunConfigurations();
diff --git a/src/plugins/qmldesigner/components/componentcore/theming.cpp b/src/plugins/qmldesigner/components/componentcore/theming.cpp
index d1429ff45b..e74a0561e8 100644
--- a/src/plugins/qmldesigner/components/componentcore/theming.cpp
+++ b/src/plugins/qmldesigner/components/componentcore/theming.cpp
@@ -33,11 +33,13 @@
namespace QmlDesigner {
-void Theming::insertTheme(QQmlPropertyMap *map)
+const QVariantMap &Theming::theme()
{
- const QVariantHash creatorTheme = Utils::creatorTheme()->values();
- for (auto it = creatorTheme.constBegin(); it != creatorTheme.constEnd(); ++it)
- map->insert(it.key(), it.value());
+ static QVariantMap map;
+ if (!map.isEmpty())
+ return map;
+
+ map = Utils::creatorTheme()->values();
/* Define QmlDesigner colors and remove alpha channels */
const QColor backgroundColor = Utils::creatorTheme()->color(Utils::Theme::QmlDesigner_BackgroundColor);
@@ -58,18 +60,18 @@ void Theming::insertTheme(QQmlPropertyMap *map)
tabDark = tabDark.darker(260);
}
- map->insert("QmlDesignerBackgroundColorDarker", darkerBackground);
- map->insert("QmlDesignerBackgroundColorDarkAlternate", backgroundColor);
- map->insert("QmlDesignerTabLight", tabLight);
- map->insert("QmlDesignerTabDark", tabDark);
- map->insert("QmlDesignerButtonColor", buttonColor);
- map->insert("QmlDesignerBorderColor", Utils::creatorTheme()->color(Utils::Theme::SplitterColor));
+ map.insert("QmlDesignerBackgroundColorDarker", darkerBackground);
+ map.insert("QmlDesignerBackgroundColorDarkAlternate", backgroundColor);
+ map.insert("QmlDesignerTabLight", tabLight);
+ map.insert("QmlDesignerTabDark", tabDark);
+ map.insert("QmlDesignerButtonColor", buttonColor);
+ map.insert("QmlDesignerBorderColor", Utils::creatorTheme()->color(Utils::Theme::SplitterColor));
+ return map;
}
QString Theming::replaceCssColors(const QString &input)
{
- QQmlPropertyMap map;
- insertTheme(&map);
+ const QVariantMap &map = theme();
QRegExp rx("creatorTheme\\.(\\w+);");
int pos = 0;
diff --git a/src/plugins/qmldesigner/components/componentcore/theming.h b/src/plugins/qmldesigner/components/componentcore/theming.h
index cb582994bf..d9a11ce7b5 100644
--- a/src/plugins/qmldesigner/components/componentcore/theming.h
+++ b/src/plugins/qmldesigner/components/componentcore/theming.h
@@ -33,7 +33,7 @@ namespace QmlDesigner {
class Theming
{
public:
- static void insertTheme(QQmlPropertyMap *map);
+ static const QVariantMap &theme();
static QString replaceCssColors(const QString &input);
static void registerIconProvider(QQmlEngine *engine);
};
diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp
index 039a2be448..ad59291fe6 100644
--- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp
+++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp
@@ -83,8 +83,7 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
rootContext->setContextProperty(QStringLiteral("itemLibraryIconWidth"), m_itemIconSize.width());
rootContext->setContextProperty(QStringLiteral("itemLibraryIconHeight"), m_itemIconSize.height());
rootContext->setContextProperty(QStringLiteral("rootView"), this);
- Theming::insertTheme(&m_themeProperties);
- rootContext->setContextProperty(QLatin1String("creatorTheme"), &m_themeProperties);
+ rootContext->setContextProperty(QLatin1String("creatorTheme"), Theming::theme());
m_itemViewQuickWidget->rootContext()->setContextProperty(QStringLiteral("highlightColor"), Utils::StyleHelper::notTooBrightHighlightColor());
@@ -170,8 +169,7 @@ void ItemLibraryWidget::setItemLibraryInfo(ItemLibraryInfo *itemLibraryInfo)
if (itemLibraryInfo)
connect(m_itemLibraryInfo.data(), SIGNAL(entriesChanged()),
this, SLOT(delayedUpdateModel()));
-
- updateModel();
+ delayedUpdateModel();
}
void ItemLibraryWidget::updateImports()
@@ -229,7 +227,6 @@ void ItemLibraryWidget::setModel(Model *model)
if (!model)
return;
setItemLibraryInfo(model->metaInfo().itemLibraryInfo());
- updateModel();
}
void ItemLibraryWidget::setCurrentIndexOfStackedWidget(int index)
diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h
index ca8cd82c31..148b0b90dc 100644
--- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h
+++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.h
@@ -132,7 +132,6 @@ private:
QPointer<Model> m_model;
FilterChangeFlag m_filterFlag;
ItemLibraryEntry m_currentitemLibraryEntry;
- QQmlPropertyMap m_themeProperties;
};
}
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
index 3d4884d9bd..ff299af870 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
@@ -103,8 +103,7 @@ PropertyEditorQmlBackend::PropertyEditorQmlBackend(PropertyEditorView *propertyE
m_contextObject->setModel(propertyEditor->model());
m_contextObject->insertInQmlContext(context());
- Theming::insertTheme(&m_themeProperties);
- context()->setContextProperty(QLatin1String("creatorTheme"), &m_themeProperties);
+ context()->setContextProperty(QLatin1String("creatorTheme"), Theming::theme());
QObject::connect(&m_backendValuesPropertyMap, &DesignerPropertyMap::valueChanged, propertyEditor, &PropertyEditorView::changeValue);
}
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h
index 0e073b20be..a272b35aef 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h
@@ -103,7 +103,6 @@ private:
QScopedPointer<PropertyEditorTransaction> m_propertyEditorTransaction;
QScopedPointer<PropertyEditorValue> m_dummyPropertyEditorValue;
QScopedPointer<PropertyEditorContextObject> m_contextObject;
- QQmlPropertyMap m_themeProperties;
};
} //QmlDesigner
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp
index ae869763cd..a9a96cf05d 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp
@@ -99,8 +99,7 @@ StatesEditorWidget::StatesEditorWidget(StatesEditorView *statesEditorView, State
rootContext()->setContextProperty(QLatin1String("canAddNewStates"), true);
- Theming::insertTheme(&m_themeProperties);
- rootContext()->setContextProperty(QLatin1String("creatorTheme"), &m_themeProperties);
+ rootContext()->setContextProperty(QLatin1String("creatorTheme"), Theming::theme());
Theming::registerIconProvider(engine());
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h
index eb0c26ce04..fc78ecb450 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h
@@ -67,7 +67,6 @@ private:
QPointer<StatesEditorView> m_statesEditorView;
Internal::StatesEditorImageProvider *m_imageProvider;
QShortcut *m_qmlSourceUpdateShortcut;
- QQmlPropertyMap m_themeProperties;
};
}
diff --git a/src/plugins/qmldesigner/designercore/include/componenttextmodifier.h b/src/plugins/qmldesigner/designercore/include/componenttextmodifier.h
index 01b8f63e53..fc9821864f 100644
--- a/src/plugins/qmldesigner/designercore/include/componenttextmodifier.h
+++ b/src/plugins/qmldesigner/designercore/include/componenttextmodifier.h
@@ -56,8 +56,8 @@ public:
bool renameId(const QString & /* oldId */, const QString & /* newId */) override
{ return false; }
- QStringList autoComplete(QTextDocument * /*textDocument*/, int /*position*/, bool /*explicitComplete*/) override
- { return QStringList(); }
+ QStringList autoComplete(QTextDocument * textDocument, int position, bool explicitComplete) override
+ { return m_originalModifier->autoComplete(textDocument, position, explicitComplete); }
bool moveToComponent(int /* nodeOffset */) override
{ return false; }
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
index e32c95685d..6f1fd6ec77 100644
--- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
+++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
@@ -1231,7 +1231,7 @@ void NodeInstanceView::childrenChanged(const ChildrenChangedCommand &command)
foreach (qint32 instanceId, command.childrenInstances()) {
if (hasInstanceForId(instanceId)) {
NodeInstance instance = instanceForId(instanceId);
- if (!instance.directUpdates()) {
+ if (instance.parentId() == -1 || !instance.directUpdates()) {
instance.setParentId(command.parentInstanceId());
childNodeVector.append(instance.modelNode());
}
diff --git a/src/plugins/qmldesigner/designercore/model/componenttextmodifier.cpp b/src/plugins/qmldesigner/designercore/model/componenttextmodifier.cpp
index a91e47e61e..257c6e67f7 100644
--- a/src/plugins/qmldesigner/designercore/model/componenttextmodifier.cpp
+++ b/src/plugins/qmldesigner/designercore/model/componenttextmodifier.cpp
@@ -55,7 +55,29 @@ void ComponentTextModifier::move(const MoveInfo &moveInfo)
void ComponentTextModifier::indent(int offset, int length)
{
- m_originalModifier->indent(offset, length);
+ int componentStartLine = getLineInDocument(m_originalModifier->textDocument(), m_componentStartOffset);
+ int componentEndLine = getLineInDocument(m_originalModifier->textDocument(), m_componentEndOffset);
+
+ /* Do not indent lines that contain code of the component and the surrounding QML.
+ * example:
+ * delegate: Item { //startLine
+ * ...
+ * } // endLine
+ * Indenting such lines will change the offsets of the component.
+ */
+
+ --componentStartLine;
+ --componentEndLine;
+
+ int startLine = getLineInDocument(m_originalModifier->textDocument(), offset);
+ int endLine = getLineInDocument(m_originalModifier->textDocument(), offset + length);
+
+ if (startLine < componentStartLine)
+ startLine = componentStartLine;
+ if (endLine > componentEndLine)
+ endLine = componentEndLine;
+
+ indentLines(startLine, endLine);
}
void ComponentTextModifier::indentLines(int startLine, int endLine)
@@ -78,7 +100,7 @@ void ComponentTextModifier::flushGroup()
{
m_originalModifier->flushGroup();
- uint textLength = m_originalModifier->text().length();
+ int textLength = m_originalModifier->text().length();
m_componentEndOffset += (textLength - m_startLength);
m_startLength = textLength;
@@ -88,7 +110,7 @@ void ComponentTextModifier::commitGroup()
{
m_originalModifier->commitGroup();
- uint textLength = m_originalModifier->text().length();
+ int textLength = m_originalModifier->text().length();
m_componentEndOffset += (textLength - m_startLength);
m_startLength = textLength;
}
diff --git a/src/plugins/qmldesigner/qtquickplugin/source/pathviewv2.qml b/src/plugins/qmldesigner/qtquickplugin/source/pathviewv2.qml
index 8122bf2d26..693f703596 100644
--- a/src/plugins/qmldesigner/qtquickplugin/source/pathviewv2.qml
+++ b/src/plugins/qmldesigner/qtquickplugin/source/pathviewv2.qml
@@ -53,21 +53,19 @@ PathView {
colorCode: "green"
}
}
- delegate: Component {
- Column {
- spacing: 5
- Rectangle {
- width: 40
- height: 40
- color: colorCode
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Text {
- x: 5
- text: name
- anchors.horizontalCenter: parent.horizontalCenter
- font.bold: true
- }
+ delegate: Column {
+ spacing: 5
+ Rectangle {
+ width: 40
+ height: 40
+ color: colorCode
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Text {
+ x: 5
+ text: name
+ anchors.horizontalCenter: parent.horizontalCenter
+ font.bold: true
}
}
}
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index 72498a20d8..1ff1bbca45 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp
@@ -401,7 +401,7 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunControl *runControl)
"qthelp://org.qt-project.qtcreator/doc/creator-debugging-qml.html");
case QMessageBox::Cancel:
// The actual error message has already been logged.
- logState(tr("Failed to connect!"));
+ logState(tr("Failed to connect."));
runControl->cancelProcess();
break;
}
diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp
index b6af5bcbf1..bb8cd71bc3 100644
--- a/src/plugins/qnx/qnxdebugsupport.cpp
+++ b/src/plugins/qnx/qnxdebugsupport.cpp
@@ -99,17 +99,18 @@ void QnxDebugSupport::startExecution()
setState(StartingRemoteProcess);
- if (m_useQmlDebugger)
- m_runControl->startParameters().inferior.commandLineArguments +=
- QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices, m_qmlPort);
-
+ StandardRunnable r = m_runnable;
QStringList arguments;
if (m_useCppDebugger)
arguments << QString::number(m_pdebugPort.number());
- else if (m_useQmlDebugger && !m_useCppDebugger)
- arguments = Utils::QtcProcess::splitArgs(
- m_runControl->startParameters().inferior.commandLineArguments);
- StandardRunnable r;
+ else {
+ if (m_useQmlDebugger) {
+ arguments.append(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices,
+ m_qmlPort));
+ }
+ arguments.append(Utils::QtcProcess::splitArgs(r.commandLineArguments));
+ }
+
r.executable = processExecutable();
r.commandLineArguments = Utils::QtcProcess::joinArgs(arguments);
r.environment = m_runnable.environment;
diff --git a/src/plugins/qtsupport/QtSupport.mimetypes.xml b/src/plugins/qtsupport/QtSupport.mimetypes.xml
index a851d0c244..4e85be98ba 100644
--- a/src/plugins/qtsupport/QtSupport.mimetypes.xml
+++ b/src/plugins/qtsupport/QtSupport.mimetypes.xml
@@ -1,11 +1,11 @@
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/x-linguist-translation">
- <comment>Linguist translated messages (machine-readable)</comment>
+ <comment>Linguist compiled translations</comment>
<glob pattern="*.qm"/>
</mime-type>
<mime-type type="application/x-linguist">
- <comment>Linguist message catalog</comment>
+ <comment>Linguist source translations</comment>
<magic>
<match value="&lt;TS" type="string" offset="0:256"/>
</magic>
diff --git a/src/plugins/scxmleditor/plugin_interface/actionhandler.cpp b/src/plugins/scxmleditor/plugin_interface/actionhandler.cpp
index e8067fd016..85265cbabe 100644
--- a/src/plugins/scxmleditor/plugin_interface/actionhandler.cpp
+++ b/src/plugins/scxmleditor/plugin_interface/actionhandler.cpp
@@ -35,8 +35,6 @@ using namespace ScxmlEditor::PluginInterface;
ActionHandler::ActionHandler(QObject *parent)
: QObject(parent)
{
- using AH = ActionHandler;
-
const struct {
const Utils::Icon icon;
QString name;
@@ -44,32 +42,32 @@ ActionHandler::ActionHandler(QObject *parent)
const char *keyseq;
bool checkable;
} actionInfos[] = {
- { Utils::Icons::ZOOMIN_TOOLBAR, AH::tr("Zoom In"), AH::tr("Zoom In (Ctrl + + / Ctrl + Wheel)"), "Ctrl++", false },
- { Utils::Icons::ZOOMOUT_TOOLBAR, AH::tr("Zoom Out"), AH::tr("Zoom Out (Ctrl + - / Ctrl + Wheel)"), "Ctrl+-", false },
- { Utils::Icons::FITTOVIEW_TOOLBAR, AH::tr("Fit to View"), AH::tr("Fit to View (F11)"), "F11", false },
- { Utils::Icon({{":/scxmleditor/images/icon-pan.png", Utils::Theme::IconsBaseColor}}), AH::tr("Panning"), AH::tr("Panning (Shift)"), "Shift", true },
+ { Utils::Icons::ZOOMIN_TOOLBAR, tr("Zoom In"), tr("Zoom In (Ctrl + + / Ctrl + Wheel)"), "Ctrl++", false },
+ { Utils::Icons::ZOOMOUT_TOOLBAR, tr("Zoom Out"), tr("Zoom Out (Ctrl + - / Ctrl + Wheel)"), "Ctrl+-", false },
+ { Utils::Icons::FITTOVIEW_TOOLBAR, tr("Fit to View"), tr("Fit to View (F11)"), "F11", false },
+ { Utils::Icon({{":/scxmleditor/images/icon-pan.png", Utils::Theme::IconsBaseColor}}), tr("Panning"), tr("Panning (Shift)"), "Shift", true },
- { Utils::Icons::ZOOM_TOOLBAR, AH::tr("Magnifier"), AH::tr("Magnifier Tool (Alt)"), "Alt", true },
- { Utils::Icon(":/scxmleditor/images/navigator.png"), AH::tr("Navigator"), AH::tr("Navigator (Ctrl+E)"), "Ctrl+E", true },
+ { Utils::Icons::ZOOM_TOOLBAR, tr("Magnifier"), tr("Magnifier Tool (Alt)"), "Alt", true },
+ { Utils::Icon(":/scxmleditor/images/navigator.png"), tr("Navigator"), tr("Navigator (Ctrl+E)"), "Ctrl+E", true },
- { Utils::Icon({{":/utils/images/editcopy.png", Utils::Theme::IconsBaseColor}}), AH::tr("Copy"), AH::tr("Copy (Ctrl + C)"), "Ctrl+C", false },
- { Utils::Icon({{":/utils/images/editcut.png", Utils::Theme::IconsBaseColor}}), AH::tr("Cut"), AH::tr("Cut (Ctrl + X)"), "Ctrl+X", false },
- { Utils::Icon({{":/utils/images/editpaste.png", Utils::Theme::IconsBaseColor}}), AH::tr("Paste"), AH::tr("Paste (Ctrl + V)"), "Ctrl+V", false },
- { Utils::Icons::SNAPSHOT_TOOLBAR, AH::tr("Screenshot"), AH::tr("Screenshot (Ctrl + Shift + C)"), "Ctrl+Shift+C", false },
- { Utils::Icon({{":/scxmleditor/images/icon-export-canvas.png", Utils::Theme::IconsBaseColor}}), AH::tr("Export to Image"), AH::tr("Export to Image"), "Ctrl+Shift+E", false },
- { Utils::Icon({{":/utils/images/namespace.png", Utils::Theme::IconsBaseColor}}), AH::tr("Toggle Full Namespace"), AH::tr("Toggle Full Namespace"), "Ctrl+Shift+N", true },
+ { Utils::Icon({{":/utils/images/editcopy.png", Utils::Theme::IconsBaseColor}}), tr("Copy"), tr("Copy (Ctrl + C)"), "Ctrl+C", false },
+ { Utils::Icon({{":/utils/images/editcut.png", Utils::Theme::IconsBaseColor}}), tr("Cut"), tr("Cut (Ctrl + X)"), "Ctrl+X", false },
+ { Utils::Icon({{":/utils/images/editpaste.png", Utils::Theme::IconsBaseColor}}), tr("Paste"), tr("Paste (Ctrl + V)"), "Ctrl+V", false },
+ { Utils::Icons::SNAPSHOT_TOOLBAR, tr("Screenshot"), tr("Screenshot (Ctrl + Shift + C)"), "Ctrl+Shift+C", false },
+ { Utils::Icon({{":/scxmleditor/images/icon-export-canvas.png", Utils::Theme::IconsBaseColor}}), tr("Export to Image"), tr("Export to Image"), "Ctrl+Shift+E", false },
+ { Utils::Icon({{":/utils/images/namespace.png", Utils::Theme::IconsBaseColor}}), tr("Toggle Full Namespace"), tr("Toggle Full Namespace"), "Ctrl+Shift+N", true },
- { Utils::Icon({{":/scxmleditor/images/align_left.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), AH::tr("Align Left"), AH::tr("Align Left (Ctrl+L,1)"), "Ctrl+L,1", false },
- { Utils::Icon({{":/scxmleditor/images/align_right.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), AH::tr("Align Right"), AH::tr("Align Right (Ctrl+L,2)"), "Ctrl+L,2", false },
- { Utils::Icon({{":/scxmleditor/images/align_top.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), AH::tr("Align Top"), AH::tr("Align Top (Ctrl+L,3)"), "Ctrl+L,3", false },
- { Utils::Icon({{":/scxmleditor/images/align_bottom.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), AH::tr("Align Bottom"), AH::tr("Align Bottom (Ctrl+L,4)"), "Ctrl+L,4", false },
- { Utils::Icon({{":/scxmleditor/images/align_horizontal.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), AH::tr("Align Horizontal"), AH::tr("Align Horizontal (Ctrl+L,5)"), "Ctrl+L,5", false },
- { Utils::Icon({{":/scxmleditor/images/align_vertical.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), AH::tr("Align Vertical"), AH::tr("Align Vertical (Ctrl+L,6)"), "Ctrl+L,6", false },
- { Utils::Icon({{":/scxmleditor/images/adjust_width.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), AH::tr("Adjust Width"), AH::tr("Adjust Width (Ctrl+L,7)"), "Ctrl+L,7", false },
- { Utils::Icon({{":/scxmleditor/images/adjust_height.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), AH::tr("Adjust Height"), AH::tr("Adjust Height (Ctrl+L,8)"), "Ctrl+L,8", false },
- { Utils::Icon({{":/scxmleditor/images/adjust_size.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), AH::tr("Adjust Size"), AH::tr("Adjust Size (Ctrl+L,9)"), "Ctrl+L,9", false },
+ { Utils::Icon({{":/scxmleditor/images/align_left.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), tr("Align Left"), tr("Align Left (Ctrl+L,1)"), "Ctrl+L,1", false },
+ { Utils::Icon({{":/scxmleditor/images/align_right.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), tr("Align Right"), tr("Align Right (Ctrl+L,2)"), "Ctrl+L,2", false },
+ { Utils::Icon({{":/scxmleditor/images/align_top.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), tr("Align Top"), tr("Align Top (Ctrl+L,3)"), "Ctrl+L,3", false },
+ { Utils::Icon({{":/scxmleditor/images/align_bottom.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), tr("Align Bottom"), tr("Align Bottom (Ctrl+L,4)"), "Ctrl+L,4", false },
+ { Utils::Icon({{":/scxmleditor/images/align_horizontal.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), tr("Align Horizontal"), tr("Align Horizontal (Ctrl+L,5)"), "Ctrl+L,5", false },
+ { Utils::Icon({{":/scxmleditor/images/align_vertical.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), tr("Align Vertical"), tr("Align Vertical (Ctrl+L,6)"), "Ctrl+L,6", false },
+ { Utils::Icon({{":/scxmleditor/images/adjust_width.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), tr("Adjust Width"), tr("Adjust Width (Ctrl+L,7)"), "Ctrl+L,7", false },
+ { Utils::Icon({{":/scxmleditor/images/adjust_height.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), tr("Adjust Height"), tr("Adjust Height (Ctrl+L,8)"), "Ctrl+L,8", false },
+ { Utils::Icon({{":/scxmleditor/images/adjust_size.png", Utils::Theme::PanelTextColorMid}}, Utils::Icon::Tint), tr("Adjust Size"), tr("Adjust Size (Ctrl+L,9)"), "Ctrl+L,9", false },
- { Utils::Icon(":/scxmleditor/images/statistics.png"), AH::tr("Show Statistics..."), AH::tr("Show Statistics"), "", false }
+ { Utils::Icon(":/scxmleditor/images/statistics.png"), tr("Show Statistics..."), tr("Show Statistics"), "", false }
};
// Init actions
diff --git a/src/plugins/scxmleditor/plugin_interface/initialwarningitem.h b/src/plugins/scxmleditor/plugin_interface/initialwarningitem.h
index 762bb47702..b3f12aa664 100644
--- a/src/plugins/scxmleditor/plugin_interface/initialwarningitem.h
+++ b/src/plugins/scxmleditor/plugin_interface/initialwarningitem.h
@@ -35,6 +35,7 @@ class InitialStateItem;
class InitialWarningItem : public WarningItem
{
+ Q_OBJECT
public:
InitialWarningItem(InitialStateItem *parent = nullptr);
diff --git a/src/plugins/scxmleditor/plugin_interface/scattributeitemmodel.h b/src/plugins/scxmleditor/plugin_interface/scattributeitemmodel.h
index 8fbfdf6637..6a17749520 100644
--- a/src/plugins/scxmleditor/plugin_interface/scattributeitemmodel.h
+++ b/src/plugins/scxmleditor/plugin_interface/scattributeitemmodel.h
@@ -33,6 +33,7 @@ namespace PluginInterface {
class SCAttributeItemModel : public AttributeItemModel
{
+ Q_OBJECT
public:
SCAttributeItemModel(QObject *parent = nullptr);
diff --git a/src/plugins/scxmleditor/plugin_interface/scshapeprovider.h b/src/plugins/scxmleditor/plugin_interface/scshapeprovider.h
index f4093b5a76..f3a9784268 100644
--- a/src/plugins/scxmleditor/plugin_interface/scshapeprovider.h
+++ b/src/plugins/scxmleditor/plugin_interface/scshapeprovider.h
@@ -37,6 +37,7 @@ class ScxmlTag;
class SCShapeProvider : public ShapeProvider
{
+ Q_OBJECT
public:
SCShapeProvider(QObject *parent = nullptr);
~SCShapeProvider() override;
diff --git a/src/plugins/scxmleditor/plugin_interface/scxmltag.h b/src/plugins/scxmleditor/plugin_interface/scxmltag.h
index 7228357fb2..3031c9b465 100644
--- a/src/plugins/scxmleditor/plugin_interface/scxmltag.h
+++ b/src/plugins/scxmleditor/plugin_interface/scxmltag.h
@@ -50,6 +50,7 @@ class ScxmlDocument;
*/
class ScxmlTag : public QObject
{
+ Q_OBJECT
public:
ScxmlTag(TagType type, ScxmlDocument *document = nullptr);
ScxmlTag(const QString &prefix, const QString &name, ScxmlDocument *document = nullptr);
diff --git a/src/plugins/scxmleditor/scxmleditordata.h b/src/plugins/scxmleditor/scxmleditordata.h
index 527659fbbb..785e927531 100644
--- a/src/plugins/scxmleditor/scxmleditordata.h
+++ b/src/plugins/scxmleditor/scxmleditordata.h
@@ -44,6 +44,7 @@ class ScxmlContext;
class ScxmlEditorData : public QObject
{
+ Q_OBJECT
public:
ScxmlEditorData(QObject *parent = nullptr);
~ScxmlEditorData();
diff --git a/src/plugins/subversion/subversionclient.cpp b/src/plugins/subversion/subversionclient.cpp
index 85331d0a4d..73e69806e2 100644
--- a/src/plugins/subversion/subversionclient.cpp
+++ b/src/plugins/subversion/subversionclient.cpp
@@ -39,6 +39,7 @@
#include <diffeditor/diffutils.h>
#include <coreplugin/editormanager/editormanager.h>
+#include <utils/algorithm.h>
#include <utils/hostosinfo.h>
#include <QDir>
@@ -89,7 +90,7 @@ VcsCommand *SubversionClient::createCommitCmd(const QString &repositoryRoot,
VcsCommand *cmd = createCommand(repositoryRoot);
cmd->addFlags(VcsCommand::ShowStdOut);
QStringList args(vcsCommandString(CommitCommand));
- cmd->addJob(vcsBinary(), args << svnExtraOptions << files);
+ cmd->addJob(vcsBinary(), args << svnExtraOptions << escapeFiles(files));
return cmd;
}
@@ -156,6 +157,16 @@ QString SubversionClient::synchronousTopic(const QString &repository)
return result.stdOut().trimmed();
}
+QString SubversionClient::escapeFile(const QString &file)
+{
+ return (file.contains('@') && !file.endsWith('@')) ? file + '@' : file;
+}
+
+QStringList SubversionClient::escapeFiles(const QStringList &files)
+{
+ return Utils::transform(files, &SubversionClient::escapeFile);
+}
+
class DiffController : public DiffEditorController
{
Q_OBJECT
@@ -200,7 +211,7 @@ void DiffController::setFilesList(const QStringList &filesList)
if (isReloading())
return;
- m_filesList = filesList;
+ m_filesList = SubversionClient::escapeFiles(filesList);
}
void DiffController::setChangeNumber(int changeNumber)
@@ -310,13 +321,9 @@ void SubversionClient::log(const QString &workingDir,
if (logCount > 0)
svnExtraOptions << QLatin1String("-l") << QString::number(logCount);
- QStringList nativeFiles;
- foreach (const QString& file, files)
- nativeFiles.append(QDir::toNativeSeparators(file));
-
// subversion stores log in UTF-8 and returns it back in user system locale.
// So we do not need to encode it.
- VcsBaseClient::log(workingDir, files, svnExtraOptions, enableAnnotationContextMenu);
+ VcsBaseClient::log(workingDir, escapeFiles(files), svnExtraOptions, enableAnnotationContextMenu);
}
void SubversionClient::describe(const QString &workingDirectory, int changeNumber, const QString &title)
diff --git a/src/plugins/subversion/subversionclient.h b/src/plugins/subversion/subversionclient.h
index a5e3d98277..7cc287f210 100644
--- a/src/plugins/subversion/subversionclient.h
+++ b/src/plugins/subversion/subversionclient.h
@@ -71,6 +71,9 @@ public:
QString synchronousTopic(const QString &repository);
+ static QString escapeFile(const QString &file);
+ static QStringList escapeFiles(const QStringList &files);
+
protected:
Core::Id vcsEditorKind(VcsCommandTag cmd) const override;
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp
index fd335e4668..2abc041d12 100644
--- a/src/plugins/subversion/subversionplugin.cpp
+++ b/src/plugins/subversion/subversionplugin.cpp
@@ -568,7 +568,7 @@ void SubversionPlugin::revertCurrentFile()
QStringList args(QLatin1String("diff"));
args << SubversionClient::addAuthenticationOptions(client()->settings());
- args.push_back(state.relativeCurrentFile());
+ args.push_back(SubversionClient::escapeFile(state.relativeCurrentFile()));
const SubversionResponse diffResponse
= runSvn(state.currentFileTopLevel(), args, m_client->vcsTimeoutS(), 0);
@@ -589,7 +589,7 @@ void SubversionPlugin::revertCurrentFile()
args.clear();
args << QLatin1String("revert");
args << SubversionClient::addAuthenticationOptions(client()->settings());
- args << state.relativeCurrentFile();
+ args << SubversionClient::escapeFile(state.relativeCurrentFile());
const SubversionResponse revertResponse
= runSvn(state.currentFileTopLevel(), args, m_client->vcsTimeoutS(),
@@ -652,7 +652,7 @@ void SubversionPlugin::startCommit(const QString &workingDir, const QStringList
QStringList args(QLatin1String("status"));
args << SubversionClient::addAuthenticationOptions(client()->settings());
- args += files;
+ args += SubversionClient::escapeFiles(files);
const SubversionResponse response
= runSvn(workingDir, args, m_client->vcsTimeoutS(), 0);
@@ -733,7 +733,7 @@ void SubversionPlugin::svnStatus(const QString &workingDir, const QString &relat
QStringList args(QLatin1String("status"));
args << SubversionClient::addAuthenticationOptions(client()->settings());
if (!relativePath.isEmpty())
- args.append(relativePath);
+ args.append(SubversionClient::escapeFile(relativePath));
VcsOutputWindow::setRepository(workingDir);
runSvn(workingDir, args, m_client->vcsTimeoutS(),
VcsCommand::ShowStdOut | VcsCommand::ShowSuccessMessage);
@@ -798,7 +798,7 @@ void SubversionPlugin::vcsAnnotate(const QString &workingDir, const QString &fil
if (!revision.isEmpty())
args << QLatin1String("-r") << revision;
args.push_back(QLatin1String("-v"));
- args.append(QDir::toNativeSeparators(file));
+ args.append(QDir::toNativeSeparators(SubversionClient::escapeFile(file)));
const SubversionResponse response
= runSvn(workingDir, args, m_client->vcsTimeoutS(),
@@ -958,7 +958,7 @@ QString SubversionPlugin::synchronousTopic(const QString &repository) const
bool SubversionPlugin::vcsAdd(const QString &workingDir, const QString &rawFileName)
{
- const QString file = QDir::toNativeSeparators(rawFileName);
+ const QString file = QDir::toNativeSeparators(SubversionClient::escapeFile(rawFileName));
QStringList args;
args << QLatin1String("add")
<< SubversionClient::addAuthenticationOptions(client()->settings())
@@ -971,7 +971,7 @@ bool SubversionPlugin::vcsAdd(const QString &workingDir, const QString &rawFileN
bool SubversionPlugin::vcsDelete(const QString &workingDir, const QString &rawFileName)
{
- const QString file = QDir::toNativeSeparators(rawFileName);
+ const QString file = QDir::toNativeSeparators(SubversionClient::escapeFile(rawFileName));
QStringList args;
args << QLatin1String("delete");
@@ -988,7 +988,8 @@ bool SubversionPlugin::vcsMove(const QString &workingDir, const QString &from, c
{
QStringList args(QLatin1String("move"));
args << SubversionClient::addAuthenticationOptions(client()->settings());
- args << QDir::toNativeSeparators(from) << QDir::toNativeSeparators(to);
+ args << QDir::toNativeSeparators(SubversionClient::escapeFile(from))
+ << QDir::toNativeSeparators(SubversionClient::escapeFile(to));
const SubversionResponse response
= runSvn(workingDir, args, m_client->vcsTimeoutS(),
VcsCommand::SshPasswordPrompt | VcsCommand::ShowStdOut
@@ -1051,7 +1052,8 @@ bool SubversionPlugin::managesFile(const QString &workingDirectory, const QStrin
{
QStringList args;
args << QLatin1String("status");
- args << SubversionClient::addAuthenticationOptions(client()->settings()) << fileName;
+ args << SubversionClient::addAuthenticationOptions(client()->settings())
+ << QDir::toNativeSeparators(SubversionClient::escapeFile(fileName));
SubversionResponse response
= runSvn(workingDirectory, args, m_client->vcsTimeoutS(), 0);
return response.stdOut.isEmpty() || response.stdOut.at(0) != QLatin1Char('?');
diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp
index 30ac76832e..46ab0f2b48 100644
--- a/src/plugins/texteditor/basefilefind.cpp
+++ b/src/plugins/texteditor/basefilefind.cpp
@@ -477,7 +477,7 @@ CountingLabel::CountingLabel()
void CountingLabel::updateCount(int count)
{
- setText(BaseFileFind::tr("%1 found").arg(count));
+ setText(BaseFileFind::tr("%n found", nullptr, count));
}
} // namespace Internal
diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp
index ac3d3a01fa..884eeb30db 100644
--- a/src/plugins/welcome/welcomeplugin.cpp
+++ b/src/plugins/welcome/welcomeplugin.cpp
@@ -158,7 +158,6 @@ private:
void sceneGraphError(QQuickWindow::SceneGraphError, const QString &message);
void facilitateQml(QQmlEngine *engine);
void addPages(const QList<IWelcomePage *> &pages);
- void applyTheme();
void addKeyboardShortcuts();
QWidget *m_modeWidget;
@@ -166,7 +165,6 @@ private:
QMap<Id, IWelcomePage *> m_idPageMap;
QList<IWelcomePage *> m_pluginList;
int m_activePlugin;
- QQmlPropertyMap m_themeProperties;
QStringList m_recentProjectsShortcuts;
QStringList m_sessionsShortcuts;
};
@@ -197,7 +195,6 @@ WelcomeMode::WelcomeMode()
layout->setSpacing(0);
m_welcomePage = new QQuickWidget;
- applyTheme(); // initialize background color and theme properties
m_welcomePage->setResizeMode(QQuickWidget::SizeRootObjectToView);
m_welcomePage->setObjectName(QLatin1String("WelcomePage"));
@@ -217,13 +214,6 @@ WelcomeMode::WelcomeMode()
setWidget(m_modeWidget);
}
-void WelcomeMode::applyTheme()
-{
- const QVariantHash creatorTheme = Utils::creatorTheme()->values();
- for (auto it = creatorTheme.constBegin(); it != creatorTheme.constEnd(); ++it)
- m_themeProperties.insert(it.key(), it.value());
-}
-
void WelcomeMode::addKeyboardShortcuts()
{
const int actionsCount = 9;
@@ -294,7 +284,7 @@ void WelcomeMode::facilitateQml(QQmlEngine *engine)
QQmlContext *ctx = engine->rootContext();
ctx->setContextProperty(QLatin1String("welcomeMode"), this);
- ctx->setContextProperty(QLatin1String("creatorTheme"), &m_themeProperties);
+ ctx->setContextProperty(QLatin1String("creatorTheme"), Utils::creatorTheme()->values());
ctx->setContextProperty(QLatin1String("useNativeText"), true);
}
diff --git a/src/shared/qbs b/src/shared/qbs
-Subproject 7a8a21c03b8e49e7dbf0462d2c698e960bdacbb
+Subproject ab14d325eaa1ee762dacc8b9fbbc902dae4d5e6
diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg
index e6e5e59dcb..3e7abe3c63 100644
--- a/src/tools/icons/qtcreatoricons.svg
+++ b/src/tools/icons/qtcreatoricons.svg
@@ -5128,7 +5128,7 @@
sodipodi:nodetypes="cccccccc" />
</g>
<g
- id="src/plugins/debugger/images/breakpoint"
+ id="src/libs/utils/images/filledcircle"
transform="translate(-422,-48)">
<rect
y="584"
diff --git a/src/tools/iostool/iostool.qbs b/src/tools/iostool/iostool.qbs
index abc8a5bac1..1d5e282104 100644
--- a/src/tools/iostool/iostool.qbs
+++ b/src/tools/iostool/iostool.qbs
@@ -11,13 +11,13 @@ QtcTool {
Depends { name: "app_version_header" }
files: [
+ "Info.plist",
"main.cpp",
"iosdevicemanager.cpp",
"iosdevicemanager.h"
]
cpp.frameworks: base.concat(["CoreFoundation", "CoreServices", "IOKit", "Security",
"SystemConfiguration"])
- bundle.infoPlistFile: "Info.plist"
installDir: qtc.ide_libexec_path + "/ios"
}
diff --git a/src/tools/iostool/main.cpp b/src/tools/iostool/main.cpp
index 0671cb258c..a02fb446e3 100644
--- a/src/tools/iostool/main.cpp
+++ b/src/tools/iostool/main.cpp
@@ -742,9 +742,9 @@ void IosTool::didStartApp(const QString &bundlePath, const QString &deviceId,
QMutexLocker l(&m_xmlMutex);
out.writeStartElement(QLatin1String("server_ports"));
out.writeAttribute(QLatin1String("gdb_server"),
- QString::number(gdbServer ? gdbServer->serverPort() : 0));
+ QString::number(gdbServer ? gdbServer->serverPort() : -1));
out.writeAttribute(QLatin1String("qml_server"),
- QString::number(qmlServer ? qmlServer->serverPort() : 0));
+ QString::number(qmlServer ? qmlServer->serverPort() : -1));
out.writeEndElement();
outFile.flush();
}
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index 2460895197..786201dfcb 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -1374,7 +1374,7 @@ void tst_Dumpers::dumper()
"python theDumper.fetchVariables({"
"'token':2,'fancy':1,'forcens':1,"
"'autoderef':1,'dyntype':1,'passexceptions':1,"
- "'qobjectnames':1,"
+ "'testing':1,'qobjectnames':1,"
"'expanded':[" + expandedq + "]})\n";
cmds += "quit\n";
@@ -1398,7 +1398,7 @@ void tst_Dumpers::dumper()
"!qtcreatorcdbext.script -t 42 theDumper.fetchVariables({"
"'token':2,'fancy':1,'forcens':1,"
"'autoderef':1,'dyntype':1,'passexceptions':0,"
- "'qobjectnames':1,"
+ "'testing':1,'qobjectnames':1,"
"'expanded':[" + expandedq + "]})\n"
"q\n";
} else if (m_debuggerEngine == LldbEngine) {
@@ -1413,7 +1413,7 @@ void tst_Dumpers::dumper()
// "sc print(dir())\n"
"sc Tester('" + t->buildPath.toLatin1() + "/doit', {'fancy':1,'forcens':1,"
"'autoderef':1,'dyntype':1,'passexceptions':1,"
- "'qobjectnames':1,"
+ "'testing':1,'qobjectnames':1,"
"'expanded':[" + expandedq + "]})\n"
"quit\n";
@@ -5943,7 +5943,12 @@ void tst_Dumpers::dumper_data()
" { T1() : i1(1) {} int i1; };\n"
"struct T2 : virtual VEmpty, virtual VData\n"
" { T2() : i2(1) {} int i2; };\n"
- "struct TT : T1, T2 { TT() : c(1) {} int c; };\n";
+ "struct TT : T1, T2 { TT() : c(1) {} int c; };\n"
+
+ "struct A { int a = 1; char aa = 'a'; };\n"
+ "struct B : virtual A { int b = 2; float bb = 2; };\n"
+ "struct C : virtual A { int c = 3; double cc = 3; };\n"
+ "struct D : virtual B, virtual C { int d = 4; };\n";
QTest::newRow("Inheritance")
<< Data(inheritanceData,
@@ -5956,15 +5961,44 @@ void tst_Dumpers::dumper_data()
"TT tt;\n"
"tt.T1::v = 44;\n"
"tt.T2::v = 45;\n"
- "unused(&tt.T2::v);\n")
+ "unused(&tt.T2::v);\n"
+ "D dd; unused(&dd);\n"
+ "D *dp = new D; unused(&dp);\n"
+ "D &dr = dd; unused(&dr);\n")
+ + Cxx11Profile()
+ Check("c.c", "1", "int")
- + Check("c.@1.@2.a", "42", "int")
- + Check("c.@1.@4.v", "45", "int")
- + Check("c.@2.@2.a", "43", "int")
- + Check("c.@2.@4.v", "45", "int")
+ + Check("c.@1.@2.a", "42", "int") % NoLldbEngine
+ + Check("c.@1.@4.v", "45", "int") % NoLldbEngine
+ + Check("c.@2.@2.a", "43", "int") % NoLldbEngine
+ + Check("c.@2.@4.v", "45", "int") % NoLldbEngine
+ + Check("c.@1.@1.a", "42", "int") % LldbEngine
+ + Check("c.@1.@2.v", "45", "int") % LldbEngine
+ + Check("c.@2.@1.a", "43", "int") % LldbEngine
+ + Check("c.@2.@2.v", "45", "int") % LldbEngine
+ Check("tt.c", "1", "int")
- + Check("tt.@1.@2.v", "45", "int")
- + Check("tt.@2.@2.v", "45", "int");
+ + Check("tt.@1.@2.v", "45", "int") % NoLldbEngine
+ + Check("tt.@2.@2.v", "45", "int") % NoLldbEngine
+ + Check("tt.@1.@1.v", "45", "int") % LldbEngine
+ + Check("tt.@2.@1.v", "45", "int") % LldbEngine
+
+ + Check("dd.@1.@1.a", "1", "int") // B::a
+ + Check("dd.@2.@1.a", "1", "int") // C::a
+ + Check("dd.@1.b", "2", "int")
+ + Check("dd.@2.c", "3", "int")
+ + Check("dd.d", "4", "int")
+
+ + Check("dp.@1.@1.a", "1", "int") // B::a
+ + Check("dp.@2.@1.a", "1", "int") // C::a
+ + Check("dp.@1.b", "2", "int")
+ + Check("dp.@2.c", "3", "int")
+ + Check("dp.d", "4", "int")
+
+ + Check("dr.@1.@1.a", "1", "int") // B::a
+ + Check("dr.@2.@1.a", "1", "int") // C::a
+ + Check("dr.@1.b", "2", "int")
+ + Check("dr.@2.c", "3", "int")
+ + Check("dr.d", "4", "int");
+
QTest::newRow("Gdb13393")
<< Data(
@@ -6233,6 +6267,11 @@ void tst_Dumpers::dumper_data()
+ Check("v15", "\"utf16\"", "@QJSValue (QString)")
+ Check("v15.1", "[1]", "116", "@QChar");
+ QTest::newRow("Internal1")
+ << Data("struct QtcDumperTest_FieldAccessByIndex { int d[3] = { 10, 11, 12 }; };\n",
+ "QtcDumperTest_FieldAccessByIndex d; unused(&d);\n")
+ + Check("d", "12", "QtcDumperTest_FieldAccessByIndex");
+
#if 0
#ifdef Q_OS_LINUX
// Hint: To open a failing test in Creator, do:
diff --git a/tests/system/objects.map b/tests/system/objects.map
index 9bd6992fc0..7288a0e400 100644
--- a/tests/system/objects.map
+++ b/tests/system/objects.map
@@ -38,6 +38,8 @@
:Breakpoints_Debugger::Internal::BreakTreeView {container=':Debugger.Docks.BreakDockWidget.Debugger.Docks.Break_QFrame' type='Utils::BaseTreeView' unnamed='1' visible='1'}
:Build and Run.Save all files before build_QCheckBox {name='saveAllFilesCheckBox' type='QCheckBox' visible='1'}
:BuildAndRun_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'}
+:CCompiler:_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':CCompiler:_QLabel' type='QComboBox' unnamed='1' visible='1'}
+:CCompiler:_QLabel {container=':qt_tabwidget_stackedwidget_QWidget' text='C:' type='QLabel' unnamed='1' visible='1'}
:Cannot Open Project.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Cannot Open Project_QMessageBox'}
:Cannot Open Project.Show Details..._QPushButton {text='Show Details...' type='QPushButton' unnamed='1' visible='1' window=':Cannot Open Project_QMessageBox'}
:Cannot Open Project_QMessageBox {text?='Failed to open project in *' type='QMessageBox' unnamed='1' visible='1'}
@@ -49,9 +51,9 @@
:CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget {name='listWidget' type='QListWidget' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}
:CodePaster__Internal__PasteSelectDialog.protocolBox_QComboBox {name='protocolBox' type='QComboBox' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}
:CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog {name='CodePaster__Internal__PasteSelectDialog' type='CodePaster::PasteSelectDialog' visible='1'}
-:Compiler:_QComboBox {aboveWidget=':Path.Utils_BaseValidatingLineEdit' container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':Compiler:_QLabel' type='QComboBox' unnamed='1' visible='1'}
-:Compiler:_QLabel {container=':qt_tabwidget_stackedwidget_QWidget' text='Compiler:' type='QLabel' unnamed='1' visible='1'}
:Core__Internal__GeneralSettings.User Interface_QGroupBox {container=':qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget' name='interfaceBox' title='User Interface' type='QGroupBox' visible='1'}
+:CppCompiler:_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':CppCompiler:_QLabel' type='QComboBox' unnamed='1' visible='1'}
+:CppCompiler:_QLabel {container=':qt_tabwidget_stackedwidget_QWidget' text='C++:' type='QLabel' unnamed='1' visible='1'}
:CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox {container=':qt_tabwidget_stackedwidget_QScrollArea' name='groupBox' title='Behavior' type='QGroupBox' visible='1'}
:DebugModeWidget.Debugger Log_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.OutputDockWidget' type='QDockWidget' visible='1'}
:DebugModeWidget.Debugger.Docks.BreakDockWidget_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.BreakDockWidget' type='QDockWidget' visible='1'}
@@ -117,7 +119,7 @@
:Options_Core::Internal::SettingsDialog {type='Core::Internal::SettingsDialog' unnamed='1' visible='1' windowTitle~='(Options|Preferences)'}
:Options_QListView {type='QListView' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
:Path.Utils_BaseValidatingLineEdit {container=':qt_tabwidget_stackedwidget_QWidget' name='LineEdit' type='Utils::FancyLineEdit' visible='1'}
-:Projects.ProjectNavigationTreeView {container=':*Qt Creator.ProjectSelectorDockWidget_QDockWidget' name='ProjectNavigation' type='Utils::NavigationTreeView' visible='1'}
+:Projects.ProjectNavigationTreeView {container=':*Qt Creator.ProjectSelectorDockWidget_QDockWidget' name='ProjectNavigation' type='Utils::BaseTreeView' visible='1'}
:QML Debugging.No_QPushButton {text='No' type='QPushButton' unnamed='1' visible='1' window=':QML Debugging_QMessageBox'}
:QML Debugging_QMessageBox {text='The option will only take effect if the project is recompiled. Do you want to recompile now?' type='QMessageBox' unnamed='1' visible='1'}
:Qt Creator.Add Bookmark_QToolButton {text='Add Bookmark' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py
index 6b7f7dbd05..853b2187a1 100644
--- a/tests/system/shared/project.py
+++ b/tests/system/shared/project.py
@@ -629,6 +629,8 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
version = None
if 'only available with Qt 5.6' in text:
result = [Targets.DESKTOP_561_DEFAULT]
+ elif 'available with Qt 5.7 and later' in text:
+ result = [] # FIXME we have currently no Qt5.7+ available in predefined settings
elif 'Supported Platforms' in text:
supports = text[text.find('Supported Platforms'):].split(":")[1].strip().split(" ")
result = []
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py
index 9f716d8639..db4c4e1cd5 100644
--- a/tests/system/shared/utils.py
+++ b/tests/system/shared/utils.py
@@ -198,7 +198,7 @@ def invokeMenuItem(menu, item, *subItems):
itemObject = waitForObjectItem(objectMap.realName(menuObject), item)
waitFor("itemObject.enabled", 2000)
activateItem(itemObject)
- numberedPrefix = "&?\\d+: "
+ numberedPrefix = "(&\\d \| )?"
for subItem in subItems:
sub = itemObject.menu()
waitFor("sub.visible", 1000)
@@ -209,7 +209,7 @@ def invokeMenuItem(menu, item, *subItems):
for i in range(actions.count()):
current = actions.at(i)
nonPrefix = subItem[len(numberedPrefix):]
- matcher = re.match("(%s)(.*)" % numberedPrefix, str(current.text))
+ matcher = re.match("%s(.*)" % numberedPrefix, str(current.text))
if matcher and matcher.group(2) == nonPrefix:
itemObject = current
activateItem(itemObject)
diff --git a/tests/system/suite_editors/tst_generic_highlighter/test.py b/tests/system/suite_editors/tst_generic_highlighter/test.py
index a47b2136b2..8e249df54e 100644
--- a/tests/system/suite_editors/tst_generic_highlighter/test.py
+++ b/tests/system/suite_editors/tst_generic_highlighter/test.py
@@ -213,7 +213,7 @@ def main():
recentFile = os.path.join(folder, current)
if recentFile.startswith(home) and platform.system() in ('Linux', 'Darwin'):
recentFile = recentFile.replace(home, "~", 1)
- invokeMenuItem("File", "Recent Files", "&?\\d+: %s" % recentFile)
+ invokeMenuItem("File", "Recent Files", "(&\\d \| )?%s" % recentFile)
editor = getEditorForFileSuffix(current)
display = displayHintForHighlighterDefinition(current, patterns, lPatterns,
addedHighlighterDefinition,
diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py
index 20b819300e..126e1f3d7e 100644
--- a/tests/system/suite_general/tst_create_proj_wizard/test.py
+++ b/tests/system/suite_general/tst_create_proj_wizard/test.py
@@ -83,6 +83,11 @@ def main():
if counter < len(qtVersionsForQuick) - 1:
displayedPlatforms = __createProject__(category, template)
continue
+ elif template == "Qt Quick Controls 2 Application": # needs a Qt5.7
+ clickButton(waitForObject(":Next_QPushButton")) # ignore this details page for now
+ verifyKitCheckboxes(kits, displayedPlatforms)
+ safeClickButton("Cancel")
+ continue
elif template.startswith("Plain C"):
for counter, buildSystem in enumerate(availableBuildSystems):
combo = "{name='BuildSystem' type='Utils::TextFieldComboBox' visible='1'}"
diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py
index 1568c6e114..a615f97e20 100644
--- a/tests/system/suite_general/tst_default_settings/test.py
+++ b/tests/system/suite_general/tst_default_settings/test.py
@@ -84,27 +84,40 @@ def __checkBuildAndRun__():
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits")
__iterateTree__(":BuildAndRun_QTreeView", __kitFunc__, foundQt, foundCompilerNames)
+def __processSubItems__(treeObjStr, section, parModelIndexStr, doneItems,
+ additionalFunc, *additionalParameters):
+ global currentSelectedTreeItem
+ model = waitForObject(treeObjStr).model()
+ items = dumpIndices(model, section)
+ for it in items:
+ indexName = str(it.data().toString())
+ itObj = "%s container=%s}" % (objectMap.realName(it)[:-1], parModelIndexStr)
+ alreadyDone = doneItems.count(itObj)
+ doneItems.append(itObj)
+ if alreadyDone:
+ itObj = "%s occurrence='%d'}" % (itObj[:-1], alreadyDone + 1)
+ currentSelectedTreeItem = waitForObject(itObj, 3000)
+ mouseClick(currentSelectedTreeItem, 5, 5, 0, Qt.LeftButton)
+ additionalFunc(indexName, *additionalParameters)
+ currentSelectedTreeItem = None
+ if model.rowCount(it) > 0:
+ __processSubItems__(treeObjStr, it, itObj, doneItems,
+ additionalFunc, *additionalParameters)
+
def __iterateTree__(treeObjStr, additionalFunc, *additionalParameters):
global currentSelectedTreeItem
model = waitForObject(treeObjStr).model()
# 1st row: Auto-detected, 2nd row: Manual
for sect in dumpIndices(model):
- sObj = "%s container='%s'}" % (objectMap.realName(sect)[:-1], treeObjStr)
- items = dumpIndices(model, sect)
doneItems = []
- for it in items:
- indexName = str(it.data().toString())
- itObj = "%s container=%s}" % (objectMap.realName(it)[:-1], sObj)
- alreadyDone = doneItems.count(itObj)
- doneItems.append(itObj)
- if alreadyDone:
- itObj = "%s occurrence='%d'}" % (itObj[:-1], alreadyDone + 1)
- currentSelectedTreeItem = waitForObject(itObj, 3000)
- mouseClick(currentSelectedTreeItem, 5, 5, 0, Qt.LeftButton)
- additionalFunc(indexName, *additionalParameters)
- currentSelectedTreeItem = None
+ parentModelIndex = "%s container='%s'}" % (objectMap.realName(sect)[:-1], treeObjStr)
+ __processSubItems__(treeObjStr, sect, parentModelIndex, doneItems,
+ additionalFunc, *additionalParameters)
def __compFunc__(it, foundComp, foundCompNames):
+ # skip sub section items (will continue on its children)
+ if str(it) == "C" or str(it) == "C++":
+ return
try:
waitFor("object.exists(':Path.Utils_BaseValidatingLineEdit')", 1000)
pathLineEdit = findObject(":Path.Utils_BaseValidatingLineEdit")
@@ -144,12 +157,17 @@ def __kitFunc__(it, foundQt, foundCompNames):
test.compare(it, "Desktop (default)", "Verifying whether default Desktop kit has been created.")
if foundQt:
test.compare(qtVersionStr, foundQt, "Verifying if Qt versions match.")
- compilerCombo = findObject(":Compiler:_QComboBox")
- test.compare(compilerCombo.enabled, compilerCombo.count > 1,
- "Verifying whether compiler combo is enabled/disabled correctly.")
+ cCompilerCombo = findObject(":CCompiler:_QComboBox")
+ test.compare(cCompilerCombo.enabled, cCompilerCombo.count > 1,
+ "Verifying whether C compiler combo is enabled/disabled correctly.")
+ cppCompilerCombo = findObject(":CppCompiler:_QComboBox")
+ test.compare(cppCompilerCombo.enabled, cppCompilerCombo.count > 1,
+ "Verifying whether C++ compiler combo is enabled/disabled correctly.")
- test.verify(str(compilerCombo.currentText) in foundCompNames,
- "Verifying if one of the found compilers had been set.")
+ test.verify(str(cCompilerCombo.currentText) in foundCompNames,
+ "Verifying if one of the found C compilers had been set.")
+ test.verify(str(cppCompilerCombo.currentText) in foundCompNames,
+ "Verifying if one of the found C++ compilers had been set.")
if currentSelectedTreeItem:
foundWarningOrError = warningOrError.search(str(currentSelectedTreeItem.toolTip))
if foundWarningOrError:
@@ -158,12 +176,13 @@ def __kitFunc__(it, foundQt, foundCompNames):
test.warning("Detected error and/or warning: %s" % details)
def __getExpectedCompilers__():
+ # TODO: enhance this to distinguish between C and C++ compilers
expected = []
if platform.system() in ('Microsoft', 'Windows'):
expected.extend(__getWinCompilers__())
- compilers = ["g++"]
+ compilers = ["g++", "gcc"]
if platform.system() in ('Linux', 'Darwin'):
- compilers.extend(["g++-4.0", "g++-4.2", "clang++"])
+ compilers.extend(["g++-4.0", "g++-4.2", "clang++", "clang"])
if platform.system() == 'Darwin':
xcodeClang = getOutputFromCmdline(["xcrun", "--find", "clang++"]).strip("\n")
if xcodeClang and os.path.exists(xcodeClang) and xcodeClang not in expected:
@@ -171,7 +190,7 @@ def __getExpectedCompilers__():
for compiler in compilers:
compilerPath = which(compiler)
if compilerPath:
- if compiler.endswith('clang++'):
+ if compiler.endswith('clang++') or compiler.endswith('clang'):
if subprocess.call([compiler, '-dumpmachine']) != 0:
test.warning("clang found in PATH, but version is not supported.")
continue