From dd9993a05dbd3af4bb55e7375647d95ae913eb64 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 20 Nov 2018 15:57:32 +0100 Subject: [PATCH 01/19] Add more changes for 4.8 Up to ab4f6ad9ce9f7f83857d8b09326ea57d1b521703 Change-Id: I29916628792469746f5cc84f92a3b51df776e627 Reviewed-by: Leena Miettinen --- dist/changes-4.8.0.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/dist/changes-4.8.0.md b/dist/changes-4.8.0.md index a3602db43fb..a895b109785 100644 --- a/dist/changes-4.8.0.md +++ b/dist/changes-4.8.0.md @@ -15,6 +15,9 @@ General exist * Fixed menu items shown in menu locator filter (QTCREATORBUG-20071, QTCREATORBUG-20626) +* Fixed crash at shutdown when multiple windows are open (QTCREATORBUG-21221) +* Fixed that items could appear empty in `Issues` pane (QTCREATORBUG-20542) +* Fixed Qt Quick wizards when building Qt Creator with Qt 5.12 Editing @@ -23,6 +26,7 @@ Editing (QTCREATORBUG-20284) * Added support for the pastecode.xyz code pasting service * Made it possible to change default editors in MIME type settings +* Fixed issue with input methods (QTCREATORBUG-21483) All Projects @@ -42,6 +46,9 @@ All Projects QMake Projects +* Made it possible to add libraries for other target platforms in + `Add Library` wizard (QTCREATORBUG-17995) +* Fixed crash while parsing (QTCREATORBUG-21416) * Fixed that `make qmake_all` was run in top-level project directory even when building sub-project (QTCREATORBUG-20823) @@ -60,25 +67,39 @@ C++ Support * Added experimental plugin `Cppcheck` for integration of [cppcheck](http://cppcheck.sourceforge.net) diagnostics * Added highlighting style for punctuation tokens (QTCREATORBUG-20666) +* Fixed issues with detecting language version (QTCREATORBUG-20884) +* Fixed crash when code model prints message about too large files + (QTCREATORBUG-21481) +* Fixed function extraction from nested classes (QTCREATORBUG-7271) +* Fixed handling of `-B` option (QTCREATORBUG-21424) * Clang Code Model + * Switched to Clang 7.0 * Added `Follow Symbol` for `auto` keyword (QTCREATORBUG-17191) * Added function overloads to tooltip in completion popup * Added `Build` > `Generate Compilation Database` * Fixed that braced initialization did not provide constructor completion (QTCREATORBUG-20957) * Fixed local references for operator arguments (QTCREATORBUG-20966) + * Fixed support for generated UI headers (QTCREATORBUG-15187, + QTCREATORBUG-17002) + * Fixed crash when removing diagnostics configuration (QTCREATORBUG-21273) QML Support * Fixed indentation in object literals with ternary operator (QTCREATORBUG-7103) * Fixed that symbols from closed projects were still shown in Locator (QTCREATORBUG-13459) +* Fixed crash when building Qt Creator with Qt 5.12 (QTCREATORBUG-21510) +* Fixed that `.mjs` files were not opened in JavaScript editor + (QTCREATORBUG-21517) Debugging * Added support for multiple simultaneous debugger runs +* Added pretty printing of `QEvent` and `QKeyEvent` * Fixed automatic detection of debugging information for Qt from binary installer (QTCREATORBUG-20693) +* Fixed display of short unsigned integers (QTCREATORBUG-21038) * GDB * Fixed startup issue with localized debugger output (QTCREATORBUG-20765) * Fixed disassembler view for newer GCC @@ -86,16 +107,21 @@ Debugging * Added option to suppress task entries for exceptions (QTCREATORBUG-20915) * LLDB * Fixed instruction-wise stepping + * Fixed startup with complex command line arguments (QTCREATORBUG-21433) + * Fixed pretty printing of bitfields Qt Quick Designer +* Added support for enums in `.metainfo` files * Fixed wrong property propagation from parent to child +* Fixed invalid access to network paths (QTCREATORBUG-21372) Version Control Systems * Git * Added navigation pane that shows branches * Added option for copy/move detection to `git blame` (QTCREATORBUG-20462) + * Added support for GitHub and GitLab remotes * Improved behavior if no merge tool is configured * Fixed that `git pull` blocked Qt Creator (QTCREATORBUG-13279) * Fixed handling of `file://` remotes (QTCREATORBUG-20618) @@ -127,16 +153,28 @@ Android * Added support for command line arguments * Added support for environment variables +* Added support for API level 28 +* Added auto-detection of Clang toolchains (QTCREATORBUG-11846) +* Removed auto-detection of GCC toolchains * Fixed connecting to debugger for API level 24 and later +Remote Linux + +* Updated to Botan 2.8 +* Fixed SSH connections in AES-CBC mode (QTCREATORBUG-21387) + Credits for these changes go to: Alessandro Portale Alexandru Croitor Alexis Jeandet +Allan Sandfeld Jensen Andre Hartmann André Pönitz +Benjamin Balga +BogDan Vatra Christian Kandeler Christian Stenger +Daniel Levin Daniel Trevitz David Schulz Eike Ziller @@ -146,6 +184,8 @@ Ivan Donchevskii Jaroslaw Kobus Jochen Becher Jörg Bornemann +Knud Dollereder +Laurent Montel Leena Miettinen Marco Benelli Marco Bubke @@ -157,7 +197,10 @@ Oliver Wolff Orgad Shaneh Razi Alavizadeh Robert Löhning +Sergey Belyashov Sergey Morozov +Tasuku Suzuki +Thiago Macieira Thomas Hartmann Tim Jenssen Tobias Hunger From 9fe8c46d15c9685a744df0f32feb3459a37ee623 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 27 Nov 2018 13:28:49 +0100 Subject: [PATCH 02/19] C++: Use file size limit also for included files We can't stop the clangbackend from processing huge files, but at least our built-in parser. Fixes: QTCREATORBUG-21590 Change-Id: I506024495ba0632692f2845c6c204360f4c61b33 Reviewed-by: Marco Bubke --- src/plugins/cpptools/builtineditordocumentparser.cpp | 5 ++++- src/plugins/cpptools/builtineditordocumentparser.h | 4 +++- src/plugins/cpptools/builtineditordocumentprocessor.cpp | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/cpptools/builtineditordocumentparser.cpp b/src/plugins/cpptools/builtineditordocumentparser.cpp index 55c9c6d9ed5..d802e672505 100644 --- a/src/plugins/cpptools/builtineditordocumentparser.cpp +++ b/src/plugins/cpptools/builtineditordocumentparser.cpp @@ -50,8 +50,10 @@ static QByteArray overwrittenToolchainDefines(const ProjectPart &projectPart) return defines; } -BuiltinEditorDocumentParser::BuiltinEditorDocumentParser(const QString &filePath) +BuiltinEditorDocumentParser::BuiltinEditorDocumentParser(const QString &filePath, + int fileSizeLimitInMb) : BaseEditorDocumentParser(filePath) + , m_fileSizeLimitInMb(fileSizeLimitInMb) { qRegisterMetaType("CPlusPlus::Snapshot"); } @@ -191,6 +193,7 @@ void BuiltinEditorDocumentParser::updateImpl(const QFutureInterface &futur if (releaseSourceAndAST_) doc->releaseSourceAndAST(); }); + sourceProcessor.setFileSizeLimitInMb(m_fileSizeLimitInMb); sourceProcessor.setCancelChecker([future]() { return future.isCanceled(); }); diff --git a/src/plugins/cpptools/builtineditordocumentparser.h b/src/plugins/cpptools/builtineditordocumentparser.h index 7793ebfbe41..3f53ae765ed 100644 --- a/src/plugins/cpptools/builtineditordocumentparser.h +++ b/src/plugins/cpptools/builtineditordocumentparser.h @@ -39,7 +39,7 @@ class CPPTOOLS_EXPORT BuiltinEditorDocumentParser : public BaseEditorDocumentPar Q_OBJECT public: - BuiltinEditorDocumentParser(const QString &filePath); + BuiltinEditorDocumentParser(const QString &filePath, int fileSizeLimitInMb = -1); bool releaseSourceAndAST() const; void setReleaseSourceAndAST(bool release); @@ -79,6 +79,8 @@ private: bool m_releaseSourceAndAST = true; ExtraState m_extraState; + + const int m_fileSizeLimitInMb = -1; }; } // namespace CppTools diff --git a/src/plugins/cpptools/builtineditordocumentprocessor.cpp b/src/plugins/cpptools/builtineditordocumentprocessor.cpp index daf7ebf762f..42daa679638 100644 --- a/src/plugins/cpptools/builtineditordocumentprocessor.cpp +++ b/src/plugins/cpptools/builtineditordocumentprocessor.cpp @@ -163,7 +163,8 @@ BuiltinEditorDocumentProcessor::BuiltinEditorDocumentProcessor( TextEditor::TextDocument *document, bool enableSemanticHighlighter) : BaseEditorDocumentProcessor(document->document(), document->filePath().toString()) - , m_parser(new BuiltinEditorDocumentParser(document->filePath().toString())) + , m_parser(new BuiltinEditorDocumentParser(document->filePath().toString(), + indexerFileSizeLimitInMb())) , m_codeWarningsUpdated(false) , m_semanticHighlighter(enableSemanticHighlighter ? new CppTools::SemanticHighlighter(document) From 51bc18e6d5f44268c86d3b18559cebedae67722b Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 28 Nov 2018 14:48:06 +0100 Subject: [PATCH 03/19] Fix lvalue references and rvalue reference incorrectly matching Adds the comparison of isRvalueReference to make sure they get difference entries. Change-Id: I294205786f3d1322e542d3b308d61ab44647ecc9 Fixes: QTCREATORBUG-13839 Reviewed-by: Nikolai Kosjar --- src/libs/3rdparty/cplusplus/Control.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/3rdparty/cplusplus/Control.cpp b/src/libs/3rdparty/cplusplus/Control.cpp index afdd6790560..a5601bf6205 100644 --- a/src/libs/3rdparty/cplusplus/Control.cpp +++ b/src/libs/3rdparty/cplusplus/Control.cpp @@ -74,7 +74,11 @@ template <> struct Compare { bool operator()(const ReferenceType &ty, const ReferenceType &otherTy) const { - return ty.elementType() < otherTy.elementType(); + if (ty.elementType() < otherTy.elementType()) + return true; + if (ty.elementType() == otherTy.elementType()) + return (int)ty.isRvalueReference() < (int)otherTy.isRvalueReference(); + return false; } }; From 7bdc858d7750c7f8a734460c1a6a70217e8cde81 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 29 Nov 2018 10:14:07 +0100 Subject: [PATCH 04/19] QmlDesigner: Improve resize handle size The visual representation of the resize handlers was 1 pixel too small compared to the bounding rects. They were also not centered on the 2px thick line. And they simply looked too tiny compared to resize handlers in other applications. Change-Id: Idc48d66178cd5f0158efe2f66d685afc4549022e Reviewed-by: Thomas Hartmann --- .../qmldesigner/components/formeditor/resizehandleitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/formeditor/resizehandleitem.cpp b/src/plugins/qmldesigner/components/formeditor/resizehandleitem.cpp index a44bbadcdaf..50ad27afe8e 100644 --- a/src/plugins/qmldesigner/components/formeditor/resizehandleitem.cpp +++ b/src/plugins/qmldesigner/components/formeditor/resizehandleitem.cpp @@ -60,7 +60,7 @@ void ResizeHandleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem * painter->setPen(pen); painter->setRenderHint(QPainter::Antialiasing, false); painter->setBrush(QColor(255, 255, 255)); - painter->drawRect(QRectF(-2., -2., 4., 4.)); + painter->drawRect(QRectF(-3., -3., 5., 5.)); painter->restore(); } From 12dce3ef7ddf5a53d90a794a4645dea13a67f2bb Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 29 Nov 2018 09:30:27 +0100 Subject: [PATCH 05/19] Clang: Work around eating memory with gcc/clang/-fno-rtti/boost Boost recognizes a misconfigured compiler in rtti emulation mode (-fno-rtti) as our libclang command line is special. Even worse, it does not seem to stop instantiating templates and allocating memory afterwards. For the former to fix, we need to rework our command line (in master). The latter can be work arounded by defining BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING with a value for gcc/clang. See also https://www.boost.org/doc/libs/1_64_0/doc/html/BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING.html Task-number: QTCREATORBUG-19543 Change-Id: Iddb5be2d1f1966018e5ab535a8f7475fe7911284 Reviewed-by: Ivan Donchevskii --- src/plugins/cpptools/compileroptionsbuilder.cpp | 9 +++++++++ src/plugins/cpptools/compileroptionsbuilder.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index 1529cb445fa..085e6fe132c 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -84,6 +84,7 @@ QStringList CompilerOptionsBuilder::build(CppTools::ProjectFile::Kind fileKind, undefineClangVersionMacrosForMsvc(); undefineCppLanguageFeatureMacrosForMsvc2015(); addDefineFunctionMacrosMsvc(); + addBoostWorkaroundMacros(); addToolchainFlags(); addPrecompiledHeaderOptions(pchUsage); @@ -560,6 +561,14 @@ void CompilerOptionsBuilder::addDefineFunctionMacrosMsvc() addMacros({{"__FUNCSIG__", "\"\""}, {"__FUNCTION__", "\"\""}, {"__FUNCDNAME__", "\"\""}}); } +void CompilerOptionsBuilder::addBoostWorkaroundMacros() +{ + if (m_projectPart.toolchainType != ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID + && m_projectPart.toolchainType != ProjectExplorer::Constants::CLANG_CL_TOOLCHAIN_TYPEID) { + addMacros({{"BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING", "(39, 1, true, \"T = \")"}}); + } +} + QString CompilerOptionsBuilder::includeDirOptionForPath(const QString &path) const { if (m_useSystemHeader == UseSystemHeader::No diff --git a/src/plugins/cpptools/compileroptionsbuilder.h b/src/plugins/cpptools/compileroptionsbuilder.h index 67a7345a306..66202e72d69 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.h +++ b/src/plugins/cpptools/compileroptionsbuilder.h @@ -87,6 +87,7 @@ public: void addMsvcCompatibilityVersion(); void undefineCppLanguageFeatureMacrosForMsvc2015(); void addDefineFunctionMacrosMsvc(); + void addBoostWorkaroundMacros(); void addProjectConfigFileInclude(); void undefineClangVersionMacrosForMsvc(); From 8d19b306ed2b2fd4a90ecc2b49baca31acd52077 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 28 Nov 2018 14:30:42 +0100 Subject: [PATCH 06/19] Android: Detect clang and gdb from older NDK Get some minimal compatibility with the older NDK that is used for Qt < 5.12 back. This detects clang-3.6 and gdb from NDK 10e. For building, the android-g++ mkspec continues to be used for Qt < 5.12 (it uses Qt's default mkspec, regardless of toolchain in the kit, because the toolchain reports to support both). Task-number: QTCREATORBUG-21595 Change-Id: I3487c38093f43ccae2418fb28807a50fbda101a8 Reviewed-by: Andy Shaw Reviewed-by: BogDan Vatra Reviewed-by: Christian Stenger --- src/plugins/android/androidconfigurations.cpp | 57 +++++++++++++------ src/plugins/android/androidconfigurations.h | 2 +- src/plugins/android/androidtoolchain.cpp | 2 +- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index a52c63d3702..47c8fe1f0bf 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -405,6 +405,9 @@ FileName AndroidConfig::clangPath() const { FileName clangPath = m_ndkLocation; clangPath.appendPath("toolchains/llvm/prebuilt/"); + FileName oldNdkClangPath = m_ndkLocation; + oldNdkClangPath.appendPath("toolchains/llvm-3.6/prebuilt/"); + const QVector clangSearchPaths{clangPath, oldNdkClangPath}; // detect toolchain host QStringList hostPatterns; @@ -421,20 +424,30 @@ FileName AndroidConfig::clangPath() const default: /* unknown host */ return FileName(); } - QDirIterator iter(clangPath.toString(), hostPatterns, QDir::Dirs); - if (iter.hasNext()) { - iter.next(); - return clangPath.appendPath(iter.fileName()) - .appendPath(HostOsInfo::withExecutableSuffix("bin/clang")); + for (const FileName &path : clangSearchPaths) { + QDirIterator iter(path.toString(), hostPatterns, QDir::Dirs); + if (iter.hasNext()) { + iter.next(); + FileName found = path; + return found.appendPath(iter.fileName()) + .appendPath(HostOsInfo::withExecutableSuffix("bin/clang")); + } } - return clangPath; + return {}; } -FileName AndroidConfig::gdbPath() const +FileName AndroidConfig::gdbPath(const ProjectExplorer::Abi &abi) const { FileName path = m_ndkLocation; path.appendPath(QString("prebuilt/%1/bin/gdb%2").arg(toolchainHost(), QTC_HOST_EXE_SUFFIX)); + if (path.exists()) + return path; + // fallback for old NDKs (e.g. 10e) + path = m_ndkLocation; + path.appendPath( + QString("toolchains/%1-4.9/prebuilt/%2/bin/%3-gdb%4") + .arg(toolchainPrefix(abi), toolchainHost(), toolsPrefix(abi), QTC_HOST_EXE_SUFFIX)); return path; } @@ -991,6 +1004,26 @@ void AndroidConfigurations::removeOldToolChains() } } +static QVariant findOrRegisterDebugger(ToolChain *tc) +{ + const FileName command = tc->suggestedDebugger(); + // check if the debugger is already registered, but ignoring the display name + const Debugger::DebuggerItem *existing = Debugger::DebuggerItemManager::findByCommand(command); + if (existing && existing->engineType() == Debugger::GdbEngineType && existing->isAutoDetected() + && existing->abis() == QList{tc->targetAbi()}) + return existing->id(); + // debugger not found, register a new one + Debugger::DebuggerItem debugger; + debugger.setCommand(tc->suggestedDebugger()); + debugger.setEngineType(Debugger::GdbEngineType); + debugger.setUnexpandedDisplayName( + AndroidConfigurations::tr("Android Debugger for %1").arg(tc->displayName())); + debugger.setAutoDetected(true); + debugger.setAbi(tc->targetAbi()); + debugger.reinitializeFromFile(); + return Debugger::DebuggerItemManager::registerDebugger(debugger); +} + void AndroidConfigurations::updateAutomaticKitList() { const QList existingKits = Utils::filtered(KitManager::kits(), [](Kit *k) { @@ -1065,15 +1098,7 @@ void AndroidConfigurations::updateAutomaticKitList() toSetup = existingKit; } - Debugger::DebuggerItem debugger; - debugger.setCommand(tc->suggestedDebugger()); - debugger.setEngineType(Debugger::GdbEngineType); - debugger.setUnexpandedDisplayName(tr("Android Debugger for %1").arg(tc->displayName())); - debugger.setAutoDetected(true); - debugger.setAbi(tc->targetAbi()); - debugger.reinitializeFromFile(); - QVariant id = Debugger::DebuggerItemManager::registerDebugger(debugger); - Debugger::DebuggerKitInformation::setDebugger(toSetup, id); + Debugger::DebuggerKitInformation::setDebugger(toSetup, findOrRegisterDebugger(tc)); AndroidGdbServerKitInformation::setGdbSever(toSetup, currentConfig().gdbServer(tc->targetAbi())); toSetup->makeSticky(); diff --git a/src/plugins/android/androidconfigurations.h b/src/plugins/android/androidconfigurations.h index dff705bb1cd..70d97c129c5 100644 --- a/src/plugins/android/androidconfigurations.h +++ b/src/plugins/android/androidconfigurations.h @@ -134,7 +134,7 @@ public: Utils::FileName aaptToolPath() const; Utils::FileName clangPath() const; - Utils::FileName gdbPath() const; + Utils::FileName gdbPath(const ProjectExplorer::Abi &abi) const; Utils::FileName makePath() const; Utils::FileName keytoolPath() const; diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 280e1d69849..dd8d4ccfb29 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -109,7 +109,7 @@ void AndroidToolChain::addToEnvironment(Environment &env) const FileName AndroidToolChain::suggestedDebugger() const { // TODO: Make use of LLDB if available. - return AndroidConfigurations::currentConfig().gdbPath(); + return AndroidConfigurations::currentConfig().gdbPath(targetAbi()); } FileName AndroidToolChain::suggestedGdbServer() const From c5d1ec5144d54b39f3316ac0d618d37208360f39 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 28 Nov 2018 09:59:19 +0100 Subject: [PATCH 07/19] Android: Fix debugging using old devices Uploading a binary file had been remade using base64 encoding, but base64 tool is not available on older devices. Fallback to the old approach of relying on the symlinked lib folder that contains a gdbserver if the upload failed. Task-number: QTCREATORBUG-21317 Task-number: QTCREATORBUG-21547 Change-Id: I54539d8912b1722bb799068c33e7a9175699ff70 Reviewed-by: Christian Stenger Reviewed-by: Eike Ziller --- src/plugins/android/androidrunnerworker.cpp | 27 +++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index f76f202bba2..8da140ab625 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -280,7 +280,7 @@ bool AndroidRunnerWorker::uploadFile(const QString &from, const QString &to, con runAdb({"shell", "run-as", m_packageName, "rm", to}); const QByteArray data = f.readAll(); const bool res = runAdb({"shell", "run-as", m_packageName, QString("sh -c 'base64 -d > %1'").arg(to)}, 60, data.toBase64()); - if (!res) + if (!res || m_lastRunAdbRawOutput.contains("base64: not found")) return false; return runAdb({"shell", "run-as", m_packageName, "chmod", flags, to}); } @@ -426,17 +426,34 @@ void AndroidRunnerWorker::asyncStartHelper() // e.g. on Android 8 with NDK 10e runAdb({"shell", "run-as", m_packageName, "chmod", "a+x", packageDir}); + QString gdbServerExecutable; + QString gdbServerPrefix = "./lib/"; if (m_gdbserverPath.isEmpty() || !uploadFile(m_gdbserverPath, "gdbserver")) { - emit remoteProcessFinished(tr("Cannot find/copy C++ debug server.")); - return; + // upload failed - check for old devices + if (runAdb({"shell", "run-as", m_packageName, "ls", "lib/"})) { + for (const auto &line: m_lastRunAdbRawOutput.split('\n')) { + if (line.indexOf("gdbserver") != -1/* || line.indexOf("lldb-server") != -1*/) { + gdbServerExecutable = QString::fromUtf8(line.trimmed()); + break; + } + } + } + if (gdbServerExecutable.isEmpty()) { + emit remoteProcessFinished(tr("Cannot find/copy C++ debug server.")); + return; + } + } else { + gdbServerPrefix = "./"; + gdbServerExecutable = "gdbserver"; } QString gdbServerSocket = packageDir + "/debug-socket"; - runAdb({"shell", "run-as", m_packageName, "killall", "gdbserver"}); + runAdb({"shell", "run-as", m_packageName, "killall", gdbServerExecutable}); runAdb({"shell", "run-as", m_packageName, "rm", gdbServerSocket}); + std::unique_ptr gdbServerProcess(new QProcess, deleter); gdbServerProcess->start(m_adb, selector() << "shell" << "run-as" - << m_packageName << "./gdbserver" + << m_packageName << gdbServerPrefix + gdbServerExecutable << "--multi" << "+" + gdbServerSocket); if (!gdbServerProcess->waitForStarted()) { emit remoteProcessFinished(tr("Failed to start C++ debugger.")); From d3c10869103a2fcda06cdf458040ff4490702485 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 27 Nov 2018 10:50:46 +0100 Subject: [PATCH 08/19] Squish: Fix WELP tests Adapt to new titles of some tutorials. Change-Id: I18d62d88877b59a51ebfdb19f5fe16ac8d828800 Reviewed-by: Robert Loehning Reviewed-by: Christian Stenger --- tests/system/suite_WELP/tst_WELP01/test.py | 2 +- tests/system/suite_WELP/tst_WELP04/test.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/system/suite_WELP/tst_WELP01/test.py b/tests/system/suite_WELP/tst_WELP01/test.py index 49c5876d940..ce07f4fdaf3 100755 --- a/tests/system/suite_WELP/tst_WELP01/test.py +++ b/tests/system/suite_WELP/tst_WELP01/test.py @@ -156,7 +156,7 @@ def main(): for (qType, prop, info) in expect: test.verify(checkIfObjectExists(search % (qType, prop)), "Verifying whether %s is shown" % info) - checkTableViewForContent(search % (expect[0][0], expect[0][1]), "Help: Create .*", "Tutorials", + checkTableViewForContent(search % (expect[0][0], expect[0][1]), "Help: Creating .*", "Tutorials", "Verifying that at least one tutorial is displayed.") # exit Qt Creator invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_WELP/tst_WELP04/test.py b/tests/system/suite_WELP/tst_WELP04/test.py index 27e3f5d007d..f66efba6c57 100644 --- a/tests/system/suite_WELP/tst_WELP04/test.py +++ b/tests/system/suite_WELP/tst_WELP04/test.py @@ -50,11 +50,13 @@ def main(): tutorial = findExampleOrTutorial(tableView, ".*", True) test.verify(tutorial is None, "Verifying: 'Tutorials' topic is opened and nothing is shown.") - bnr = "Help: Build and Run Examples" + bnr = "Help: Building and Running an Example" replaceEditorContent(searchTutorials, bnr.lower()) waitFor('findExampleOrTutorial(tableView, "%s.*") is not None' % bnr, 3000) tutorial = findExampleOrTutorial(tableView, "%s.*" % bnr, True) test.verify(tutorial is not None, "Verifying: Expected Text tutorial is shown.") + # clicking before documentation was updated will open the tutorial in browser + progressBarWait(warn=False) # select a text tutorial mouseClick(tutorial) test.verify("Building and Running an Example" in From f5203796e42d25bca7569df1cc746bbe995ee548 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 29 Nov 2018 16:19:57 +0200 Subject: [PATCH 09/19] Git: Use ICore::dialogParent as dialog parent Change-Id: Idc3f2f4d27d3279f76b688fac635e8d38b2705f5 Reviewed-by: Eike Ziller --- src/plugins/git/gerrit/gerritplugin.cpp | 8 ++++---- src/plugins/git/gerrit/gerritserver.cpp | 2 +- src/plugins/git/gitclient.cpp | 18 +++++++++--------- src/plugins/git/gitplugin.cpp | 10 +++++----- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index 13a49c4903a..9098d3a3302 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -319,11 +319,11 @@ void GerritPlugin::addToLocator(CommandLocator *locator) void GerritPlugin::push(const QString &topLevel) { // QScopedPointer is required to delete the dialog when leaving the function - GerritPushDialog dialog(topLevel, m_reviewers, m_parameters, ICore::mainWindow()); + GerritPushDialog dialog(topLevel, m_reviewers, m_parameters, ICore::dialogParent()); const QString initErrorMessage = dialog.initErrorMessage(); if (!initErrorMessage.isEmpty()) { - QMessageBox::warning(ICore::mainWindow(), tr("Initialization Failed"), initErrorMessage); + QMessageBox::warning(ICore::dialogParent(), tr("Initialization Failed"), initErrorMessage); return; } @@ -350,7 +350,7 @@ void GerritPlugin::openView() if (!ICore::showOptionsDialog("Gerrit")) return; } - GerritDialog *gd = new GerritDialog(m_parameters, m_server, currentRepository(), ICore::mainWindow()); + GerritDialog *gd = new GerritDialog(m_parameters, m_server, currentRepository(), ICore::dialogParent()); gd->setModal(false); connect(gd, &GerritDialog::fetchDisplay, this, [this](const QSharedPointer &change) { fetch(change, FetchDisplay); }); @@ -433,7 +433,7 @@ void GerritPlugin::fetch(const QSharedPointer &change, int mode) if (!verifiedRepository) { QMessageBox::StandardButton answer = QMessageBox::question( - ICore::mainWindow(), tr("Remote Not Verified"), + ICore::dialogParent(), tr("Remote Not Verified"), tr("Change host %1\nand project %2\n\nwere not verified among remotes" " in %3. Select different folder?") .arg(m_server->host, diff --git a/src/plugins/git/gerrit/gerritserver.cpp b/src/plugins/git/gerrit/gerritserver.cpp index e9dee455658..9e85606c76f 100644 --- a/src/plugins/git/gerrit/gerritserver.cpp +++ b/src/plugins/git/gerrit/gerritserver.cpp @@ -301,7 +301,7 @@ bool GerritServer::resolveRoot() return setupAuthentication(); case CertificateError: if (QMessageBox::question( - Core::ICore::mainWindow(), + Core::ICore::dialogParent(), QCoreApplication::translate( "Gerrit::Internal::GerritDialog", "Certificate Error"), QCoreApplication::translate( diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 56577ffd8d2..86ffe60995c 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1144,7 +1144,7 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory, return arguments; if (Utils::CheckableMessageBox::doNotAskAgainQuestion( - ICore::mainWindow() /*parent*/, + ICore::dialogParent() /*parent*/, tr("Create Local Branch") /*title*/, tr("Would you like to create a local branch?") /*message*/, ICore::settings(), "Git.CreateLocalBranchOnCheckout" /*setting*/, @@ -1181,7 +1181,7 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory, } } - BranchAddDialog branchAddDialog(localBranches, true, ICore::mainWindow()); + BranchAddDialog branchAddDialog(localBranches, true, ICore::dialogParent()); branchAddDialog.setTrackedBranchName(remoteBranch, true); if (branchAddDialog.exec() != QDialog::Accepted) @@ -1207,7 +1207,7 @@ void GitClient::reset(const QString &workingDirectory, const QString &argument, if (argument == "--hard") { if (gitStatus(workingDirectory, StatusMode(NoUntracked | NoSubmodules)) != StatusUnchanged) { if (QMessageBox::question( - Core::ICore::mainWindow(), tr("Reset"), + Core::ICore::dialogParent(), tr("Reset"), tr("All changes in working directory will be discarded. Are you sure?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) { @@ -1654,7 +1654,7 @@ QString GitClient::synchronousStash(const QString &workingDirectory, const QStri message = creatorStashMessage(messageKeyword); do { if ((flags & StashPromptDescription)) { - if (!inputText(ICore::mainWindow(), + if (!inputText(ICore::dialogParent(), tr("Stash Description"), tr("Description:"), &message)) break; } @@ -2052,7 +2052,7 @@ void GitClient::updateSubmodulesIfNeeded(const QString &workingDirectory, bool p if (!updateNeeded) return; - if (prompt && QMessageBox::question(ICore::mainWindow(), tr("Submodules Found"), + if (prompt && QMessageBox::question(ICore::dialogParent(), tr("Submodules Found"), tr("Would you like to update submodules?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) { return; @@ -2220,7 +2220,7 @@ void GitClient::continuePreviousGitCommand(const QString &workingDirectory, } QMessageBox msgBox(QMessageBox::Question, msgBoxTitle, msgBoxText, - QMessageBox::NoButton, ICore::mainWindow()); + QMessageBox::NoButton, ICore::dialogParent()); if (hasChanges || isRebase) msgBox.addButton(hasChanges ? buttonName : tr("Skip"), QMessageBox::AcceptRole); msgBox.addButton(QMessageBox::Abort); @@ -2802,7 +2802,7 @@ GitClient::RevertResult GitClient::revertI(QStringList files, // Ask to revert (to do: Handle lists with a selection dialog) const QMessageBox::StandardButton answer - = QMessageBox::question(ICore::mainWindow(), + = QMessageBox::question(ICore::dialogParent(), tr("Revert"), tr("The file has been changed. Do you want to revert it?"), QMessageBox::Yes | QMessageBox::No, @@ -2944,7 +2944,7 @@ void GitClient::handleMergeConflicts(const QString &workingDir, const QString &c message = tr("Conflicts detected."); } QMessageBox mergeOrAbort(QMessageBox::Question, tr("Conflicts Detected"), message, - QMessageBox::NoButton, ICore::mainWindow()); + QMessageBox::NoButton, ICore::dialogParent()); QPushButton *mergeToolButton = mergeOrAbort.addButton(tr("Run &Merge Tool"), QMessageBox::AcceptRole); const QString mergeTool = readConfigValue(workingDir, "merge.tool"); @@ -3292,7 +3292,7 @@ void GitClient::StashInfo::stashPrompt(const QString &command, const QString &st QMessageBox msgBox(QMessageBox::Question, tr("Uncommitted Changes Found"), tr("What would you like to do with local changes in:") + "\n\n" + QDir::toNativeSeparators(m_workingDir) + '\"', - QMessageBox::NoButton, ICore::mainWindow()); + QMessageBox::NoButton, ICore::dialogParent()); msgBox.setDetailedText(statusOutput); diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 35ef47a978c..d74c17aa388 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -793,7 +793,7 @@ void GitPlugin::resetRepository() QTC_ASSERT(state.hasTopLevel(), return); QString topLevel = state.topLevel(); - LogChangeDialog dialog(true, ICore::mainWindow()); + LogChangeDialog dialog(true, ICore::dialogParent()); ResetItemDelegate delegate(dialog.widget()); dialog.setWindowTitle(tr("Undo Changes to %1").arg(QDir::toNativeSeparators(topLevel))); if (dialog.runDialog(topLevel, QString(), LogChangeWidget::IncludeRemotes)) @@ -818,7 +818,7 @@ void GitPlugin::startRebase() const QString topLevel = state.topLevel(); if (topLevel.isEmpty() || !m_gitClient->canRebase(topLevel)) return; - LogChangeDialog dialog(false, ICore::mainWindow()); + LogChangeDialog dialog(false, ICore::dialogParent()); RebaseItemDelegate delegate(dialog.widget()); dialog.setWindowTitle(tr("Interactive Rebase")); if (!dialog.runDialog(topLevel)) @@ -832,7 +832,7 @@ void GitPlugin::startChangeRelatedAction(const Id &id) const VcsBasePluginState state = currentState(); ChangeSelectionDialog dialog(state.hasTopLevel() ? state.topLevel() : PathChooser::homePath(), - id, ICore::mainWindow()); + id, ICore::dialogParent()); int result = dialog.exec(); @@ -1234,7 +1234,7 @@ void GitPlugin::applyPatch(const QString &workingDirectory, QString file) // Prompt for file if (file.isEmpty()) { const QString filter = tr("Patches (*.patch *.diff)"); - file = QFileDialog::getOpenFileName(ICore::mainWindow(), tr("Choose Patch"), QString(), filter); + file = QFileDialog::getOpenFileName(ICore::dialogParent(), tr("Choose Patch"), QString(), filter); if (file.isEmpty()) { m_gitClient->endStashScope(workingDirectory); return; @@ -1302,7 +1302,7 @@ template dialog->show(); dialog->raise(); } else { - dialog = new NonModalDialog(ICore::mainWindow()); + dialog = new NonModalDialog(ICore::dialogParent()); dialog->refresh(topLevel, true); dialog->show(); } From 9225d5079f46f55408bd380310d724b1df4f147b Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 27 Nov 2018 10:04:38 +0100 Subject: [PATCH 10/19] Doc: Add a workaround for changing the default editor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit You can move a filename pattern from one MIME type to another to open the file in another editor by default. This might be useful when working on file types that are not registered MIME types and that clash with the registered ones. Change-Id: Ic68f7db7bd58fab48a2aa6edbffc123f13c63899 Reviewed-by: André Hartmann --- doc/src/editors/creator-only/creator-mime-types.qdoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/src/editors/creator-only/creator-mime-types.qdoc b/doc/src/editors/creator-only/creator-mime-types.qdoc index 553f47778c2..eb796422dd3 100644 --- a/doc/src/editors/creator-only/creator-mime-types.qdoc +++ b/doc/src/editors/creator-only/creator-mime-types.qdoc @@ -105,6 +105,16 @@ \endlist + Even if an alternative editor is not listed for a MIME type, you can still + change the editor that is used to open the files of a particular type. + Remove the filename extension from the current MIME type and add it to a + MIME type that is handled by the editor you want to use. For example, to + edit Linux kernel device tree source (.dts) files with the text editor, + delete the pattern \c {*.dts} from the MIME type \c {audio/vnd.dts} (where + it represents the digital surround audio file format), and add it to the + \c {text/plain} MIME type. You can use the \uicontrol Filter field to find + the MIME type that currently contains a filename extension. + To revert the changes you have made to the MIME type definitions, select \uicontrol {Reset MIME Types}. To revert the changes you have made to the default editors, select \uicontrol {Reset Handlers}. From d1a4e10fbace577ba87888b140a1b236a751483c Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 29 Nov 2018 15:43:40 +0200 Subject: [PATCH 11/19] Core: Use correct parent for fileDeletedPrompt Fixes: QTCREATORBUG-21607 Change-Id: Ibf1ba7440cd1cbcd746b1be60a6058b86692ca2b Reviewed-by: Eike Ziller --- src/plugins/coreplugin/documentmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 95da306aca0..b054b7ccd16 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -1196,8 +1196,8 @@ void DocumentManager::checkForReload() if (previousDeletedAnswer != FileDeletedCloseAll) { previousDeletedAnswer = fileDeletedPrompt(document->filePath().toString(), - trigger == IDocument::TriggerExternal, - QApplication::activeWindow()); + trigger == IDocument::TriggerExternal, + ICore::dialogParent()); } switch (previousDeletedAnswer) { case FileDeletedSave: From 3d92a79a096d5777f8dce6712b875ef7d9e339ee Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 21 Nov 2018 09:01:32 +0100 Subject: [PATCH 12/19] Debugger: Work around scrambled dock widget layouts In some so far unknown situation the saveLayout/restoreLayout process leads to a situation where some docks does not end up below the perspective toolbar even though they were there initially, leading to an awkward dock layout. Try to detect the situation (no other dock directly below the toolbar) and correct that by restoring the default layout. Task-number: QTCREATORBUG-21455 Change-Id: Ie5eaf2717a750823d96b103f9fd7ac194ba3914c Reviewed-by: Eike Ziller Reviewed-by: Orgad Shaneh --- src/plugins/debugger/debuggermainwindow.cpp | 35 +++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index 8583cb6a8ea..18cfd421f03 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -115,6 +115,7 @@ public: void registerPerspective(Perspective *perspective); void resetCurrentPerspective(); int indexInChooser(Perspective *perspective) const; + void fixupLayoutIfNeeded(); DebuggerMainWindow *q = nullptr; Perspective *m_currentPerspective = nullptr; @@ -357,6 +358,8 @@ void DebuggerMainWindowPrivate::resetCurrentPerspective() } depopulateCurrentPerspective(); populateCurrentPerspective(); + if (m_currentPerspective) + m_currentPerspective->d->saveLayout(); } int DebuggerMainWindowPrivate::indexInChooser(Perspective *perspective) const @@ -364,6 +367,30 @@ int DebuggerMainWindowPrivate::indexInChooser(Perspective *perspective) const return perspective ? m_perspectiveChooser->findData(perspective->d->m_id) : -1; } +void DebuggerMainWindowPrivate::fixupLayoutIfNeeded() +{ + // Evil workaround for QTCREATORBUG-21455: In some so far unknown situation + // the saveLayout/restoreLayout process leads to a situation where some docks + // does not end up below the perspective toolbar even though they were there + // initially, leading to an awkward dock layout. + // This here tries to detect the situation (no other dock directly below the + // toolbar) and "corrects" that by restoring the default layout. + const QRect toolbarRect = m_toolBarDock->geometry(); + const int targetX = toolbarRect.left(); + const int targetY = toolbarRect.bottom(); + + const QList docks = q->dockWidgets(); + for (QDockWidget *dock : docks) { + const QRect dockRect = dock->geometry(); + // 10 for some decoration wiggle room. Found something below? Good. + if (targetX == dockRect.left() && qAbs(targetY - dockRect.top()) < 10) + return; + } + + qDebug() << "Scrambled dock layout found. Resetting it."; + resetCurrentPerspective(); +} + void DebuggerMainWindowPrivate::selectPerspective(Perspective *perspective) { QTC_ASSERT(perspective, return); @@ -381,8 +408,10 @@ void DebuggerMainWindowPrivate::selectPerspective(Perspective *perspective) populateCurrentPerspective(); - if (m_currentPerspective) + if (m_currentPerspective) { m_currentPerspective->d->restoreLayout(); + fixupLayoutIfNeeded(); + } int index = indexInChooser(m_currentPerspective); if (index == -1) { @@ -450,6 +479,8 @@ void DebuggerMainWindowPrivate::populateCurrentPerspective() ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS)->addAction(cmd); } + m_currentPerspective->d->showToolBar(); + // Pre-arrange dock widgets. for (const DockOperation &op : m_currentPerspective->d->m_dockOperations) { QTC_ASSERT(op.widget, continue); @@ -483,8 +514,6 @@ void DebuggerMainWindowPrivate::populateCurrentPerspective() dock->setVisible(op.visibleByDefault); } - m_currentPerspective->d->showToolBar(); - QWidget *central = m_currentPerspective->centralWidget(); m_centralWidgetStack->addWidget(central ? central : m_editorPlaceHolder); q->showCentralWidgetAction()->setText(central ? central->windowTitle() From 137d02678e017ab94f83732c0f72927c7d46cd90 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 29 Nov 2018 10:43:42 +0100 Subject: [PATCH 13/19] QML Debugger: Guard against some invalid data If the debug service announced unreasonably large numbers of objects and contexts, we would fill an unreasonable amount of memory with junk here. Change-Id: I461d378f35c7b87ee0be1b5a09aed3d27a133343 Reviewed-by: hjk Reviewed-by: Eike Ziller --- src/libs/qmldebug/baseenginedebugclient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/qmldebug/baseenginedebugclient.cpp b/src/libs/qmldebug/baseenginedebugclient.cpp index df014e43a00..7f8c64f151e 100644 --- a/src/libs/qmldebug/baseenginedebugclient.cpp +++ b/src/libs/qmldebug/baseenginedebugclient.cpp @@ -155,7 +155,7 @@ void BaseEngineDebugClient::decode(QDataStream &ds, int contextCount; ds >> contextCount; - for (int ii = 0; ii < contextCount; ++ii) { + for (int ii = 0; ii < contextCount && !ds.atEnd(); ++ii) { c.m_contexts.append(ContextReference()); decode(ds, c.m_contexts.last()); } @@ -163,7 +163,7 @@ void BaseEngineDebugClient::decode(QDataStream &ds, int objectCount; ds >> objectCount; - for (int ii = 0; ii < objectCount; ++ii) { + for (int ii = 0; ii < objectCount && !ds.atEnd(); ++ii) { ObjectReference obj; decode(ds, obj, true); obj.m_contextDebugId = c.m_debugId; From 445b7a6242c09b321cc16b4e096f6241f13cb5d8 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 19 Nov 2018 10:40:58 +0100 Subject: [PATCH 14/19] Squish: Mark test as expected fail Task-number: QTCREATORBUG-21335 Change-Id: I54148ecf746362a22bf739ef80930a40bb6da2fe Reviewed-by: Christian Stenger Reviewed-by: Robert Loehning --- tests/system/suite_qtquick/tst_qml_outline/test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/system/suite_qtquick/tst_qml_outline/test.py b/tests/system/suite_qtquick/tst_qml_outline/test.py index b55cfaf367d..4c0c5e8a037 100644 --- a/tests/system/suite_qtquick/tst_qml_outline/test.py +++ b/tests/system/suite_qtquick/tst_qml_outline/test.py @@ -140,8 +140,12 @@ def verifyOutline(outlinePseudoTree, datasetFileName): return for counter, (expectedItem, foundItem) in enumerate(zip(expected, outlinePseudoTree)): if expectedItem != foundItem: - test.fail("Mismatch in element number %d for '%s'" % (counter + 1, fileName), - "%s != %s" % (str(expectedItem), str(foundItem))) + if JIRA.isBugStillOpen(21335) and expectedItem[:-1] == foundItem[:-1]: + test.xfail("Mismatch in element number %d for '%s'" % (counter + 1, fileName), + "%s != %s" % (str(expectedItem), str(foundItem))) + else: + test.fail("Mismatch in element number %d for '%s'" % (counter + 1, fileName), + "%s != %s" % (str(expectedItem), str(foundItem))) return test.passes("All nodes (%d) inside outline match expected nodes for '%s'." % (len(expected), fileName)) From bb00d3fb0ed13d005aab567879c3420879c08492 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Fri, 30 Nov 2018 11:39:39 +0100 Subject: [PATCH 15/19] Clang: Fix clang-cl environment The environment depends on vcvars script and with current way of clang-cl initialization we need to call it again when vcvars are updated. Change-Id: I5ccf34861b711c2514203408db62e2a134592721 Reviewed-by: Tobias Hunger Reviewed-by: Nikolai Kosjar --- src/plugins/projectexplorer/msvctoolchain.cpp | 4 ++++ src/plugins/projectexplorer/msvctoolchain.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 7638884aad6..5defb0b7449 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -1102,6 +1102,10 @@ void ClangClToolChain::resetMsvcToolChain(const MsvcToolChain *base) m_abi = base->targetAbi(); m_vcvarsBat = base->varsBat(); setVarsBatArg(base->varsBatArg()); + + initEnvModWatcher(Utils::runAsync(envModThreadPool(), + &ClangClToolChain::environmentModifications, + m_vcvarsBat, base->varsBatArg())); } bool ClangClToolChain::operator ==(const ToolChain &other) const diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index c1482b95b3a..73c683daf96 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -97,7 +97,6 @@ protected: LanguageVersion msvcLanguageVersion(const Core::Id &language, const Macros ¯os) const override; -private: struct GenerateEnvResult { Utils::optional error; @@ -106,6 +105,8 @@ private: static void environmentModifications(QFutureInterface &future, QString vcvarsBat, QString varsBatArg); void initEnvModWatcher(const QFuture &future); + +private: void updateEnvironmentModifications(QList modifications); mutable QList m_environmentModifications; From 850ac7d8057f1ee39c275084cf5900bf5ec62219 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Fri, 30 Nov 2018 12:19:55 +0100 Subject: [PATCH 16/19] Clang: Properly generate macros with clang-cl Clang-cl can work with different command line styles but it seems that it's a bad idea to mix them. So let's use gcc toolchain methods only when --driver-mode=g++ is specified and ones from msvc toolchain in other cases. Change-Id: I071a124a07b31bce2a0a5594ff8ca79d9ed84716 Reviewed-by: Nikolai Kosjar --- .../projectexplorer/abstractmsvctoolchain.cpp | 3 ++- src/plugins/projectexplorer/abstractmsvctoolchain.h | 3 ++- src/plugins/projectexplorer/msvctoolchain.cpp | 13 ++++++++++--- src/plugins/projectexplorer/msvctoolchain.h | 6 ++++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp index 33861c36815..0aea9695b47 100644 --- a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp +++ b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp @@ -129,7 +129,8 @@ ToolChain::MacroInspectionRunner AbstractMsvcToolChain::createMacroInspectionRun const Macros macros = msvcPredefinedMacros(filteredFlags, env); - const auto report = MacroInspectionReport{macros, msvcLanguageVersion(lang, macros)}; + const auto report = MacroInspectionReport{macros, + msvcLanguageVersion(filteredFlags, lang, macros)}; macroCache->insert(filteredFlags, report); return report; diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.h b/src/plugins/projectexplorer/abstractmsvctoolchain.h index 8fc7c46be50..f1f74ec8a17 100644 --- a/src/plugins/projectexplorer/abstractmsvctoolchain.h +++ b/src/plugins/projectexplorer/abstractmsvctoolchain.h @@ -98,7 +98,8 @@ protected: // Function must be thread-safe! virtual Macros msvcPredefinedMacros(const QStringList cxxflags, const Utils::Environment& env) const = 0; - virtual LanguageVersion msvcLanguageVersion(const Core::Id &language, + virtual LanguageVersion msvcLanguageVersion(const QStringList cxxflags, + const Core::Id &language, const Macros ¯os) const = 0; Utils::FileName m_debuggerCommand; diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 5defb0b7449..020247b3cb7 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -525,7 +525,8 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList cxxflags, // // For _MSV_VER values, see https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2017. // -LanguageVersion MsvcToolChain::msvcLanguageVersion(const Core::Id &language, +LanguageVersion MsvcToolChain::msvcLanguageVersion(const QStringList /*cxxflags*/, + const Core::Id &language, const Macros ¯os) const { int mscVer = -1; @@ -1120,6 +1121,9 @@ bool ClangClToolChain::operator ==(const ToolChain &other) const Macros ClangClToolChain::msvcPredefinedMacros(const QStringList cxxflags, const Utils::Environment &env) const { + if (!cxxflags.contains("--driver-mode=g++")) + return MsvcToolChain::msvcPredefinedMacros(cxxflags, env); + Utils::SynchronousProcess cpp; cpp.setEnvironment(env.toStringList()); cpp.setWorkingDirectory(Utils::TemporaryDirectory::masterDirectoryPath()); @@ -1138,10 +1142,13 @@ Macros ClangClToolChain::msvcPredefinedMacros(const QStringList cxxflags, return Macro::toMacros(response.allRawOutput()); } -LanguageVersion ClangClToolChain::msvcLanguageVersion(const Core::Id &language, +LanguageVersion ClangClToolChain::msvcLanguageVersion(const QStringList cxxflags, + const Core::Id &language, const Macros ¯os) const { - return ToolChain::languageVersion(language, macros); + if (cxxflags.contains("--driver-mode=g++")) + return ToolChain::languageVersion(language, macros); + return MsvcToolChain::msvcLanguageVersion(cxxflags, language, macros); } // -------------------------------------------------------------------------- diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 73c683daf96..b6a205e83bd 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -94,7 +94,8 @@ protected: // Function must be thread-safe! Macros msvcPredefinedMacros(const QStringList cxxflags, const Utils::Environment &env) const override; - LanguageVersion msvcLanguageVersion(const Core::Id &language, + LanguageVersion msvcLanguageVersion(const QStringList cxxflags, + const Core::Id &language, const Macros ¯os) const override; struct GenerateEnvResult @@ -141,7 +142,8 @@ public: void resetMsvcToolChain(const MsvcToolChain *base = nullptr); Macros msvcPredefinedMacros(const QStringList cxxflags, const Utils::Environment &env) const override; - LanguageVersion msvcLanguageVersion(const Core::Id &language, + LanguageVersion msvcLanguageVersion(const QStringList cxxflags, + const Core::Id &language, const Macros ¯os) const override; bool operator ==(const ToolChain &) const override; From 35f5bcd432a60f9f2f88fde92aa103244335b5da Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 30 Nov 2018 11:27:06 +0100 Subject: [PATCH 17/19] be able to build without qbs Change-Id: Ieaa836a5ec813d1d5b5439f2bfdce2ee4b15dcf7 Reviewed-by: Eike Ziller --- scripts/createSourcePackages.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/createSourcePackages.py b/scripts/createSourcePackages.py index af99704ac3f..1385de943aa 100755 --- a/scripts/createSourcePackages.py +++ b/scripts/createSourcePackages.py @@ -99,7 +99,9 @@ def main(): args = parse_arguments() base_repo_name = args.name if args.name else "qtcreator" if not args.name and not args.modules: # default Qt Creator repository - args.modules = [os.path.join('src', 'shared', 'qbs')] + qbs_path = os.path.join('src', 'shared', 'qbs') + if os.path.exists(os.path.join(args.repo, qbs_path)): + args.modules = [qbs_path] repos = [(base_repo_name, args.repo, '')] for module in args.modules: repos += [(module, os.path.join(args.repo, module), module + os.sep)] From 185f8985c693195b2026b0504d02d8690fb04705 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 30 Nov 2018 14:05:18 +0100 Subject: [PATCH 18/19] Debugger: Fix unexpected state transitions with GDB ... for temporary stops. The transition is not unexpected, we just failed to communicate the expectation. Change-Id: I30cdcffdcc3672e759023cd0c07de4bea11c2e32 Reviewed-by: Christian Stenger Reviewed-by: Eike Ziller --- src/plugins/debugger/gdb/gdbengine.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 723f508763c..b4d104509e8 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -757,6 +757,7 @@ void GdbEngine::runCommand(const DebuggerCommand &command) if (state() == InferiorRunOk) { showStatusMessage(tr("Stopping temporarily."), 1000); m_onStop.append(cmd, wantContinue); + setState(InferiorStopRequested); interruptInferior(); return; } From f0226d9644e7936cc12109448490047ae52bc320 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 30 Nov 2018 11:10:02 +0100 Subject: [PATCH 19/19] Qmake: Use target-specific extension for deployment Add file extensions to execatables about to be deployed based on the OS found in the toolchain's targetAbi instead of using the hostOs(). This should fix deployment from windows to non-windows machines. Task-number: QTCREATORBUG-21608 Change-Id: I83678bda1d56ff24848b7b498b95081d00b5a5f0 Reviewed-by: Eike Ziller Reviewed-by: hjk Reviewed-by: Robert Loehning (cherry picked from commit 383f0b9fcc6f2e6faad002d01560a81df0ca1813) --- src/plugins/projectexplorer/abi.cpp | 21 +++++++++++++++++++ src/plugins/projectexplorer/abi.h | 4 ++++ .../qmakeprojectmanager/qmakeproject.cpp | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index bc8c9efa4ec..69d87fd1b09 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -547,6 +547,27 @@ Abi Abi::abiFromTargetTriplet(const QString &triple) return Abi(arch, os, flavor, format, width); } +Utils::OsType Abi::abiOsToOsType(const Abi::OS os) +{ + switch (os) { + case ProjectExplorer::Abi::LinuxOS: + return Utils::OsType::OsTypeLinux; + case ProjectExplorer::Abi::DarwinOS: + return Utils::OsType::OsTypeMac; + case ProjectExplorer::Abi::BsdOS: + case ProjectExplorer::Abi::UnixOS: + return Utils::OsType::OsTypeOtherUnix; + case ProjectExplorer::Abi::WindowsOS: + return Utils::OsType::OsTypeWindows; + case ProjectExplorer::Abi::VxWorks: + case ProjectExplorer::Abi::QnxOS: + case ProjectExplorer::Abi::BareMetalOS: + case ProjectExplorer::Abi::UnknownOS: + return Utils::OsType::OsTypeOther; + } + return Utils::OsType::OsTypeOther; +} + QString Abi::toString() const { const QStringList dn = {toString(m_architecture), toString(m_os), toString(m_osFlavor), diff --git a/src/plugins/projectexplorer/abi.h b/src/plugins/projectexplorer/abi.h index 09cc284a5ca..e49df3348f8 100644 --- a/src/plugins/projectexplorer/abi.h +++ b/src/plugins/projectexplorer/abi.h @@ -27,6 +27,8 @@ #include "projectexplorer_export.h" +#include + #include #include @@ -112,6 +114,8 @@ public: static Abi abiFromTargetTriplet(const QString &machineTriple); + static Utils::OsType abiOsToOsType(const OS os); + bool operator != (const Abi &other) const; bool operator == (const Abi &other) const; bool isCompatibleWith(const Abi &other) const; diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 25477977806..2ec401c1725 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -1347,7 +1347,7 @@ QString QmakeProject::executableFor(const QmakeProFile *file) } else { const QString extension = file->singleVariableValue(Variable::TargetExt); if (extension.isEmpty()) - target = HostOsInfo::withExecutableSuffix(ti.target); + target = OsSpecificAspects::withExecutableSuffix(Abi::abiOsToOsType(tc->targetAbi().os()), ti.target); else target = ti.target + extension; }