From 115615fc7ca880aa8e12308df79a0a63548c0d5b Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 8 Dec 2017 15:09:29 +0100 Subject: [PATCH 01/20] Qmake: Do not crash when accessing PriFiles from project tree The project tree is static nowadays, and the QmakePriFileNodes hold pointers to their corresponding PriFiles. This is fast, but not entirely safe: The PriFiles are constantly updating as the project is parsed. So make sure not to rely on the stored pointer while the project is parsing and go through Project::rootProFile() in that case. Once the parsing is done, the project tree has been updated with new data, that reflects the current QmakePriFile tree. Task-number: QTCREATORBUG-19428 Change-Id: Ifaa3432cad7774142d562648d93104629736d478 Reviewed-by: Eike Ziller --- src/plugins/qmakeprojectmanager/qmakenodes.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index 2d0ff674657..5efacbf4c47 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -53,7 +53,11 @@ QmakePriFileNode::QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmak QmakePriFile *QmakePriFileNode::priFile() const { - return m_qmakePriFile; + if (!m_project->isParsing()) + return m_qmakePriFile; + // During a parsing run the qmakePriFile tree will change, so search for the PriFile and + // do not depend on the cached value. + return m_project->rootProFile()->findPriFile(filePath()); } bool QmakePriFileNode::deploysFolder(const QString &folder) const From 1d2049bffc5471901f7d1252b9bad946e49912d1 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 11 Dec 2017 12:01:14 +0100 Subject: [PATCH 02/20] Dumper: Fix typo Change-Id: I2d7bbe88c4d1552dba505003020c86a406821f72 Reviewed-by: hjk --- share/qtcreator/debugger/gdbbridge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index a046ce8ebe8..0425641c6df 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -710,7 +710,7 @@ class Dumper(DumperBase): self.output += ',partial="%d"' % isPartial self.output += ',counts=%s' % self.counts - self.output += ',timimgs=%s' % self.timings + self.output += ',timings=%s' % self.timings self.reportResult(self.output) def parseAndEvaluate(self, exp): From c9d2453a4df347f0500340d7e21cd9219b1d5549 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 12 Dec 2017 17:12:56 +0100 Subject: [PATCH 03/20] QmlDesigner: Increase the bounding rectangle Since we clip against the bounding rectangle we increase the size a bit. This ensures we do not get painting artefacts if something is 1 or 2 pixels off. Change-Id: I4d9c40dd25aaa4469b568df914a1290f21790271 Reviewed-by: Tim Jenssen --- .../qmldesigner/components/formeditor/formeditoritem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp index 54d5d1536dc..d6bd69ed2cd 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp @@ -86,7 +86,7 @@ void FormEditorItem::setup() QRectF FormEditorItem::boundingRect() const { - return m_boundingRect; + return m_boundingRect.adjusted(-2, -2, 2, 2); } QPainterPath FormEditorItem::shape() const @@ -338,7 +338,7 @@ void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, if (isInStackedContainer) showPlaceHolder = qmlItemNode().instanceIsRenderPixmapNull() && isContentVisible(); - painter->setClipRegion(m_boundingRect.toRect()); + painter->setClipRegion(boundingRect().toRect()); painter->setClipping(true); if (!hideCompletely) { From a60b3fdd87257908a01a54a55eece3d56f31fceb Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 12 Dec 2017 16:36:14 +0100 Subject: [PATCH 04/20] QmlDesigner: Do not slide frames The compression in the rewriter currently cannot handle slides in transactions. Change-Id: I2daa77d35b2de5676149d55c2c5efdf55528d868 Reviewed-by: Tim Jenssen --- .../qmldesigner/designercore/model/qmltimelinekeyframes.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/designercore/model/qmltimelinekeyframes.cpp b/src/plugins/qmldesigner/designercore/model/qmltimelinekeyframes.cpp index 8770e78e306..90f6224021b 100644 --- a/src/plugins/qmldesigner/designercore/model/qmltimelinekeyframes.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmltimelinekeyframes.cpp @@ -113,10 +113,12 @@ int QmlTimelineFrames::indexOfFrame(const ModelNode &frame) const return modelNode().defaultNodeListProperty().indexOf(frame); } -void QmlTimelineFrames::slideFrame(int sourceIndex, int targetIndex) +void QmlTimelineFrames::slideFrame(int /*sourceIndex*/, int /*targetIndex*/) { + /* if (targetIndex != sourceIndex) modelNode().defaultNodeListProperty().slide(sourceIndex, targetIndex); + */ } void QmlTimelineFrames::setValue(const QVariant &value, qreal currentFrame) From 800aa7466f06abff21528b64273df84fe6322d4a Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 13 Dec 2017 09:38:18 +0100 Subject: [PATCH 05/20] Debugger: improve symbol lookup times for cdb Task-number: QTCREATORBUG-18613 Change-Id: If8dac096fa4d0d8afc6fb8f7bbffd090a5dc6e19 Reviewed-by: Christian Stenger --- src/plugins/debugger/cdb/cdbengine.cpp | 1 + tests/auto/debugger/tst_dumpers.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 4949694eccd..634a913ada1 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -566,6 +566,7 @@ void CdbEngine::setupInferior() [this, id](const DebuggerResponse &r) { handleBreakInsert(r, id); }}); } + runCommand({".symopt+0x8000"}); // disable searching public symbol table - improving the symbol lookup speed runCommand({"sxn 0x4000001f", NoFlags}); // Do not break on WowX86 exceptions. runCommand({"sxn ibp", NoFlags}); // Do not break on initial breakpoints. runCommand({".asm source_line", NoFlags}); // Source line in assembly diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index ef311bce694..b627849496e 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1517,7 +1517,8 @@ void tst_Dumpers::dumper() << "-c" << "bm doit!qtcDebugBreakFunction;g" << "debug\\doit.exe"; - cmds += "!qtcreatorcdbext.script sys.path.insert(1, '" + dumperDir + "')\n" + cmds += ".symopt+0x8000\n" + "!qtcreatorcdbext.script sys.path.insert(1, '" + dumperDir + "')\n" "!qtcreatorcdbext.script from cdbbridge import *\n" "!qtcreatorcdbext.script theDumper = Dumper()\n" "!qtcreatorcdbext.script theDumper.setupDumpers()\n" From bd8027d2320d5205e074464436bbfd63f237ffe1 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 13 Dec 2017 13:46:41 +0100 Subject: [PATCH 06/20] Revert "Squish: Update expected line in tst_simple_debug" ...because the project template was changed once again. This reverts commit fe5249c401b0d0e99b33acddac5c65f2298a9679. Change-Id: Ie7940c4dfa98ed71d8c1e937c087918f9157cbfd Reviewed-by: Christian Stenger --- tests/system/suite_debugger/tst_simple_debug/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/suite_debugger/tst_simple_debug/test.py b/tests/system/suite_debugger/tst_simple_debug/test.py index aff1aa88512..c726d6468bb 100644 --- a/tests/system/suite_debugger/tst_simple_debug/test.py +++ b/tests/system/suite_debugger/tst_simple_debug/test.py @@ -52,7 +52,7 @@ def main(): test.log("Setting breakpoints") result = setBreakpointsForCurrentProject(filesAndLines) if result: - expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):12}, + expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):10}, {os.path.join(workingDir, projectName, "main.qml"):13}] availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug") progressBarWait() From c98131d8e791f6b7cf929d5465b8e89c12db0cf0 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 14 Dec 2017 06:46:26 +0100 Subject: [PATCH 07/20] AutoTest: Fix setting test executable for output reader The test executable of the process must be set before creating an instance of the output reader as the process' command file path is only read on construction. This lead to wrong ordering inside the result model at least for the first test case. Change-Id: I4140ee02c8e2ea4105d276017a460676514abc91 Reviewed-by: David Schulz --- src/plugins/autotest/testrunner.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index a49831d5a4b..b1860111c76 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -195,6 +195,15 @@ static void performTestRun(QFutureInterface &futureInterface, futureInterface.setProgressValue(0); for (const TestConfiguration *testConfiguration : selectedTests) { + QString commandFilePath = testConfiguration->executableFilePath(); + if (commandFilePath.isEmpty()) { + futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageFatal, + TestRunner::tr("Executable path is empty. (%1)") + .arg(testConfiguration->displayName())))); + continue; + } + testProcess.setProgram(commandFilePath); + QScopedPointer outputReader; outputReader.reset(testConfiguration->outputReader(futureInterface, &testProcess)); QTC_ASSERT(outputReader, continue); @@ -206,15 +215,6 @@ static void performTestRun(QFutureInterface &futureInterface, if (!testConfiguration->project()) continue; - QProcessEnvironment environment = testConfiguration->environment().toProcessEnvironment(); - QString commandFilePath = testConfiguration->executableFilePath(); - if (commandFilePath.isEmpty()) { - futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageFatal, - TestRunner::tr("Executable path is empty. (%1)") - .arg(testConfiguration->displayName())))); - continue; - } - QStringList omitted; testProcess.setArguments(testConfiguration->argumentsForTestRunner(&omitted)); if (!omitted.isEmpty()) { @@ -223,10 +223,10 @@ static void performTestRun(QFutureInterface &futureInterface, details.arg(testConfiguration->displayName())))); } testProcess.setWorkingDirectory(testConfiguration->workingDirectory()); + QProcessEnvironment environment = testConfiguration->environment().toProcessEnvironment(); if (Utils::HostOsInfo::isWindowsHost()) environment.insert("QT_LOGGING_TO_CONSOLE", "1"); testProcess.setProcessEnvironment(environment); - testProcess.setProgram(commandFilePath); testProcess.start(); bool ok = testProcess.waitForStarted(); From 79ba461a4699b5cea43e086ebd81ad87cd56d5b3 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 13 Dec 2017 17:42:57 +0100 Subject: [PATCH 08/20] Debugger: Suppress variables from unrelated scopes Change-Id: Ib7ae6c2af37a2cdb7dfd63d0622e68b55f7a778d Task-number: QTCREATORBUG-19445 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/lldbbridge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 181b7ac657f..48f678d9d23 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -1148,7 +1148,7 @@ class Dumper(DumperBase): # values = [frame.FindVariable(partialVariable)] #else: if True: - values = list(frame.GetVariables(True, True, False, False)) + values = list(frame.GetVariables(True, True, False, True)) values.reverse() # To get shadowed vars numbered backwards. variables = [] From 67c3b232f8990a0197e490651ffd372f62304a7e Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 13 Dec 2017 13:37:33 +0100 Subject: [PATCH 09/20] ProjectExplorer: No native dir separators in detectCppBuildTools2015 Having native dir separators in the autodetected C++ build tools 2015 caused Qt Creator to add all msvc compilers a second time as manual MSVC versions. Reason was one different dir separator during string comparison in AbstractMsvcToolChain::operator == detectCppBuildTools2017 did the conversion right Change-Id: Iff04428bcc47636b161b944c94cadf12b0c549da Reviewed-by: Eike Ziller Reviewed-by: David Schulz --- src/plugins/projectexplorer/msvctoolchain.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 2f0db8d0748..a64b749e33c 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -146,16 +146,20 @@ QDebug operator<<(QDebug d, const VisualStudioInstallation &i) return d; } -// Detect build tools introduced with MSVC2017 -static Utils::optional detectCppBuildTools2017() +static QString windowsProgramFilesDir() { #ifdef Q_OS_WIN64 const char programFilesC[] = "ProgramFiles(x86)"; #else const char programFilesC[] = "ProgramFiles"; #endif + return QDir::fromNativeSeparators(QFile::decodeName(qgetenv(programFilesC))); +} - const QString installPath = QDir::fromNativeSeparators(QFile::decodeName(qgetenv(programFilesC))) +// Detect build tools introduced with MSVC2017 +static Utils::optional detectCppBuildTools2017() +{ + const QString installPath = windowsProgramFilesDir() + "/Microsoft Visual Studio/2017/BuildTools"; const QString vcVarsPath = installPath + "/VC/Auxiliary/Build"; const QString vcVarsAllPath = vcVarsPath + "/vcvarsall.bat"; @@ -887,14 +891,9 @@ static void detectCppBuildTools2015(QList *list) {" (x64_arm)", "amd64_arm", Abi::ArmArchitecture, Abi::PEFormat, 64} }; -#ifdef Q_OS_WIN64 - const char programFilesC[] = "ProgramFiles(x86)"; -#else - const char programFilesC[] = "ProgramFiles"; -#endif const QString name = QStringLiteral("Microsoft Visual C++ Build Tools"); - const QString vcVarsBat = QFile::decodeName(qgetenv(programFilesC)) - + QLatin1Char('/') + name + QStringLiteral("/vcbuildtools.bat"); + const QString vcVarsBat = windowsProgramFilesDir() + + QLatin1Char('/') + name + QStringLiteral("/vcbuildtools.bat"); if (!QFileInfo(vcVarsBat).isFile()) return; const size_t count = sizeof(entries) / sizeof(entries[0]); From 7ded6bef30e6e4c6a9878b8da1e82b87dce218da Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 30 Nov 2017 14:03:02 +0100 Subject: [PATCH 10/20] Squish: Skip "Extract Function" with clang on Windows Change-Id: Id98d630babff10fe0def36aa895f70587852036b Reviewed-by: Christian Stenger --- tests/system/suite_CSUP/tst_CSUP03/test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/system/suite_CSUP/tst_CSUP03/test.py b/tests/system/suite_CSUP/tst_CSUP03/test.py index bd4478000ef..21bc53f5c2f 100644 --- a/tests/system/suite_CSUP/tst_CSUP03/test.py +++ b/tests/system/suite_CSUP/tst_CSUP03/test.py @@ -77,6 +77,10 @@ def main(): } for useClang in [False, True]: with TestSection(getCodeModelString(useClang)): + if (useClang and platform.system() in ('Windows', 'Microsoft') + and JIRA.isBugStillOpen(18607)): + test.warning("Skipping unstable tests on Windows", "See QTCREATORBUG-18607") + continue if not startCreator(useClang): continue projectName = createNewNonQtProject() From 5efe63ac8cddb7dd3b02d58efafd77e0b269ecdd Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 15 Dec 2017 11:06:45 +0100 Subject: [PATCH 11/20] Update qbs submodule To HEAD of 1.10 branch. Change-Id: I4df99065f2ef1513eead623cb3f117ce2b65baea Reviewed-by: Jake Petroules --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 1ee42601293..8815e000700 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 1ee4260129336c83d7acab1e3e675f7f507ad46f +Subproject commit 8815e0007006e996bc145a91970d71b9b4ae86d0 From 9b182e28abc9ddf5f514a08e0c3ac63e72549f7f Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Fri, 15 Dec 2017 23:44:22 +0100 Subject: [PATCH 12/20] doc: Add missing space escaping to command line call example This change reflects what the macOS users will see when they use the command line to call Qt Creator. Change-Id: If6b644390ad06d5ddbe349507713eb2d2e27cef6 Reviewed-by: Jake Petroules --- doc/src/howto/creator-cli.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/howto/creator-cli.qdoc b/doc/src/howto/creator-cli.qdoc index c8588a46090..62203cfb5a8 100644 --- a/doc/src/howto/creator-cli.qdoc +++ b/doc/src/howto/creator-cli.qdoc @@ -65,7 +65,7 @@ \list - \li \c {Qt Creator.app/Contents/MacOS/Qt Creator -help} + \li \c {Qt\ Creator.app/Contents/MacOS/Qt\ Creator -help} \endlist From a5ceca3a8da147e054ca65ada92987635841f215 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 18 Dec 2017 11:03:57 +0100 Subject: [PATCH 13/20] Debugger: fix state handling when aborting debugger Change-Id: Ied4fcf7d39bf8ca96714fc3fbbdb7edd88f1048b Reviewed-by: hjk --- src/plugins/debugger/debuggerengine.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index c5683ca1aca..d719db913f3 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -651,7 +651,6 @@ void DebuggerEngine::notifyEngineSetupFailed() setState(EngineSetupFailed); if (isMasterEngine() && runTool()) { showMessage(tr("Debugging has failed"), NormalMessageFormat); - d->m_runTool.clear(); d->m_progress.setProgressValue(900); d->m_progress.reportCanceled(); d->m_progress.reportFinished(); From f8b10bf5b02c774c4e5854547323115490c729ae Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 18 Dec 2017 21:18:38 +0100 Subject: [PATCH 14/20] QmlProfiler/timeline: Avoid modulo with negative divisor All of a sudden, using modulo with a negative divisor in qml/js crashes with the latest Qt dev (upcoming 5.11). Change-Id: Iabd7fbaf7367ff630065d6863e03c10710bf0cd4 Reviewed-by: Ulf Hermann --- src/libs/timeline/qml/TimeDisplay.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/timeline/qml/TimeDisplay.qml b/src/libs/timeline/qml/TimeDisplay.qml index d7dad63c408..4351c8260e5 100644 --- a/src/libs/timeline/qml/TimeDisplay.qml +++ b/src/libs/timeline/qml/TimeDisplay.qml @@ -63,7 +63,7 @@ Item { id: row property int firstBlock: timeDisplay.offsetX / timeDisplay.pixelsPerBlock - property int offset: repeater.model - (firstBlock % repeater.model); + property int offset: repeater.model > 0 ? repeater.model - (firstBlock % repeater.model) : 0; Repeater { id: repeater From a21a518d38306c74ea43217c574c93145b5f5eb0 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 15 Dec 2017 16:10:19 +0100 Subject: [PATCH 15/20] QmlProfiler: Record debug messages separately They are not time-ordered like normal messages, so we need to buffer them and only insert them when the normal event stream arrives at their timestamp. The time ordering is important as the "restrict to range" feature uses it to determine the start of the range. Change-Id: If27a3f667c4c39e69efa95fcb9cdfd3dbf01e657 Task-number: QTCREATORBUG-19456 Reviewed-by: Christian Kandeler --- .../qmlprofiler/qmlprofilertraceclient.cpp | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/plugins/qmlprofiler/qmlprofilertraceclient.cpp b/src/plugins/qmlprofiler/qmlprofilertraceclient.cpp index 39cdb96ede0..6bf359c9242 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceclient.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceclient.cpp @@ -56,6 +56,7 @@ public: bool updateFeatures(ProfileFeature feature); int resolveType(const QmlTypedEvent &type); int resolveStackTop(); + void forwardEvents(const QmlEvent &last); void processCurrentEvent(); QmlProfilerTraceClient *q; @@ -74,6 +75,7 @@ public: QHash serverTypeIds; QStack rangesInProgress; QQueue pendingMessages; + QQueue pendingDebugMessages; }; int QmlProfilerTraceClientPrivate::resolveType(const QmlTypedEvent &event) @@ -117,12 +119,21 @@ int QmlProfilerTraceClientPrivate::resolveStackTop() typedEvent.event.setTypeIndex(typeIndex); while (!pendingMessages.isEmpty() && pendingMessages.head().timestamp() < typedEvent.event.timestamp()) { - modelManager->addEvent(pendingMessages.dequeue()); + forwardEvents(pendingMessages.dequeue()); } - modelManager->addEvent(typedEvent.event); + forwardEvents(typedEvent.event); return typeIndex; } +void QmlProfilerTraceClientPrivate::forwardEvents(const QmlEvent &last) +{ + while (!pendingDebugMessages.isEmpty() + && pendingDebugMessages.front().timestamp() <= last.timestamp()) { + modelManager->addEvent(pendingDebugMessages.dequeue()); + } + modelManager->addEvent(last); +} + void QmlProfilerTraceClientPrivate::processCurrentEvent() { // RangeData and RangeLocation always apply to the range on the top of the stack. Furthermore, @@ -142,8 +153,8 @@ void QmlProfilerTraceClientPrivate::processCurrentEvent() break; currentEvent.event.setTypeIndex(typeIndex); while (!pendingMessages.isEmpty()) - modelManager->addEvent(pendingMessages.dequeue()); - modelManager->addEvent(currentEvent.event); + forwardEvents(pendingMessages.dequeue()); + forwardEvents(currentEvent.event); rangesInProgress.pop(); break; } @@ -155,11 +166,15 @@ void QmlProfilerTraceClientPrivate::processCurrentEvent() if (!rangesInProgress.isEmpty()) rangesInProgress.top().type.setLocation(currentEvent.type.location()); break; + case DebugMessage: + currentEvent.event.setTypeIndex(resolveType(currentEvent)); + pendingDebugMessages.enqueue(currentEvent.event); + break; default: { int typeIndex = resolveType(currentEvent); currentEvent.event.setTypeIndex(typeIndex); if (rangesInProgress.isEmpty()) - modelManager->addEvent(currentEvent.event); + forwardEvents(currentEvent.event); else pendingMessages.enqueue(currentEvent.event); break; @@ -202,6 +217,7 @@ void QmlProfilerTraceClient::clearData() { d->eventTypeIds.clear(); d->rangesInProgress.clear(); + d->pendingDebugMessages.clear(); if (d->recordedFeatures != 0) { d->recordedFeatures = 0; emit recordedFeaturesChanged(0); @@ -246,7 +262,7 @@ void QmlProfilerTraceClient::setRequestedFeatures(quint64 features) [this](QtMsgType type, const QString &text, const QmlDebug::QDebugContextInfo &context) { - d->updateFeatures(ProfileDebugMessages); + QTC_ASSERT(d->updateFeatures(ProfileDebugMessages), return); d->currentEvent.event.setTimestamp(context.timestamp > 0 ? context.timestamp : 0); d->currentEvent.event.setTypeIndex(-1); d->currentEvent.event.setString(text); @@ -297,6 +313,10 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data) d->currentEvent.event.setTimestamp(d->maximumTime); d->processCurrentEvent(); } + QTC_CHECK(d->pendingMessages.isEmpty()); + while (!d->pendingDebugMessages.isEmpty()) + d->modelManager->addEvent(d->pendingDebugMessages.dequeue()); + emit complete(d->maximumTime); } else if (d->currentEvent.type.message() == Event && d->currentEvent.type.detailType() == StartTrace) { From 0fcbe60cd64c13e83038ca7ea0c05db4e73105aa Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 19 Dec 2017 13:45:27 +0100 Subject: [PATCH 16/20] Tests: Fix qml import check Change-Id: I7fcf4a3b718c3b2124171187cdb06493c84ff7b8 Reviewed-by: Marco Benelli --- tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp b/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp index f362c2cdf9d..f6dbf5eb0ab 100644 --- a/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp +++ b/tests/auto/qml/codemodel/importscheck/tst_importscheck.cpp @@ -120,8 +120,7 @@ void tst_ImportCheck::test_data() QTest::addColumn("expectedFiles"); QTest::newRow("base") << QStringList(QString(TESTSRCDIR "/base")) << QStringList({"QML 1.0", "QtQml 2.2", "QtQml 2.1", "QtQuick 2.0", - "QtQml 2.0", "QtQuick 2.-1", "QtQuick 2.1", - "QtQuick 2.2", ""}) + "QtQml 2.0", "QtQuick 2.1", "QtQuick 2.2", ""}) << QStringList(); QTest::newRow("001_flatQmlOnly") << QStringList(QString(TESTSRCDIR "/001_flatQmlOnly")) << QStringList() From 83e01b47779aed20385149e6e68eaf4dd4b1b23a Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Tue, 19 Dec 2017 16:38:53 +0100 Subject: [PATCH 17/20] QmlDesigner: fix crash Change-Id: I402a6701e8339150c908e0e3eca014f3c8ee727a Task-number: QTCREATORBUG-19468 Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/documentwarningwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/documentwarningwidget.cpp b/src/plugins/qmldesigner/documentwarningwidget.cpp index a1f588559e8..2823951c1f8 100644 --- a/src/plugins/qmldesigner/documentwarningwidget.cpp +++ b/src/plugins/qmldesigner/documentwarningwidget.cpp @@ -125,7 +125,7 @@ void DocumentWarningWidget::refreshContent() } QString messageString; - DocumentMessage message = m_messages.at(m_currentMessage); + DocumentMessage message = m_messages.value(m_currentMessage); if (message.type() == DocumentMessage::ParseError) { messageString += errorToString(message); m_navigateLabel->setText(generateNavigateLinks()); From b2052561cca185ca18b114110ae401ad9cb43aec Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 13 Dec 2017 14:20:49 +0100 Subject: [PATCH 18/20] Debugger: improve evaluate expression with cdb Replace Evaluate with AddSymbol and create a PyValue representing that expression Change-Id: Ibb8ab70c41df81e9d7d683b633a070caa03036d3 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/cdbbridge.py | 14 ++++---------- src/libs/qtcreatorcdbext/pycdbextmodule.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/share/qtcreator/debugger/cdbbridge.py b/share/qtcreator/debugger/cdbbridge.py index e34b8ed48e5..7897028b647 100644 --- a/share/qtcreator/debugger/cdbbridge.py +++ b/share/qtcreator/debugger/cdbbridge.py @@ -225,13 +225,7 @@ class Dumper(DumperBase): return None def parseAndEvaluate(self, exp): - val = cdbext.parseAndEvaluate(exp) - if val is None: - return None - value = self.Value(self) - value.type = self.lookupType('void *') - value.ldata = val.to_bytes(8, sys.byteorder) - return value + return self.fromNativeValue(cdbext.parseAndEvaluate(exp)) def isWindowsTarget(self): return True @@ -316,12 +310,12 @@ class Dumper(DumperBase): if namespaceIndex > 0: namespace = name[:namespaceIndex + 2] self.qtNamespace = lambda: namespace - self.qtCustomEventFunc = cdbext.parseAndEvaluate('%s!%sQObject::customEvent' - % (self.qtCoreModuleName(), namespace)) + self.qtCustomEventFunc = self.parseAndEvaluate('%s!%sQObject::customEvent' + % (self.qtCoreModuleName(), namespace)).address() return namespace def qtVersion(self): - qtVersion = self.findValueByExpression('((void**)&%s)[2]' % self.qtHookDataSymbolName()) + qtVersion = self.parseAndEvaluate('((void**)&%s)[2]' % self.qtHookDataSymbolName()).integer() if qtVersion is None and self.qtCoreModuleName() is not None: try: versionValue = cdbext.call(self.qtCoreModuleName() + '!qVersion()') diff --git a/src/libs/qtcreatorcdbext/pycdbextmodule.cpp b/src/libs/qtcreatorcdbext/pycdbextmodule.cpp index 2b807d18ace..ef47f383687 100644 --- a/src/libs/qtcreatorcdbext/pycdbextmodule.cpp +++ b/src/libs/qtcreatorcdbext/pycdbextmodule.cpp @@ -106,12 +106,13 @@ static PyObject *cdbext_parseAndEvaluate(PyObject *, PyObject *args) // -> Value ULONG oldExpressionSyntax; control->GetExpressionSyntax(&oldExpressionSyntax); control->SetExpressionSyntax(DEBUG_EXPR_CPLUSPLUS); - DEBUG_VALUE value; - HRESULT hr = control->Evaluate(expr, DEBUG_VALUE_INT64, &value, NULL); + IDebugSymbolGroup2 *symbolGroup = CurrentSymbolGroup::get(); + ULONG index = DEBUG_ANY_ID; + HRESULT hr = symbolGroup->AddSymbol(expr, &index); control->SetExpressionSyntax(oldExpressionSyntax); if (FAILED(hr)) Py_RETURN_NONE; - return Py_BuildValue("K", value.I64); + return createPythonObject(PyValue(index, symbolGroup)); } static PyObject *cdbext_resolveSymbol(PyObject *, PyObject *args) // -> Value From 265d093c3606839ef90b010774b687ddad4637a1 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 19 Dec 2017 14:52:30 +0100 Subject: [PATCH 19/20] QbsProjectManager: Fix compiler name setup for GCC-like toolchains The mapping was not quite right. In particular, cpp.cCompilerName needs to be set if the compiler name is not the default. Task-number: QTCREATORBUG-19467 Change-Id: I6c190fdda98ff15dce6066bfb082d24853538a78 Reviewed-by: Jake Petroules --- src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp | 4 +++- src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 66201cb98bc..837ee2d4e7a 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -296,8 +296,10 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor if (toolchain.contains(QLatin1String("msvc"))) { data.insert(QLatin1String(CPP_COMPILERNAME), mainCompilerName); } else { + if (!mainCompilerName.isEmpty()) + data.insert(QLatin1String(CPP_COMPILERNAME), mainCompilerName); if (!cCompilerName.isEmpty()) - data.insert(QLatin1String(CPP_COMPILERNAME), cCompilerName); + data.insert(QLatin1String(CPP_CCOMPILERNAME), cCompilerName); if (!cxxCompilerName.isEmpty()) data.insert(QLatin1String(CPP_CXXCOMPILERNAME), cxxCompilerName); } diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h b/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h index 8bc262710c0..bb4d6d38115 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerconstants.h @@ -83,6 +83,7 @@ const char QBS_TOOLCHAIN[] = "qbs.toolchain"; const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath"; const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix"; const char CPP_COMPILERNAME[] = "cpp.compilerName"; +const char CPP_CCOMPILERNAME[] = "cpp.cCompilerName"; const char CPP_CXXCOMPILERNAME[] = "cpp.cxxCompilerName"; const char CPP_PLATFORMCOMMONCOMPILERFLAGS[] = "cpp.platformCommonCompilerFlags"; const char CPP_PLATFORMLINKERFLAGS[] = "cpp.platformLinkerFlags"; From c14684ffc997809c63310699e1c9edd53a8e7448 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 20 Dec 2017 15:14:56 +0200 Subject: [PATCH 20/20] QmakePM: Fix "Run in terminal" on clone Task-number: QTCREATORBUG-19476 Change-Id: I62c8d38238f4e6f77ad6226dd70f7a719ed2d878 Reviewed-by: hjk Reviewed-by: Eike Ziller --- .../qmakeprojectmanager/desktopqmakerunconfiguration.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp index 32922cb9f7d..fcd8aa9dfea 100644 --- a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp @@ -265,7 +265,9 @@ bool DesktopQmakeRunConfiguration::fromMap(const QVariantMap &map) m_isUsingDyldImageSuffix = map.value(QLatin1String(USE_DYLD_IMAGE_SUFFIX_KEY), false).toBool(); m_isUsingLibrarySearchPath = map.value(QLatin1String(USE_LIBRARY_SEARCH_PATH), true).toBool(); - return RunConfiguration::fromMap(map); + const bool res = RunConfiguration::fromMap(map); + updateTargetInformation(); + return res; } QString DesktopQmakeRunConfiguration::executable() const