From 64d8ac488069a54381f0c3483d4dfd8f0430490f Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Fri, 7 Aug 2015 10:58:17 +0200 Subject: Clang: Fix showing signature tooltips for functions ...and others in the generic completion widget. Task-number: QTCREATORBUG-14874 Change-Id: I75122eaf364d740b0a64ca514b31a26c5c8ea673 Reviewed-by: Marco Bubke --- .../clangcompletionassistprocessor.cpp | 5 +--- .../test/clangcodecompletion_test.cpp | 32 +++++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp index bff0c4577e..eadb4a37ce 100644 --- a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp +++ b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp @@ -100,10 +100,7 @@ QList toAssistProposalItems(const CodeCompletions &complet items.insert(name, item); item->setText(name); item->setOrder(ccr.priority()); - - if (ccr.completionKind() == CodeCompletion::KeywordCompletionKind) - item->setDetail(CompletionChunksToTextConverter::convertToToolTip(ccr.chunks())); - + item->setDetail(CompletionChunksToTextConverter::convertToToolTip(ccr.chunks())); item->setCodeCompletion(ccr); } diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp index 215c434d69..5c30f4a0c7 100644 --- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp +++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp @@ -623,15 +623,33 @@ public: ProposalModel proposal; }; -bool hasItem(ProposalModel model, const QByteArray &text) +int indexOfItemWithText(ProposalModel model, const QByteArray &text) { if (!model) - return false; + return -1; for (int i = 0, size = model->size(); i < size; ++i) { const QString itemText = model->text(i); if (itemText == QString::fromUtf8(text)) - return true; + return i; + } + + return -1; +} + +bool hasItem(ProposalModel model, const QByteArray &text) +{ + return indexOfItemWithText(model, text) != -1; +} + +bool hasItem(ProposalModel model, const QByteArray &text, const QByteArray &detail) +{ + const int index = indexOfItemWithText(model, text); + if (index != -1 && index < model->size()) { + TextEditor::IAssistProposalModel *imodel = model.data(); + const auto genericModel = static_cast(imodel); + const auto itemDetail = genericModel->detail(index); + return itemDetail == QString::fromUtf8(detail); } return false; @@ -844,10 +862,10 @@ void ClangCodeCompletionTest::testCompleteGlobals() { ProjectLessCompletionTest t("globalCompletion.cpp"); - QVERIFY(hasItem(t.proposal, "globalVariable")); - QVERIFY(hasItem(t.proposal, "globalFunction")); - QVERIFY(hasItem(t.proposal, "GlobalClass")); - QVERIFY(hasItem(t.proposal, "class")); // Keyword + QVERIFY(hasItem(t.proposal, "globalVariable", "int globalVariable")); + QVERIFY(hasItem(t.proposal, "globalFunction", "void globalFunction ()")); + QVERIFY(hasItem(t.proposal, "GlobalClass", "GlobalClass")); + QVERIFY(hasItem(t.proposal, "class", "class")); // Keyword QVERIFY(hasSnippet(t.proposal, "class")); // Snippet } -- cgit v1.2.1 From 8261b98d7e1d9e12457a37401d19eb80511688a5 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 5 Aug 2015 15:20:14 +0200 Subject: Preferences: Options pages need unique IDs Since we are referring to them by ID without specifying the category in addition. This requirement was implicitly added by 592ffe737794c59045b6d2f7964621ecfd44dea3 Task-number: QTCREATORBUG-14742 Change-Id: I7be539127b76de90c19b0282565d845fa42010ab Reviewed-by: Robert Loehning Reviewed-by: hjk --- src/plugins/coreplugin/dialogs/settingsdialog.cpp | 63 ++++++++++++++-------- .../cpaster/fileshareprotocolsettingspage.cpp | 2 +- src/plugins/cpaster/settingspage.cpp | 2 +- src/plugins/cpptools/cpptoolsconstants.h | 6 +-- src/plugins/debugger/cdb/cdboptionspage.cpp | 4 +- src/plugins/debugger/commonoptionspage.cpp | 2 +- src/plugins/debugger/debuggerinternalconstants.h | 2 +- src/plugins/fakevim/fakevimplugin.cpp | 6 +-- src/plugins/vcsbase/vcsbaseconstants.h | 2 +- 9 files changed, 54 insertions(+), 35 deletions(-) diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 0b7c212aa1..ba20b2fa0c 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -64,6 +64,21 @@ namespace Internal { static QPointer m_instance = 0; +// Helpers to sort by category. id +bool optionsPageLessThan(const IOptionsPage *p1, const IOptionsPage *p2) +{ + if (p1->category() != p2->category()) + return p1->category().alphabeticallyBefore(p2->category()); + return p1->id().alphabeticallyBefore(p2->id()); +} + +static inline QList sortedOptionsPages() +{ + QList rc = ExtensionSystem::PluginManager::getObjects(); + qStableSort(rc.begin(), rc.end(), optionsPageLessThan); + return rc; +} + // ----------- Category model class Category @@ -104,12 +119,14 @@ public: void setPages(const QList &pages, const QList &providers); + void ensurePages(Category *category); const QList &categories() const { return m_categories; } private: Category *findCategoryById(Id id); QList m_categories; + QSet m_pageIds; QIcon m_emptyIcon; }; @@ -155,9 +172,13 @@ void CategoryModel::setPages(const QList &pages, // Clear any previous categories qDeleteAll(m_categories); m_categories.clear(); + m_pageIds.clear(); // Put the pages in categories foreach (IOptionsPage *page, pages) { + QTC_ASSERT(!m_pageIds.contains(page->id()), + qWarning("duplicate options page id '%s'", qPrintable(page->id().toString()))); + m_pageIds.insert(page->id()); const Id categoryId = page->category(); Category *category = findCategoryById(categoryId); if (!category) { @@ -194,6 +215,25 @@ void CategoryModel::setPages(const QList &pages, endResetModel(); } +void CategoryModel::ensurePages(Category *category) +{ + if (!category->providerPagesCreated) { + QList createdPages; + foreach (const IOptionsPageProvider *provider, category->providers) + createdPages += provider->pages(); + + // check for duplicate ids + foreach (IOptionsPage *page, createdPages) { + QTC_ASSERT(!m_pageIds.contains(page->id()), + qWarning("duplicate options page id '%s'", qPrintable(page->id().toString()))); + } + + category->pages += createdPages; + category->providerPagesCreated = true; + qStableSort(category->pages.begin(), category->pages.end(), optionsPageLessThan); + } +} + Category *CategoryModel::findCategoryById(Id id) { for (int i = 0; i < m_categories.size(); ++i) { @@ -359,21 +399,6 @@ private: // ----------- SettingsDialog -// Helpers to sort by category. id -bool optionsPageLessThan(const IOptionsPage *p1, const IOptionsPage *p2) -{ - if (p1->category() != p2->category()) - return p1->category().alphabeticallyBefore(p2->category()); - return p1->id().alphabeticallyBefore(p2->id()); -} - -static inline QList sortedOptionsPages() -{ - QList rc = ExtensionSystem::PluginManager::getObjects(); - qStableSort(rc.begin(), rc.end(), optionsPageLessThan); - return rc; -} - SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent), m_pages(sortedOptionsPages()), @@ -540,14 +565,8 @@ void SettingsDialog::ensureCategoryWidget(Category *category) { if (category->tabWidget != 0) return; - if (!category->providerPagesCreated) { - foreach (const IOptionsPageProvider *provider, category->providers) - category->pages += provider->pages(); - category->providerPagesCreated = true; - } - - qStableSort(category->pages.begin(), category->pages.end(), optionsPageLessThan); + m_model->ensurePages(category); QTabWidget *tabWidget = new QTabWidget; for (int j = 0; j < category->pages.size(); ++j) { IOptionsPage *page = category->pages.at(j); diff --git a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp index e0d46ea838..0805483a8d 100644 --- a/src/plugins/cpaster/fileshareprotocolsettingspage.cpp +++ b/src/plugins/cpaster/fileshareprotocolsettingspage.cpp @@ -99,7 +99,7 @@ FileShareProtocolSettingsPage::FileShareProtocolSettingsPage(const QSharedPointe QObject *parent) : Core::IOptionsPage(parent), m_settings(s), m_widget(0) { - setId("X.FileSharePaster"); + setId("X.CodePaster.FileSharePaster"); setDisplayName(tr("Fileshare")); setCategory(Constants::CPASTER_SETTINGS_CATEGORY); setDisplayCategory(QCoreApplication::translate("CodePaster", Constants::CPASTER_SETTINGS_TR_CATEGORY)); diff --git a/src/plugins/cpaster/settingspage.cpp b/src/plugins/cpaster/settingspage.cpp index a391ffb366..aa32cf3587 100644 --- a/src/plugins/cpaster/settingspage.cpp +++ b/src/plugins/cpaster/settingspage.cpp @@ -70,7 +70,7 @@ Settings SettingsWidget::settings() SettingsPage::SettingsPage(const QSharedPointer &settings) : m_settings(settings), m_widget(0) { - setId("A.General"); + setId("A.CodePaster.General"); setDisplayName(tr("General")); setCategory(Constants::CPASTER_SETTINGS_CATEGORY); setDisplayCategory(QCoreApplication::translate("CodePaster", diff --git a/src/plugins/cpptools/cpptoolsconstants.h b/src/plugins/cpptools/cpptoolsconstants.h index 2b2bf859a9..d6130297f2 100644 --- a/src/plugins/cpptools/cpptoolsconstants.h +++ b/src/plugins/cpptools/cpptoolsconstants.h @@ -56,11 +56,11 @@ const char CPPTOOLS_SORT_EDITOR_DOCUMENT_OUTLINE[] = "SortedMethodOverview"; const char CPPTOOLS_MODEL_MANAGER_SUPPORTERS_KEY[] = "ModelManagerSupporters"; const char CPPTOOLS_MODEL_MANAGER_PCH_USAGE[] = "PCHUsage"; -const char CPP_CODE_STYLE_SETTINGS_ID[] = "A.Code Style"; +const char CPP_CODE_STYLE_SETTINGS_ID[] = "A.Cpp.Code Style"; const char CPP_CODE_STYLE_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("CppTools", "Code Style"); -const char CPP_FILE_SETTINGS_ID[] = "B.File Naming"; +const char CPP_FILE_SETTINGS_ID[] = "B.Cpp.File Naming"; const char CPP_FILE_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("CppTools", "File Naming"); -const char CPP_CODE_MODEL_SETTINGS_ID[] = "C.Code Model"; +const char CPP_CODE_MODEL_SETTINGS_ID[] = "C.Cpp.Code Model"; const char CPP_CODE_MODEL_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("CppTools", "Code Model"); const char CPP_SETTINGS_CATEGORY[] = "I.C++"; const char CPP_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("CppTools", "C++"); diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp index 5631ee4f8c..f4e82dee12 100644 --- a/src/plugins/debugger/cdb/cdboptionspage.cpp +++ b/src/plugins/debugger/cdb/cdboptionspage.cpp @@ -202,7 +202,7 @@ QStringList CdbOptionsPageWidget::breakEvents() const CdbOptionsPage::CdbOptionsPage() { - setId("F.Cda"); + setId("F.Debugger.Cda"); setDisplayName(tr("CDB")); setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY); setDisplayCategory(QCoreApplication::translate("Debugger", @@ -281,7 +281,7 @@ CdbPathsPageWidget::CdbPathsPageWidget(QWidget *parent) : CdbPathsPage::CdbPathsPage() : m_widget(0) { - setId("F.Cdb"); + setId("F.Debugger.Cdb"); setDisplayName(tr("CDB Paths")); setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY); setDisplayCategory(QCoreApplication::translate("Debugger", diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index 2e7e17ea19..aada5d7c33 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -339,7 +339,7 @@ QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *functio LocalsAndExpressionsOptionsPage::LocalsAndExpressionsOptionsPage() { - setId("Z.LocalsAndExpressions"); + setId("Z.Debugger.LocalsAndExpressions"); //: '&&' will appear as one (one is marking keyboard shortcut) setDisplayName(QCoreApplication::translate("Debugger", "Locals && Expressions")); setCategory(DEBUGGER_SETTINGS_CATEGORY); diff --git a/src/plugins/debugger/debuggerinternalconstants.h b/src/plugins/debugger/debuggerinternalconstants.h index 290edbde3f..823bf00aff 100644 --- a/src/plugins/debugger/debuggerinternalconstants.h +++ b/src/plugins/debugger/debuggerinternalconstants.h @@ -36,7 +36,7 @@ namespace Debugger { namespace Constants { -const char DEBUGGER_COMMON_SETTINGS_ID[] = "A.Common"; +const char DEBUGGER_COMMON_SETTINGS_ID[] = "A.Debugger.General"; const char DEBUGGER_SETTINGS_CATEGORY[] = "O.Debugger"; const char DEBUGGER_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("Debugger", "Debugger"); const char DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON[] = ":/debugger/images/category_debug.png"; diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 1cb4c0f041..9b7aa2ef73 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -111,9 +111,9 @@ namespace Internal { const char INSTALL_HANDLER[] = "TextEditor.FakeVimHandler"; const char SETTINGS_CATEGORY[] = "D.FakeVim"; const char SETTINGS_CATEGORY_FAKEVIM_ICON[] = ":/fakevim/images/category_fakevim.png"; -const char SETTINGS_ID[] = "A.General"; -const char SETTINGS_EX_CMDS_ID[] = "B.ExCommands"; -const char SETTINGS_USER_CMDS_ID[] = "C.UserCommands"; +const char SETTINGS_ID[] = "A.FakeVim.General"; +const char SETTINGS_EX_CMDS_ID[] = "B.FakeVim.ExCommands"; +const char SETTINGS_USER_CMDS_ID[] = "C.FakeVim.UserCommands"; typedef QLatin1String _; class MiniBuffer : public QStackedWidget diff --git a/src/plugins/vcsbase/vcsbaseconstants.h b/src/plugins/vcsbase/vcsbaseconstants.h index d3620760df..506f278af8 100644 --- a/src/plugins/vcsbase/vcsbaseconstants.h +++ b/src/plugins/vcsbase/vcsbaseconstants.h @@ -39,7 +39,7 @@ namespace Constants { const char VCS_SETTINGS_CATEGORY[] = "V.Version Control"; const char VCS_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("VcsBase", "Version Control"); const char SETTINGS_CATEGORY_VCS_ICON[] = ":/vcsbase/images/category_vcs.png"; -const char VCS_COMMON_SETTINGS_ID[] = "A.Common"; +const char VCS_COMMON_SETTINGS_ID[] = "A.VCS.General"; const char VCS_COMMON_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("VcsBase", "General"); // Ids for sort order (wizards and preferences) -- cgit v1.2.1 From a874dc23050f2269dccfa30b12c8f90986bffce3 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 5 Aug 2015 15:50:25 +0200 Subject: Preferences: Sort categories from providers into list of categories Designer options were always coming last because that uses an options provider instead of option pages directly. Change-Id: I2c02ce7d2ff122beb5d563a9c9ac263bdc71f62b Reviewed-by: hjk --- src/plugins/coreplugin/dialogs/settingsdialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index ba20b2fa0c..3a655db996 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -64,7 +65,6 @@ namespace Internal { static QPointer m_instance = 0; -// Helpers to sort by category. id bool optionsPageLessThan(const IOptionsPage *p1, const IOptionsPage *p2) { if (p1->category() != p2->category()) @@ -212,6 +212,9 @@ void CategoryModel::setPages(const QList &pages, category->providers.append(provider); } + Utils::sort(m_categories, [](const Category *c1, const Category *c2) { + return c1->id.alphabeticallyBefore(c2->id); + }); endResetModel(); } -- cgit v1.2.1 From 5dab51ce9f9a4f6cb203c8572ac716c9376d0d1c Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 10 Aug 2015 11:49:03 +0200 Subject: Squish: Fix tst_default_settings for Ubuntu 15.04 Task-number: QTCREATORBUG-14697 Change-Id: Ia8e41325e61ce6a380dbe0c60cf78c11afc2e99c Reviewed-by: Christian Stenger --- tests/system/suite_general/tst_default_settings/test.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py index 06f033ce32..2605479404 100644 --- a/tests/system/suite_general/tst_default_settings/test.py +++ b/tests/system/suite_general/tst_default_settings/test.py @@ -82,8 +82,10 @@ def __checkBuildAndRun__(): clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Qt Versions") __iterateTree__(":QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget", __qtFunc__, foundQt, qmakePath) + test.verify(not qmakePath or len(foundQt) == 1, + "Was qmake from %s autodetected? Found %s" % (qmakePath, foundQt)) if foundQt: - foundQt = foundQt[0] + foundQt = foundQt[0] # qmake from "which" should be used in kits # check kits clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits") __iterateTree__(":BuildAndRun_QTreeView", __kitFunc__, foundQt, foundCompilerNames) @@ -126,12 +128,16 @@ def __dbgFunc__(it, foundDbg): foundDbg.append(str(pathLineEdit.text)) def __qtFunc__(it, foundQt, qmakePath): - foundQt.append(it) qtPath = str(waitForObject(":QtSupport__Internal__QtVersionManager.qmake_QLabel").text) if platform.system() in ('Microsoft', 'Windows'): qtPath = qtPath.lower() qmakePath = qmakePath.lower() - test.compare(qtPath, qmakePath, "Verifying found and expected Qt version are equal.") + test.verify(os.path.isfile(qtPath) and os.access(qtPath, os.X_OK), + "Verifying found Qt (%s) is executable." % qtPath) + # Two Qt versions will be found when using qtchooser: QTCREATORBUG-14697 + # Only add qmake from "which" to list + if qtPath == qmakePath: + foundQt.append(it) try: errorLabel = findObject(":QtSupport__Internal__QtVersionManager.errorLabel.QLabel") test.warning("Detected error or warning: '%s'" % errorLabel.text) @@ -222,7 +228,8 @@ def __getExpectedDebuggers__(): for debugger in ["gdb", "lldb"]: result.extend(findAllFilesInPATH(debugger)) if platform.system() == 'Linux': - result.extend(findAllFilesInPATH("lldb-*")) + result.extend(filter(lambda s: not ("lldb-platform" in s or "lldb-gdbserver" in s), + findAllFilesInPATH("lldb-*"))) if platform.system() == 'Darwin': xcodeLLDB = getOutputFromCmdline("xcrun --find lldb").strip("\n") if xcodeLLDB and os.path.exists(xcodeLLDB) and xcodeLLDB not in result: -- cgit v1.2.1 From 427c32ccb0e19ab9a01bcb3e63c418a795e58bcb Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 10 Aug 2015 13:25:30 +0200 Subject: Debugger: Fix Jump To Address in LLDB disassembler on Linux lldb.thread.RunToAddress does not seem to hit anything on Linux. Fake it by setting a temporary breakpoint + continue. Change-Id: I533c8fb42c9a3d1ac1e5cc23eae8162a3455fb9a Reviewed-by: Christian Stenger --- share/qtcreator/debugger/lldbbridge.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index f9befc4c3c..6987065c2a 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -1592,18 +1592,27 @@ class Dumper(DumperBase): self.reportToken(args) addr = args.get('address', 0) if addr: - error = self.currentThread().RunToAddress(addr) + # Does not seem to hit anything on Linux: + # self.currentThread().RunToAddress(addr) + bp = self.target.BreakpointCreateByAddress(addr) + if bp.GetNumLocations() == 0: + self.target.BreakpointDelete(bp.GetID()) + self.reportStatus("No target location found.") + self.reportLocation(frame) + return + bp.SetOneShot(True) + self.process.Continue() else: frame = self.currentFrame() file = args['file'] line = int(args['line']) error = self.currentThread().StepOverUntil(frame, lldb.SBFileSpec(file), line) - if error.GetType(): - self.reportState("running") - self.reportState("stopped") - self.reportError(error) - else: - self.reportData() + if error.GetType(): + self.reportState("running") + self.reportState("stopped") + self.reportError(error) + else: + self.reportData() def executeJumpToLocation(self, args): self.reportToken(args) -- cgit v1.2.1 From eaec337265c7de76e8aca4a74669e65b062c9c2d Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 10 Aug 2015 11:50:18 +0200 Subject: Debugger: Fix display of C-style wchar_t strings The null delimiter was not reliably found due to iterating over the wrong positions in the string. Task-number: QTCREATORBUG-14826 Change-Id: I3a3f2fca84648b54b12fe5fae921ce6311d4f1b2 Reviewed-by: Niels Weber --- share/qtcreator/debugger/dumper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index ec8d7a39ef..1cc335ca9b 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -811,7 +811,7 @@ class DumperBase: code = (None, "b", "H", None, "I")[tsize] base = toInteger(p) blob = self.extractBlob(base, maximum).toBytes() - for i in xrange(0, int(maximum / tsize)): + for i in xrange(0, maximum, tsize): t = struct.unpack_from(code, blob, i)[0] if t == 0: return 0, i, self.hexencode(blob[:i]) -- cgit v1.2.1 From 3413130379bbb9fb12a651f0f1a10e9edc157bd6 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 11 Aug 2015 11:15:37 +0200 Subject: Debugger: Fix typo when reporting large containers Regression since 9130cdfc05, leading to "" instead of "" Change-Id: I89166e50f27c568009ff7aeabb5adf622e303789 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/dumper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 1cc335ca9b..0e0acceb23 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -826,7 +826,7 @@ class DumperBase: def putItemCount(self, count, maximum = 1000000000): # This needs to override the default value, so don't use 'put' directly. if count > maximum: - self.putSpeciaValue(SpecialMinimumItemCountValue, maximum) + self.putSpecialValue(SpecialMinimumItemCountValue, maximum) else: self.putSpecialValue(SpecialItemCountValue, count) self.putNumChild(count) -- cgit v1.2.1 From 6fe810f5141ad2fd7439e0ad8039202b1f0016d3 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Fri, 7 Aug 2015 11:43:43 +0200 Subject: Squish: Compare sets directly instead of differences Generates better output with less code. Change-Id: I3a5fa02c5aca97561e20dc4ddf4153596a3a60ae Reviewed-by: Christian Stenger --- tests/system/suite_editors/tst_modify_readonly/test.py | 5 ++--- tests/system/suite_general/tst_default_settings/test.py | 8 ++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/system/suite_editors/tst_modify_readonly/test.py b/tests/system/suite_editors/tst_modify_readonly/test.py index 60be9d04f5..3c891bf910 100644 --- a/tests/system/suite_editors/tst_modify_readonly/test.py +++ b/tests/system/suite_editors/tst_modify_readonly/test.py @@ -106,9 +106,8 @@ def testSaveChangesAndMakeWritable(modifiedFiles, readOnlyFiles): "window=':WritePermissions_Core::Internal::ReadOnlyFilesDialog'}") items = map(os.path.expanduser, map(os.path.join, dumpItems(filesTree.model(), column=4), dumpItems(filesTree.model(), column=3))) - difference = set(readOnlyFiles) ^ set(items) - test.verify(len(difference) == 0, "Verifying whether all modified files without write " - "permission are listed.") + test.compare(set(readOnlyFiles), set(items), + "Verifying whether all modified files without write permission are listed.") clickButton("{text='Change Permission' type='QPushButton' visible='1' unnamed='1' " "window=':WritePermissions_Core::Internal::ReadOnlyFilesDialog'}") except: diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py index 2605479404..965152901d 100644 --- a/tests/system/suite_general/tst_default_settings/test.py +++ b/tests/system/suite_general/tst_default_settings/test.py @@ -299,12 +299,8 @@ def __compareDebuggers__(foundDebuggers, expectedDebuggers): else: foundSet = set(foundDebuggers) expectedSet = set(expectedDebuggers) - if not (test.verify(not foundSet.symmetric_difference(expectedSet), - "Verifying expected and found debuggers match.")): - test.log("Found debuggers: %s" % foundDebuggers, - "Expected debuggers: %s" % expectedDebuggers) - return False - return True + return test.compare(foundSet, expectedSet, + "Verifying expected and found debuggers match.") def __lowerStrs__(iterable): for it in iterable: -- cgit v1.2.1 From 884be5128f8f7904fc2751ad7ab738b73906b0f4 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 11 Aug 2015 10:12:16 +0200 Subject: Debugger: Show QDateTime also for non-default timezone Task-number: QTCREATORBUG-14853 Change-Id: Iaf4501878df15bd55b49d4daab64ea280e14663b Reviewed-by: Niels Weber --- share/qtcreator/debugger/qttypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 62c188c736..da403cabd4 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -280,7 +280,7 @@ def qdump__QDateTime(d, value): tz = "" else: idBase = tzp + 2 * d.ptrSize() # [QSharedData] + [vptr] - tz = d.encodeByteArrayHelper(d.extractPointer(idBase), limit=100) + elided, tz = d.encodeByteArrayHelper(d.extractPointer(idBase), limit=100) d.putValue("%s/%s/%s/%s/%s" % (msecs, spec, offset, tz, status), DateTimeInternal) else: -- cgit v1.2.1 From 1b5e5656f67ca0954a8ea67cbb8d6e86fb543aa3 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 11 Aug 2015 11:43:20 +0200 Subject: Debugger: Fix display of QByteArrays constructed from raw data The sanity check on sizes introduced in 2ad602bb was too harsh, marking the fromRawData() case (alloc == 0, size > 0) as invalid. Change-Id: I9d7e0cedbc3f35024281829cfb1f6fa2e17a1573 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/qttypes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index da403cabd4..7ab1d403be 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -58,7 +58,7 @@ def qform__QByteArray(): def qdump__QByteArray(d, value): data, size, alloc = d.byteArrayData(value) - d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 100) + d.check(alloc == 0 or (0 <= size and size <= alloc and alloc <= 100000000)) d.putNumChild(size) elided, p = d.encodeByteArrayHelper(d.extractPointer(value), d.displayStringLimit) displayFormat = d.currentItemFormat() @@ -79,7 +79,7 @@ def qdump__QByteArray(d, value): def qdump__QByteArrayData(d, value): data, size, alloc = d.byteArrayDataHelper(d.addressOf(value)) - d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 100) + d.check(alloc == 0 or (0 <= size and size <= alloc and alloc <= 100000000)) d.putValue(d.readMemory(data, size), Hex2EncodedLatin1) d.putNumChild(1) if d.isExpanded(): -- cgit v1.2.1 From 472d584d5dc22c88c45acb257703bcbdbcdc0bdd Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 11 Aug 2015 11:56:16 +0200 Subject: Debugger: Adjust dumper test to changed dumper output Change-Id: Ib183c960ff7e737636860e007a16972d5f1f232f Reviewed-by: Christian Stenger --- tests/auto/debugger/tst_dumpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 3263ad00b2..302f6f9857 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -3860,7 +3860,7 @@ void tst_Dumpers::dumper_data() + Check("l0", "<0 items>", "std::list") - + Check("l1", "<>1000 items>", "std::list") + + Check("l1", "", "std::list") + Check("l1.0", "[0]", "0", "int") + Check("l1.1", "[1]", "1", "int") + Check("l1.999", "[999]", "999", "int") -- cgit v1.2.1 From f99e40602bc4757cf9893da39799b1dcbe240112 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 11 Aug 2015 10:59:33 +0200 Subject: Fix typos in CPU Usage Analyzer docs Change-Id: Ie1f62224b62a148c0a6df1ff4afb55fa9aec89af Reviewed-by: Leena Miettinen --- doc/src/analyze/cpu-usage-analyzer.qdoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/src/analyze/cpu-usage-analyzer.qdoc b/doc/src/analyze/cpu-usage-analyzer.qdoc index 095cc7fe4c..8025f47159 100644 --- a/doc/src/analyze/cpu-usage-analyzer.qdoc +++ b/doc/src/analyze/cpu-usage-analyzer.qdoc @@ -198,14 +198,14 @@ As the Perf tool only provides periodic samples, the CPU Usage Analyzer cannot determine the exact time when a function was called or when it - returned. You can, however, see exactly when a sample was taken on the + returned. You can, however, see exactly when a sample was taken in the second row of each thread. The CPU Usage Analyzer assumes that if the same - function is present in the same place in the call chain in multiple samples - on a row, then this represents a single call to the respective function. - This is, of course, a simplification. Also, there may be other functions - being called between the samples taken, which do not show up in the profile - data. However, statistically, the data is likely to show the functions that - spend the most CPU time most prominently. + function is present at the same place in the call chain in multiple + consecutive samples, then this represents a single call to the respective + function. This is, of course, a simplification. Also, there may be other + functions being called between the samples taken, which do not show up in + the profile data. However, statistically, the data is likely to show the + functions that spend the most CPU time most prominently. If a function without debug information is encountered, further unwinding of the stack may fail. Unwinding will also fail if a QML or JavaScript @@ -254,7 +254,7 @@ Start Board and SILICA Architect Tibidabo, are correctly set up for profiling in the dwarf mode. For other devices, check whether Perf can read back its own data in a sensible way by checking the output of - \c {perf report} or \c {perf script} in the recorded Perf data files. + \c {perf report} or \c {perf script} for the recorded Perf data files. \section1 Troubleshooting -- cgit v1.2.1 From 7a88612a8e39ef37fef39d25a7e8c38c1e011b4f Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 11 Aug 2015 14:13:06 +0200 Subject: Debugger: Don't add a new watcher item when editing one in-place Task-number: QTCREATORBUG-14775 Task-number: QTCREATORBUG-14851 Change-Id: I06638ffc2d5a1723e87c1c5a651592e7e0bbad22 Reviewed-by: Orgad Shaneh --- src/plugins/debugger/watchhandler.cpp | 26 +++++++++++++++++++++++++- src/plugins/debugger/watchhandler.h | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 80d59291fa..eab2f7f8c6 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -882,7 +882,7 @@ bool WatchModel::setData(const QModelIndex &idx, const QVariant &value, int role case Qt::EditRole: switch (idx.column()) { case 0: { - m_handler->watchExpression(value.toString().trimmed()); + m_handler->updateWatchExpression(item, value.toString().trimmed().toUtf8()); break; } case 1: // Change value @@ -1278,6 +1278,30 @@ void WatchHandler::watchExpression(const QString &exp0, const QString &name) if (m_model->m_engine->state() == DebuggerNotReady) { item->setAllUnneeded(); item->setValue(QString(QLatin1Char(' '))); + item->update(); + } else { + m_model->m_engine->updateItem(item->iname); + } + updateWatchersWindow(); +} + +void WatchHandler::updateWatchExpression(WatchItem *item, const QByteArray &newExp) +{ + if (newExp.isEmpty()) + return; + + if (item->exp != newExp) { + theWatcherNames.insert(newExp, theWatcherNames.value(item->exp)); + theWatcherNames.remove(item->exp); + item->exp = newExp; + item->name = QString::fromUtf8(item->exp); + } + + saveWatchers(); + if (m_model->m_engine->state() == DebuggerNotReady) { + item->setAllUnneeded(); + item->setValue(QString(QLatin1Char(' '))); + item->update(); } else { m_model->m_engine->updateItem(item->iname); } diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 890fd4d256..f11c1fdc0f 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -153,6 +153,7 @@ public: void cleanup(); void watchExpression(const QString &exp, const QString &name = QString()); + void updateWatchExpression(WatchItem *item, const QByteArray &newExp); void watchVariable(const QString &exp); Q_SLOT void clearWatches(); -- cgit v1.2.1 From 07e1f78ca854c6ead70878142f8b81a43b8b0731 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 7 Aug 2015 09:13:55 +0200 Subject: Editors/Function hint: Guard against potential crashes Change-Id: I285fe66a2ef9fd9543150dbbec5da6a83657ae73 Task-number: QTCREATORBUG-14875 Reviewed-by: David Schulz --- .../texteditor/codeassist/functionhintproposalwidget.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp b/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp index e6f19ee6db..925881a451 100644 --- a/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp +++ b/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -201,7 +202,8 @@ bool FunctionHintProposalWidget::eventFilter(QObject *obj, QEvent *e) d->m_escapePressed = true; e->accept(); } - if (d->m_model->size() > 1) { + QTC_CHECK(d->m_model); + if (d->m_model && d->m_model->size() > 1) { QKeyEvent *ke = static_cast(e); if (ke->key() == Qt::Key_Up) { previousPage(); @@ -220,10 +222,13 @@ bool FunctionHintProposalWidget::eventFilter(QObject *obj, QEvent *e) emit explicitlyAborted(); return false; } else if (ke->key() == Qt::Key_Up || ke->key() == Qt::Key_Down) { - if (d->m_model->size() > 1) + QTC_CHECK(d->m_model); + if (d->m_model && d->m_model->size() > 1) return false; } - d->m_assistant->notifyChange(); + QTC_CHECK(d->m_assistant); + if (d->m_assistant) + d->m_assistant->notifyChange(); } break; case QEvent::WindowDeactivate: -- cgit v1.2.1 From d7c5ee7eddec23217912db1af02720d324612dcd Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Aug 2015 09:05:28 +0200 Subject: Debugger: Fix display selection of char arrays ... by re-using the logic we had for std::string already. A plain char[] value did not react to Change Display Format, Latin1 was used unconditionally. Also rename putStdStringHelper to putCharArrayHelper. Change-Id: I01fdf796ff49a4c99ead7b9b46274684e18e962b Reviewed-by: Christian Stenger --- share/qtcreator/debugger/dumper.py | 18 +++++------------- share/qtcreator/debugger/gdbbridge.py | 2 +- share/qtcreator/debugger/stdtypes.py | 8 ++++---- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 0e0acceb23..4ffdd7f0c7 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -569,7 +569,7 @@ class DumperBase: elided, shown = self.computeLimit(size, limit) return elided, self.readMemory(data, shown) - def putStdStringHelper(self, data, size, charSize, displayFormat = AutomaticFormat): + def putCharArrayHelper(self, data, size, charSize, displayFormat = AutomaticFormat): bytelen = size * charSize elided, shown = self.computeLimit(bytelen, self.displayStringLimit) mem = self.readMemory(data, shown) @@ -917,18 +917,10 @@ class DumperBase: arrayByteSize = int(s[s.find('[')+1:s.find(']')]) * ts; n = int(arrayByteSize / ts) - if displayFormat != RawFormat: - if innerTypeName == "char": - # Use Latin1 as default for char []. - blob = self.readMemory(self.addressOf(value), arrayByteSize) - self.putValue(blob, Hex2EncodedLatin1) - elif innerTypeName == "wchar_t": - blob = self.readMemory(self.addressOf(value), arrayByteSize) - if innerType.sizeof == 2: - self.putValue(blob, Hex4EncodedLittleEndian) - else: - self.putValue(blob, Hex8EncodedLittleEndian) - elif p: + if displayFormat != RawFormat and p: + if innerTypeName == "char" or innerTypeName == "wchar_t": + self.putCharArrayHelper(p, n, ts, self.currentItemFormat()) + else: self.tryPutSimpleFormattedPointer(p, arrayType, innerTypeName, displayFormat, arrayByteSize) self.putNumChild(n) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index b2047d867b..2a7cb77006 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -155,7 +155,7 @@ class PlainDumper: if isinstance(val, str): d.putValue(val) else: # Assuming LazyString - d.putStdStringHelper(val.address, val.length, val.type.sizeof) + d.putCharArrayHelper(val.address, val.length, val.type.sizeof) d.putNumChild(len(children)) if d.isExpanded(): diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index d37edc150a..60c271ebcd 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -419,7 +419,7 @@ def qdump__std__stringHelper1(d, value, charSize, format): refcount = int(sizePtr[-1]) & 0xffffffff d.check(refcount >= -1) # Can be -1 accoring to docs. d.check(0 <= size and size <= alloc and alloc <= 100*1000*1000) - d.putStdStringHelper(sizePtr, size, charSize, format) + d.putCharArrayHelper(sizePtr, size, charSize, format) def qdump__std__stringHelper1__QNX(d, value, charSize, format): size = value['_Mysize'] @@ -433,7 +433,7 @@ def qdump__std__stringHelper1__QNX(d, value, charSize, format): refcount = int(sizePtr[-1]) d.check(refcount >= -1) # Can be -1 accoring to docs. d.check(0 <= size and size <= alloc and alloc <= 100*1000*1000) - d.putStdStringHelper(sizePtr, size, charSize, format) + d.putCharArrayHelper(sizePtr, size, charSize, format) def qdump__std____1__string(d, value): @@ -447,7 +447,7 @@ def qdump__std____1__string(d, value): # Short/internal. size = firstByte / 2 data = base + 1 - d.putStdStringHelper(data, size, 1, d.currentItemFormat()) + d.putCharArrayHelper(data, size, 1, d.currentItemFormat()) d.putType("std::string") @@ -462,7 +462,7 @@ def qdump__std____1__wstring(d, value): # Short/internal. size = firstByte / 2 data = base + 4 - d.putStdStringHelper(data, size, 4) + d.putCharArrayHelper(data, size, 4) d.putType("std::xxwstring") -- cgit v1.2.1 From 786aa4a441c8aa08ab519823a3abcc640b502845 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 4 Aug 2015 20:53:23 +0300 Subject: Git: Fix source repository resolution in Stashes dialog Remove workaround done in Branches and store copies where they're needed. Task-number: QTCREATORBUG-14850 Change-Id: I6a81fc5ac02fb11d444906af6cfbe768695c9965 Reviewed-by: Nikolai Kosjar Reviewed-by: Orgad Shaneh --- src/plugins/git/branchdialog.cpp | 6 ++---- src/plugins/git/gitclient.cpp | 15 ++++++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp index 2c2e129cf8..ee68ed5dfa 100644 --- a/src/plugins/git/branchdialog.cpp +++ b/src/plugins/git/branchdialog.cpp @@ -316,8 +316,7 @@ void BranchDialog::diff() QString fullName = m_model->fullName(selectedIndex(), true); if (fullName.isEmpty()) return; - // Do not pass working dir by reference since it might change - GitPlugin::instance()->client()->diffBranch(QString(m_repository), fullName); + GitPlugin::instance()->client()->diffBranch(m_repository, fullName); } void BranchDialog::log() @@ -325,8 +324,7 @@ void BranchDialog::log() QString branchName = m_model->fullName(selectedIndex(), true); if (branchName.isEmpty()) return; - // Do not pass working dir by reference since it might change - GitPlugin::instance()->client()->log(QString(m_repository), QString(), false, QStringList(branchName)); + GitPlugin::instance()->client()->log(m_repository, QString(), false, QStringList(branchName)); } void BranchDialog::reset() diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 8997a388b5..ad8944a712 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -743,6 +743,9 @@ void GitClient::requestReload(const QString &documentId, const QString &source, const QString &title, std::function factory) const { + // Creating document might change the referenced source. Store a copy and use it. + const QString sourceCopy = source; + IDocument *document = DiffEditorController::findOrCreateDocument(documentId, title); QTC_ASSERT(document, return); DiffEditorController *controller = factory(document); @@ -753,7 +756,7 @@ void GitClient::requestReload(const QString &documentId, const QString &source, connect(controller, &DiffEditorController::requestInformationForCommit, this, &GitClient::branchesForCommit); - VcsBasePlugin::setSource(document, source); + VcsBasePlugin::setSource(document, sourceCopy); EditorManager::activateEditorForDocument(document); controller->requestReload(); } @@ -843,19 +846,21 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName, msgArg = args.first(); else msgArg = workingDirectory; + // Creating document might change the referenced workingDirectory. Store a copy and use it. + const QString workingDir = workingDirectory; const QString title = tr("Git Log \"%1\"").arg(msgArg); const Id editorId = Git::Constants::GIT_LOG_EDITOR_ID; - const QString sourceFile = VcsBaseEditor::getSource(workingDirectory, fileName); + const QString sourceFile = VcsBaseEditor::getSource(workingDir, fileName); VcsBaseEditorWidget *editor = createVcsEditor(editorId, title, sourceFile, codecFor(CodecLogOutput), "logTitle", msgArg); if (!editor->configurationWidget()) { auto *argWidget = new GitLogArgumentsWidget(settings()); connect(argWidget, &VcsBaseEditorParameterWidget::commandExecutionRequested, - [=]() { this->log(workingDirectory, fileName, enableAnnotationContextMenu, args); }); + [=]() { this->log(workingDir, fileName, enableAnnotationContextMenu, args); }); editor->setConfigurationWidget(argWidget); } editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu); - editor->setWorkingDirectory(workingDirectory); + editor->setWorkingDirectory(workingDir); QStringList arguments; arguments << QLatin1String("log") << QLatin1String(noColorOption) @@ -874,7 +879,7 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName, if (!fileName.isEmpty()) arguments << QLatin1String("--follow") << QLatin1String("--") << fileName; - vcsExec(workingDirectory, arguments, editor); + vcsExec(workingDir, arguments, editor); } void GitClient::reflog(const QString &workingDirectory) -- cgit v1.2.1 From f020edc28769f2d3c36502db7fd58e1798f22cc9 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Aug 2015 14:01:17 +0200 Subject: Debugger: Fix QJsonDumper with LLDB Change-Id: Ied299468a3f125540894278841114591cfecb02b Reviewed-by: Christian Stenger --- share/qtcreator/debugger/qttypes.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 7ab1d403be..41f515e542 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -2609,11 +2609,11 @@ def qdumpHelper__QJsonArray(d, data, array): array is passed as integer pointer to the QJsonPrivate::Base object. """ - if d.isNull(data): - n = 0 - else: + if data: # The 'length' part of the _dummy member: n = qdumpHelper_qle_cutBits(d.extractUInt(array + 4), 1, 31) + else: + n = 0 d.putItemCount(n) d.putNumChild(1) @@ -2634,11 +2634,11 @@ def qdumpHelper__QJsonObject(d, data, obj): obj is passed as integer pointer to the QJsonPrivate::Base object. """ - if d.isNull(data): - n = 0 - else: + if data: # The 'length' part of the _dummy member: n = qdumpHelper_qle_cutBits(d.extractUInt(obj + 4), 1, 31) + else: + n = 0 d.putItemCount(n) d.putNumChild(1) -- cgit v1.2.1 From 039d9309a9fe2cba055c5b51459c5d3526e4c2bb Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Wed, 12 Aug 2015 17:49:29 +0200 Subject: Clang: Ignore include dirs matching lib/clang/x.y/include On OS X the clang versioning is different. This completes 775661fafb04b712bc4c327dce3c5caf2184cf2b Clang: Ignore clang include directories from the toolchain Task-number: QTCREATORBUG-14856 Change-Id: Ib93ce9fcf18a3c8693f9f2af8075eeef8b93fa32 Reviewed-by: Marco Bubke --- src/plugins/clangcodemodel/clangutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index f0f68030fc..b249a695b0 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -154,7 +154,7 @@ private: // We already provide a custom clang include path matching the used libclang version, // so better ignore the clang include paths from the system as this might lead to an // unfavorable order with regard to include_next. - static QRegExp clangIncludeDir(QLatin1String(".*/lib/clang/\\d+\\.\\d+\\.\\d+/include")); + static QRegExp clangIncludeDir(QLatin1String(".*/lib/clang/\\d+\\.\\d+(\\.\\d+)?/include")); if (clangIncludeDir.exactMatch(path)) return true; -- cgit v1.2.1 From d98325f413d1548e500dd0d4d54b86a3db3cb358 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Aug 2015 14:30:17 +0200 Subject: Debugger: Make Locals views entries selectable for core files Task-number: QTCREATORBUG-14904 Change-Id: I3918979c5f7a5dd3e4fbe9e3c7444f622e26b3f3 Reviewed-by: Orgad Shaneh Reviewed-by: Niels Weber --- src/plugins/debugger/watchhandler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index eab2f7f8c6..ece9967732 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -933,6 +933,9 @@ Qt::ItemFlags WatchItem::flags(int column) const const Qt::ItemFlags notEditable = Qt::ItemIsSelectable | Qt::ItemIsEnabled; const Qt::ItemFlags editable = notEditable | Qt::ItemIsEditable; + if (state == InferiorUnrunnable) + return notEditable; + if (isWatcher()) { if (state != InferiorStopOk && state != DebuggerNotReady -- cgit v1.2.1 From 5531f73cf67cdee99c369d489d516b1928f18d6a Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 13 Aug 2015 09:22:44 +0200 Subject: Debugger: Disable L&E context submenu without useful contents Task-number: QTCREATORBUG-14578 Change-Id: I6bc3b69601d8330ca2b267424260d48dd489a7e7 Reviewed-by: Niels Weber --- src/plugins/debugger/watchwindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index add255f040..8bd2013dd3 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -751,6 +751,8 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev) QMenu formatMenu(tr("Change Local Display Format")); if (mi0.isValid()) fillFormatMenu(&formatMenu, mi0); + else + formatMenu.setEnabled(false); QMenu memoryMenu(tr("Open Memory Editor")); QAction actOpenMemoryEditAtObjectAddress(0); @@ -809,6 +811,9 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev) breakpointMenu.addAction(&actSetWatchpointAtObjectAddress); breakpointMenu.addAction(&actSetWatchpointAtPointerAddress); breakpointMenu.addAction(&actSetWatchpointAtExpression); + breakpointMenu.setEnabled(actSetWatchpointAtObjectAddress.isEnabled() + || actSetWatchpointAtPointerAddress.isEnabled() + || actSetWatchpointAtExpression.isEnabled()); QAction actCopy(tr("Copy View Contents to Clipboard"), 0); QAction actCopyValue(tr("Copy Value to Clipboard"), 0); -- cgit v1.2.1 From ef7a7a445be5f3fac9f91144f28ef6042e4eaf3e Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 12 Aug 2015 17:00:54 +0200 Subject: Debugger: Fix evaluated expressions containing quotes Task-number: QTCREATORBUG-14364 Change-Id: Ia1fc1f341dad56c495b356464951a771dfccc50b Reviewed-by: Niels Weber --- share/qtcreator/debugger/dumper.py | 1 - 1 file changed, 1 deletion(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 4ffdd7f0c7..2352a4b60b 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -1653,7 +1653,6 @@ class DumperBase: with TopLevelItem(self, iname): self.put('iname="%s",' % iname) - self.put('name="%s",' % exp) self.put('wname="%s",' % escapedExp) try: value = self.parseAndEvaluate(exp) -- cgit v1.2.1 From 019e618841a622d30432cdde1d353dc0632ca549 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 13 Aug 2015 11:48:42 +0200 Subject: Clang: Fix removing unsaved file We called delete[] on invalid data. Change-Id: I94147c80119e27b42c280fb527966602fc456f8b Reviewed-by: Marco Bubke --- src/tools/clangbackend/ipcsource/unsavedfiles.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tools/clangbackend/ipcsource/unsavedfiles.cpp b/src/tools/clangbackend/ipcsource/unsavedfiles.cpp index 609b3490ed..90f9e2c796 100644 --- a/src/tools/clangbackend/ipcsource/unsavedfiles.cpp +++ b/src/tools/clangbackend/ipcsource/unsavedfiles.cpp @@ -30,6 +30,7 @@ #include "unsavedfiles.h" +#include #include namespace ClangBackEnd { @@ -154,12 +155,12 @@ void UnsavedFiles::updateCXUnsavedFileWithFileContainer(const FileContainer &fil void UnsavedFiles::removeCXUnsavedFile(const FileContainer &fileContainer) { const Utf8String filePath = fileContainer.filePath(); - auto removeBeginIterator = std::remove_if(d->cxUnsavedFiles.begin(), + auto removeBeginIterator = std::partition(d->cxUnsavedFiles.begin(), d->cxUnsavedFiles.end(), - [filePath] (const CXUnsavedFile &cxUnsavedFile) { return filePath == cxUnsavedFile.Filename; }); + [filePath] (const CXUnsavedFile &cxUnsavedFile) { return filePath != cxUnsavedFile.Filename; }); std::for_each(removeBeginIterator, d->cxUnsavedFiles.end(), UnsavedFiles::deleteCXUnsavedFile); - d->cxUnsavedFiles.erase( removeBeginIterator, d->cxUnsavedFiles.end()); + d->cxUnsavedFiles.erase(removeBeginIterator, d->cxUnsavedFiles.end()); } void UnsavedFiles::addOrUpdateCXUnsavedFile(const FileContainer &fileContainer) @@ -182,6 +183,4 @@ void UnsavedFiles::updateLastChangeTimePoint() d->lastChangeTimePoint = std::chrono::steady_clock::now(); } - } // namespace ClangBackEnd - -- cgit v1.2.1 From 1b417fd78c1a7ee803cad61888fd7dc640ad0c58 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 13 Aug 2015 12:12:54 +0200 Subject: Debugger: Use qtHookData to extract Qt version when possible This avoids inferior calls, i.e. is faster and more robust. Task-number: QTCREATORBUG-14350 Change-Id: I9f21eda6e2e3950eaaca90a35afb885e76e789d8 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/gdbbridge.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 2a7cb77006..fb45f2ce86 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -811,6 +811,14 @@ class Dumper(DumperBase): return None def qtVersion(self): + try: + # Only available with Qt 5.3+ + qtversion = int(gdb.parse_and_eval("((void**)&qtHookData)[2]")) + self.qtVersion = lambda: qtversion + return qtversion + except: + pass + try: version = self.qtVersionString() (major, minor, patch) = version[version.find('"')+1:version.rfind('"')].split('.') -- cgit v1.2.1 From 76b5095687c6fddb501627af6ebdc002a49ae789 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 13 Aug 2015 11:53:50 +0200 Subject: Debugger: Also display subentries for pretty printed char arrays While the formatted value is usually all that's wanted, having access to the individual chars is handy at times. Change-Id: I53b0d0ccfe4289b9b54a1caced4e0bd5ac66d9fc Reviewed-by: Niels Weber --- share/qtcreator/debugger/dumper.py | 1 - tests/auto/debugger/tst_dumpers.cpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 2352a4b60b..d81c4d6527 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -587,7 +587,6 @@ class DumperBase: encodingType = Hex8EncodedLittleEndian displayType = DisplayUtf16String - self.putNumChild(0) self.putValue(mem, encodingType, elided=elided) if displayFormat == SeparateLatin1StringFormat \ diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 302f6f9857..1198c70052 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -4613,7 +4613,9 @@ void tst_Dumpers::dumper_data() "unused(&s, &t, &w);\n") + CheckType("s", "char [5]") + + Check("s.0", "[0]", "97", "char") + CheckType("t", "char [6]") + + Check("t.0", "[0]", "97", "char") + CheckType("w", "wchar_t [4]"); -- cgit v1.2.1 From 5e5533765295232a7ed156962e97b3b9e16e69b3 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 14 Aug 2015 12:01:06 +0200 Subject: Update qbs submodule. To HEAD of 1.4 branch. Change-Id: I7177e3dc23941a2bc5d62329a00e232c633fc331 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 bca958c3f5..0abd1f7b72 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit bca958c3f55ca73b7cc9cf09317b192a2dec1bc5 +Subproject commit 0abd1f7b723335df7a24da3e5194f8050dc635b8 -- cgit v1.2.1 From 63d182f052b75b3b7e46a07d63811002e1acd921 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 13 Aug 2015 15:29:14 +0200 Subject: Debugger: Fix retrieval of Locals Views subitems in QML debugger Previously, only the first level of properties was expanded, properties of object type could not be expanded further. This can be reproduced by opening the SameGame example, putting and triggering a breakpoint at startNewGame(), expanding the 'this' entry in the Locals view and checking the 'component' subentry. Change-Id: I6cf714af697ab4eebd7eb0ae0ea37e516b3ea635 Reviewed-by: Robert Loehning Reviewed-by: Ulf Hermann --- src/plugins/debugger/qml/qmlengine.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index f8dcc2372c..11464f3198 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -2353,6 +2353,8 @@ ConsoleItem *QmlEnginePrivate::constructLogItemTree(ConsoleItem *parent, void QmlEnginePrivate::insertSubItems(WatchItem *parent, const QVariantList &properties) { QTC_ASSERT(parent, return); + LookupItems itemsToLookup; + foreach (const QVariant &property, properties) { QmlV8ObjectData propertyData = extractData(property); auto item = new WatchItem; @@ -2374,15 +2376,20 @@ void QmlEnginePrivate::insertSubItems(WatchItem *parent, const QVariantList &pro item->id = propertyData.handle; item->type = propertyData.type; item->value = propertyData.value.toString(); - item->setHasChildren(propertyData.properties.count()); + if (item->type.isEmpty()) + itemsToLookup.insert(propertyData.handle, {item->iname, item->name}); + item->setHasChildren(propertyData.properties.count() > 0); parent->appendChild(item); } - if (boolSetting(SortStructMembers)) + if (boolSetting(SortStructMembers)) { parent->sortChildren([](const TreeItem *item1, const TreeItem *item2) -> bool { return static_cast(item1)->name - < static_cast(item2)->name; + < static_cast(item2)->name; }); + } + + lookup(itemsToLookup); } void QmlEnginePrivate::handleExecuteDebuggerCommand(const QVariantMap &response) -- cgit v1.2.1 From b5dcc8650401a6c706c511609ec11b5d2d3f8863 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 14 Aug 2015 17:42:40 +0200 Subject: Debugger: Fix use of bare metal startup with Step Into/Step Over Starting with F11 and F10 should start with break on main. To know about the breakpoint, the RunMode parameter needs to be passed. Change-Id: I0afe9aeb51bccf24aa85d852f5f39f39d9c14db9 Reviewed-by: Christian Stenger --- src/plugins/baremetal/baremetalruncontrolfactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/baremetal/baremetalruncontrolfactory.cpp b/src/plugins/baremetal/baremetalruncontrolfactory.cpp index 8a4cb36278..4221465923 100644 --- a/src/plugins/baremetal/baremetalruncontrolfactory.cpp +++ b/src/plugins/baremetal/baremetalruncontrolfactory.cpp @@ -146,7 +146,7 @@ RunControl *BareMetalRunControlFactory::create( if (p->startupMode() == GdbServerProvider::StartupOnNetwork) sp.remoteSetupNeeded = true; - DebuggerRunControl *runControl = createDebuggerRunControl(sp, rc, errorMessage); + DebuggerRunControl *runControl = createDebuggerRunControl(sp, rc, errorMessage, mode); if (runControl && sp.remoteSetupNeeded) { const auto debugSupport = new BareMetalDebugSupport(dev, runControl); Q_UNUSED(debugSupport); -- cgit v1.2.1 From 2bc96c76211138c544e81d448e357923cb914f43 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Fri, 14 Aug 2015 16:56:18 +0200 Subject: Clang: Fix threading issue with QRegExp exactMatch() is declared const, but is actually not. Replace with QRegularExpression. Change-Id: Ib9d9c091de1cd81d81671c19a76cada8777ff287 Reviewed-by: Orgad Shaneh --- src/plugins/clangcodemodel/clangutils.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index b249a695b0..9ceb6a208d 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include @@ -154,8 +154,9 @@ private: // We already provide a custom clang include path matching the used libclang version, // so better ignore the clang include paths from the system as this might lead to an // unfavorable order with regard to include_next. - static QRegExp clangIncludeDir(QLatin1String(".*/lib/clang/\\d+\\.\\d+(\\.\\d+)?/include")); - if (clangIncludeDir.exactMatch(path)) + static QRegularExpression clangIncludeDir( + QLatin1String("\\A.*/lib/clang/\\d+\\.\\d+(\\.\\d+)?/include\\z")); + if (clangIncludeDir.match(path).hasMatch()) return true; return false; -- cgit v1.2.1 From e6b2426b897ca6b54fc068c2343ee57afe319fb4 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 14 Aug 2015 09:47:55 +0200 Subject: Debugger: Prevent editing of elided items in Locals view For a long string, only the parts needed to fill the Value column is retrieved. Trying to edit (double click on Value entry) this resulted in truncation of the string. Change-Id: I1e993bfe52cee933bd32c866448eedc788807bd3 Reviewed-by: Niels Weber --- src/plugins/debugger/watchhandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index ece9967732..a5c6a414d6 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -949,13 +949,13 @@ Qt::ItemFlags WatchItem::flags(int column) const // FIXME: Forcing types is not implemented yet. //if (idx.column() == 2) // return editable; // Watcher types can be set by force. - if (column == 1 && valueEditable) + if (column == 1 && valueEditable && !elided) return editable; // Watcher values are sometimes editable. } } else if (isLocal()) { if (state != InferiorStopOk && !engine->hasCapability(AddWatcherWhileRunningCapability)) return Qt::ItemFlags(); - if (column == 1 && valueEditable) + if (column == 1 && valueEditable && !elided) return editable; // Locals values are sometimes editable. } else if (isInspect()) { if (column == 1 && valueEditable) -- cgit v1.2.1 From 4f50aa74d61a2c080905f859fb9154a1ac098c82 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 14 Aug 2015 17:34:27 +0200 Subject: Debugger: Fix use of remote Linux startup with Step Into/Step Over Starting with F11 and F10 should start with break on main. To know about the breakpoint, the RunMode parameter needs to be passed. Change-Id: I3219ee60f187f824476a1a8651e56334da021069 Reviewed-by: Christian Kandeler --- src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp index 3053e39027..53c4647f05 100644 --- a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp +++ b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp @@ -106,7 +106,7 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Co } DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc); - DebuggerRunControl * const runControl = createDebuggerRunControl(params, runConfig, errorMessage); + DebuggerRunControl * const runControl = createDebuggerRunControl(params, runConfig, errorMessage, mode); if (!runControl) return 0; LinuxDeviceDebugSupport * const debugSupport = -- cgit v1.2.1 From 537eb2f159cd894d3f2dde4261ade44e9c0ac3d8 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 12 Aug 2015 11:12:50 +0200 Subject: Cdbext: Do not sort container children. They are already sorted in an intended order. Task-number: QTCREATORBUG-14872 Change-Id: If28d41eb220cb875fa5ef25f0fab075329900bff Reviewed-by: Friedemann Kleint --- src/libs/qtcreatorcdbext/containers.cpp | 1 + src/libs/qtcreatorcdbext/symbolgroupnode.cpp | 2 +- src/libs/qtcreatorcdbext/symbolgroupnode.h | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/qtcreatorcdbext/containers.cpp b/src/libs/qtcreatorcdbext/containers.cpp index f2cde38d4d..ed7d13d837 100644 --- a/src/libs/qtcreatorcdbext/containers.cpp +++ b/src/libs/qtcreatorcdbext/containers.cpp @@ -1104,6 +1104,7 @@ AbstractSymbolGroupNodePtrVector containerChildren(SymbolGroupNode *node, int ty } if (!size) return AbstractSymbolGroupNodePtrVector(); + node->addFlags(SymbolGroupNode::PreSortedChildren); const unsigned maxArraySize = ExtensionContext::instance().parameters().maxArraySize; if (size > maxArraySize) size = maxArraySize; diff --git a/src/libs/qtcreatorcdbext/symbolgroupnode.cpp b/src/libs/qtcreatorcdbext/symbolgroupnode.cpp index 6f3e902a89..a4f39dd41f 100644 --- a/src/libs/qtcreatorcdbext/symbolgroupnode.cpp +++ b/src/libs/qtcreatorcdbext/symbolgroupnode.cpp @@ -168,7 +168,7 @@ bool AbstractSymbolGroupNode::accept(SymbolGroupNodeVisitor &visitor, break; case SymbolGroupNodeVisitor::VisitContinue: { AbstractSymbolGroupNodePtrVector c = children(); - if (visitor.sortChildrenAlphabetically()) { + if (visitor.sortChildrenAlphabetically() && !testFlags(SymbolGroupNode::PreSortedChildren)) { std::sort(c.begin(), c.end(), [](AbstractSymbolGroupNode *a, AbstractSymbolGroupNode *b) { return a->name() < b->name(); }); diff --git a/src/libs/qtcreatorcdbext/symbolgroupnode.h b/src/libs/qtcreatorcdbext/symbolgroupnode.h index 3fbbedd7ea..9d49869dba 100644 --- a/src/libs/qtcreatorcdbext/symbolgroupnode.h +++ b/src/libs/qtcreatorcdbext/symbolgroupnode.h @@ -230,7 +230,8 @@ public: AdditionalSymbol = 0x20, // Introduced by addSymbol, should not be visible Obscured = 0x40, // Symbol is obscured by (for example) fake container children ComplexDumperOk = 0x80, - WatchNode = 0x100 + WatchNode = 0x100, + PreSortedChildren = 0x200 }; ~SymbolGroupNode(); -- cgit v1.2.1 From d8662f7a5a99ca911b29db7dbf5f43354b2b61e2 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 Aug 2015 15:08:54 +0200 Subject: Windows: Fix that installer does not propose a start menu folder Change-Id: If1eeb38d2a023d5eb9b69ff85fefb992480c20f4 Task-number: QTCREATORBUG-14857 Reviewed-by: Kai Koehne --- .../ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in index 682fd720b9..32089ef2bb 100644 --- a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in +++ b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in @@ -17,4 +17,5 @@ associatecommonfiletypesform.ui launchqtcreatorcheckboxform.ui + Qt Creator {version} -- cgit v1.2.1 From 169a224ec7ad1a43f577d04b0c8174b4b78c96bb Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 13 Aug 2015 12:37:42 +0200 Subject: Debugger: Use "unused" variables in autotests Change-Id: I89872cd7792aed5e23331af4ae683dffa3c1291d Reviewed-by: Niels Weber --- tests/auto/debugger/tst_dumpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 1198c70052..4e86a343db 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -1857,7 +1857,7 @@ void tst_Dumpers::dumper_data() "pain.drawLine(2, 2, 130, 130);\n" "pain.end();\n" "QPixmap pm = QPixmap::fromImage(im);\n" - "unused(&pm);\n") + "unused(&app, &pm);\n") + GuiProfile() @@ -5814,7 +5814,7 @@ void tst_Dumpers::dumper_data() "pol.append(QPointF(2, 4));\n" "pol.append(QPointF(1, 4));\n" "QGraphicsPolygonItem *p = sc.addPolygon(pol);\n" - "unused(&p);\n") + "unused(&app, &p);\n") + GuiProfile() + Check("pol", "<5 items>", "@QPolygonF") + Check("p", "<5 items>", "@QGraphicsPolygonItem"); -- cgit v1.2.1 From bf6e9f05502bb8711a3787ac04f82f4bfb3e4559 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 17 Aug 2015 23:09:21 +0300 Subject: Fix tests build with GCC 5 Change-Id: Ia2e0a1c69f73446b45915559294e3348e725ce56 Reviewed-by: hjk --- tests/auto/debugger/offsets.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/debugger/offsets.pro b/tests/auto/debugger/offsets.pro index f3eef5c31a..b021596f0e 100644 --- a/tests/auto/debugger/offsets.pro +++ b/tests/auto/debugger/offsets.pro @@ -3,6 +3,8 @@ include(../qttest.pri) QT += core-private +CONFIG -= c++11 # Fails to build with boost (due to #define private public) + exists(/usr/include/boost/unordered/unordered_set.hpp) { DEFINES += HAS_BOOST } -- cgit v1.2.1 From 45778539d8424a8556ce074020b992a248d6455f Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 18 Aug 2015 10:46:57 +0200 Subject: CppEditor: Fix crash with invalid switch/case statement Task-number: QTCREATORBUG-14925 Change-Id: Iea2cf17070d9db48924e76f6c7febca0d52e4686 Reviewed-by: Marco Bubke Reviewed-by: Orgad Shaneh --- src/plugins/cppeditor/cppquickfix_test.cpp | 15 +++++++++++++++ src/plugins/cppeditor/cppquickfixes.cpp | 12 +++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index cbc04f6a67..962afeddd0 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -514,6 +514,21 @@ void CppEditorPlugin::test_quickfix_data() "}\n" ); + // Checks: Do not crash on incomplete case statetement. + QTest::newRow("CompleteSwitchCaseStatement_doNotCrashOnIncompleteCase") + << CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _( + "enum E {};\n" + "void f(E o)\n" + "{\n" + " @switch (o)\n" + " {\n" + " case\n" + " }\n" + "}\n" + ) << _( + "" + ); + // Checks: // 1. If the name does not start with ("m_" or "_") and does not // end with "_", we are forced to prefix the getter with "get". diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 736638ef92..28d711cf8e 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -2212,11 +2212,13 @@ public: bool preVisit(AST *ast) { if (CaseStatementAST *cs = ast->asCaseStatement()) { foundCaseStatementLevel = true; - if (ExpressionAST *expression = cs->expression->asIdExpression()) { - QList candidates = typeOfExpression(expression, document, scope); - if (!candidates .isEmpty() && candidates.first().declaration()) { - Symbol *decl = candidates.first().declaration(); - values << prettyPrint.prettyName(LookupContext::fullyQualifiedName(decl)); + if (ExpressionAST *csExpression = cs->expression) { + if (ExpressionAST *expression = csExpression->asIdExpression()) { + QList candidates = typeOfExpression(expression, document, scope); + if (!candidates .isEmpty() && candidates.first().declaration()) { + Symbol *decl = candidates.first().declaration(); + values << prettyPrint.prettyName(LookupContext::fullyQualifiedName(decl)); + } } } return true; -- cgit v1.2.1 From 9d6a291d5c8af3cfbac2447d41b3330e60c8b7b4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 17 Aug 2015 14:45:11 +0200 Subject: Sqlite: Add missing includes. Change-Id: I5f458f297c8bb1b4cd33655ffe30129c04f6b562 Reviewed-by: Nikolai Kosjar --- src/libs/sqlite/sqlitedatabaseconnection.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/sqlite/sqlitedatabaseconnection.cpp b/src/libs/sqlite/sqlitedatabaseconnection.cpp index a73d2c105e..c973c2584c 100644 --- a/src/libs/sqlite/sqlitedatabaseconnection.cpp +++ b/src/libs/sqlite/sqlitedatabaseconnection.cpp @@ -38,6 +38,8 @@ #include #ifdef Q_OS_LINUX +#include +#include #include #include #include -- cgit v1.2.1 From f1b9f56c6975b1e641e342c5190c6ad322541bfe Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 18 Aug 2015 11:54:41 +0200 Subject: CppEditor: Fix whitespace Change-Id: I5b1f9268e2bc37344fba2ffec6098ae787cb327f Reviewed-by: Nikolai Kosjar --- src/plugins/cppeditor/cppquickfixes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 28d711cf8e..ff1c151afb 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -2215,7 +2215,7 @@ public: if (ExpressionAST *csExpression = cs->expression) { if (ExpressionAST *expression = csExpression->asIdExpression()) { QList candidates = typeOfExpression(expression, document, scope); - if (!candidates .isEmpty() && candidates.first().declaration()) { + if (!candidates.isEmpty() && candidates.first().declaration()) { Symbol *decl = candidates.first().declaration(); values << prettyPrint.prettyName(LookupContext::fullyQualifiedName(decl)); } -- cgit v1.2.1 From cb32ffff855e2cc2ed14e20a59b396a65470e391 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 19 Aug 2015 10:40:05 +0200 Subject: QmlDebug: Check if packet protocol is still alive after flush() An QAbstractSocket can disconnect itself on flush(), which we call after sending any packets. This leads to the packet protocol getting deleted and in the next iteration of the loop QmlDebugConnectionPrivate::readyRead() we'd use a null pointer. Prevent that by checking for null. Change-Id: Idfdb68a10c3e4deee7b305ff3b028247809090a6 Reviewed-by: hjk --- src/libs/qmldebug/qmldebugclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/qmldebug/qmldebugclient.cpp b/src/libs/qmldebug/qmldebugclient.cpp index d0f4782eb2..2f5b7976cd 100644 --- a/src/libs/qmldebug/qmldebugclient.cpp +++ b/src/libs/qmldebug/qmldebugclient.cpp @@ -191,7 +191,7 @@ void QmlDebugConnectionPrivate::readyRead() emit q->opened(); } - while (protocol->packetsAvailable()) { + while (protocol && protocol->packetsAvailable()) { QPacket pack = protocol->read(); QString name; pack >> name; -- cgit v1.2.1 From 1f445f8fd62b18a1a2b4c9158ae4e030a143a0ea Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Aug 2015 11:27:31 +0200 Subject: Abi::hostAbi(): Add MSVC2015. Silence startup warning: Unable to completely determine the host ABI (x86-windows-unknown-pe-64bit). Change-Id: I89aae738d25d7c97f352172c98628ddd0987d6dc Reviewed-by: Daniel Teske Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/abi.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index b604a6bec9..e5c79f20e9 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -752,7 +752,9 @@ Abi Abi::hostAbi() #if defined (Q_OS_WIN) os = WindowsOS; -#if _MSC_VER == 1800 +#if _MSC_VER == 1900 + subos = WindowsMsvc2015Flavor; +#elif _MSC_VER == 1800 subos = WindowsMsvc2013Flavor; #elif _MSC_VER == 1700 subos = WindowsMsvc2012Flavor; -- cgit v1.2.1 From 53e1c84f50f62d0509704f3d9f3719e56555c237 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 13 Aug 2015 16:36:11 +0300 Subject: ProjectExplorer: Support ABI triplet of MSYS2 (x86_64-pc-msys) Change-Id: If041b729d621a3119d84d2978b6d9adce2e4034b Reviewed-by: Eike Ziller Reviewed-by: Daniel Teske --- src/plugins/projectexplorer/abi.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index e5c79f20e9..3842f7fb32 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -512,7 +512,8 @@ Abi Abi::abiFromTargetTriplet(const QString &triple) if (flavor == Abi::UnknownFlavor) flavor = Abi::FreeBsdFlavor; format = Abi::ElfFormat; - } else if (p == QLatin1String("mingw32") || p == QLatin1String("win32") || p == QLatin1String("mingw32msvc")) { + } else if (p == QLatin1String("mingw32") || p == QLatin1String("win32") + || p == QLatin1String("mingw32msvc") || p == QLatin1String("msys")) { arch = Abi::X86Architecture; os = Abi::WindowsOS; flavor = Abi::WindowsMSysFlavor; @@ -1077,6 +1078,10 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet_data() << int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor) << int(Abi::PEFormat) << 0; + QTest::newRow("x86_64-pc-msys") << int(Abi::X86Architecture) + << int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor) + << int(Abi::PEFormat) << 64; + QTest::newRow("mingw32") << int(Abi::X86Architecture) << int(Abi::WindowsOS) << int(Abi::WindowsMSysFlavor) << int(Abi::PEFormat) << 0; -- cgit v1.2.1 From 78e88712075789834822a22d3c0778ba3389c5f0 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 17 Aug 2015 16:51:55 +0200 Subject: QML/JS: Fix that warnings about editing .ui.qml files accumulated Splitting the editor would add the warning again. Since the warning is a document property, handle it in the document instead of the widgets. Change-Id: Ie20377b05dee14983f7ff46ba04ed2af2b737c96 Task-number: QTCREATORBUG-14923 Reviewed-by: Marco Benelli Reviewed-by: Thomas Hartmann --- src/plugins/qmljseditor/qmljseditor.cpp | 12 ------------ src/plugins/qmljseditor/qmljseditor.h | 2 -- src/plugins/qmljseditor/qmljseditordocument.cpp | 17 +++++++++++++++++ src/plugins/qmljseditor/qmljseditordocument_p.h | 1 + 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 13a85a8c5f..a926efc45c 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -58,7 +58,6 @@ #include #include #include -#include #include #include @@ -112,7 +111,6 @@ QmlJSEditorWidget::QmlJSEditorWidget() { m_outlineCombo = 0; m_contextPane = 0; - m_firstSementicInfo = true; m_findReferences = new FindReferences(this); setLanguageSettingsId(QmlJSTools::Constants::QML_JS_SETTINGS_ID); @@ -949,16 +947,6 @@ void QmlJSEditorWidget::semanticInfoUpdated(const SemanticInfo &semanticInfo) } } - if (m_firstSementicInfo) { - m_firstSementicInfo = false; - if (semanticInfo.document->language() == Dialect::QmlQtQuick2Ui) { - InfoBarEntry info(Id(Constants::QML_UI_FILE_WARNING), - tr("This file should only be edited in Design mode.")); - info.setCustomButtonInfo(tr("Switch Mode"), []() { ModeManager::activateMode(Core::Constants::MODE_DESIGN); }); - textDocument()->infoBar()->addInfo(info); - } - } - updateUses(); } diff --git a/src/plugins/qmljseditor/qmljseditor.h b/src/plugins/qmljseditor/qmljseditor.h index b27029cd17..5701d823f1 100644 --- a/src/plugins/qmljseditor/qmljseditor.h +++ b/src/plugins/qmljseditor/qmljseditor.h @@ -139,8 +139,6 @@ private: int m_oldCursorPosition; FindReferences *m_findReferences; - - bool m_firstSementicInfo; }; diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index cf81dd9a4f..5452de327e 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -37,6 +37,10 @@ #include "qmljssemanticinfoupdater.h" #include "qmloutlinemodel.h" +#include +#include +#include + #include #include #include @@ -520,6 +524,19 @@ void QmlJSEditorDocumentPrivate::acceptNewSemanticInfo(const SemanticInfo &seman m_outlineModelNeedsUpdate = true; m_semanticHighlightingNecessary = true; + if (m_firstSementicInfo) { + m_firstSementicInfo = false; + if (semanticInfo.document->language() == Dialect::QmlQtQuick2Ui + && !q->infoBar()->containsInfo(Core::Id(Constants::QML_UI_FILE_WARNING))) { + Core::InfoBarEntry info(Core::Id(Constants::QML_UI_FILE_WARNING), + tr("This file should only be edited in Design mode.")); + info.setCustomButtonInfo(tr("Switch Mode"), []() { + Core::ModeManager::activateMode(Core::Constants::MODE_DESIGN); + }); + q->infoBar()->addInfo(info); + } + } + emit q->semanticInfoUpdated(m_semanticInfo); // calls triggerPendingUpdates as necessary } diff --git a/src/plugins/qmljseditor/qmljseditordocument_p.h b/src/plugins/qmljseditor/qmljseditordocument_p.h index d3c41d93ef..174578a0b3 100644 --- a/src/plugins/qmljseditor/qmljseditordocument_p.h +++ b/src/plugins/qmljseditor/qmljseditordocument_p.h @@ -75,6 +75,7 @@ public: Internal::SemanticHighlighter *m_semanticHighlighter; bool m_semanticHighlightingNecessary; bool m_outlineModelNeedsUpdate; + bool m_firstSementicInfo = true; QTimer m_updateOutlineModelTimer; Internal::QmlOutlineModel *m_outlineModel; }; -- cgit v1.2.1 From 6d77db9e6a0ef1080c7880fe852fec103bc75642 Mon Sep 17 00:00:00 2001 From: Anton Kreuzkamp Date: Tue, 18 Aug 2015 15:52:57 +0200 Subject: Add info about debuggee to params in remotelinux. Extends RemoteLinuxAnalyzeSupport to add information about debuggee, debuggee arguments, working directory and environment to the AnalyzerStartParameters. This is required when starting the project from an analyzer plugin using remotelinux. Change-Id: I29cbeb1b22b193a2d815924282887a980c506ca0 Reviewed-by: Christian Kandeler --- src/plugins/remotelinux/remotelinuxanalyzesupport.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp index a7316280e9..ddcbbff575 100644 --- a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp +++ b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp @@ -42,6 +42,7 @@ #include #include +#include #include #include @@ -84,6 +85,14 @@ AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const RunConf params.sysroot = SysRootKitInformation::sysRoot(runConfig->target()->kit()).toString(); params.analyzerHost = params.connParams.host; + auto rc = qobject_cast(runConfig); + QTC_ASSERT(rc, return params); + + params.debuggee = rc->remoteExecutableFilePath(); + params.debuggeeArgs = Utils::QtcProcess::Arguments::createUnixArgs(rc->arguments()).toString(); + params.workingDirectory = rc->workingDirectory(); + params.environment = rc->environment(); + return params; } -- cgit v1.2.1 From de3b2b6493c810380e961bb8b36b805a505b55b7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Aug 2015 09:54:26 +0200 Subject: Limit legacy Highdpi tweaks to Qt versions < 5.6. As of Qt 5.6, Qt will scale automatically. The font hinting issues on non-Windows OS should also be fixed. This silences the warning about using the legacy QT_DEVICE_PIXEL_RATIO variable. Change-Id: Icc78d990fae67bbd39a57fa1f5b08c592dc9e2ce Reviewed-by: Eike Ziller --- src/app/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/main.cpp b/src/app/main.cpp index d2fa179bdd..3e9a523823 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -292,10 +292,13 @@ static inline QSettings *userSettings() int main(int argc, char **argv) { +#if (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) if (Utils::HostOsInfo().isWindowsHost() && !qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO")) { qputenv("QT_DEVICE_PIXEL_RATIO", "auto"); } +#endif // < Qt 5.6 + QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false")); #ifdef Q_OS_MAC // increase the number of file that can be opened in Qt Creator. -- cgit v1.2.1 From cf277acb4fc932d3742bf7fb0ac6bb117ade58c0 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 19 Aug 2015 16:49:08 +0300 Subject: BareMetal: Refresh provider list on host change Change-Id: Id3023a649d5d80fef71cadd53167caa22d01c2c9 Reviewed-by: hjk --- src/plugins/baremetal/defaultgdbserverprovider.cpp | 27 ++++++++++++++++++++-- src/plugins/baremetal/defaultgdbserverprovider.h | 6 +++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/plugins/baremetal/defaultgdbserverprovider.cpp b/src/plugins/baremetal/defaultgdbserverprovider.cpp index e76b3b60ef..8b1f3ef029 100644 --- a/src/plugins/baremetal/defaultgdbserverprovider.cpp +++ b/src/plugins/baremetal/defaultgdbserverprovider.cpp @@ -59,6 +59,29 @@ DefaultGdbServerProvider::DefaultGdbServerProvider(const DefaultGdbServerProvide { } +quint16 DefaultGdbServerProvider::port() const +{ + return m_port; +} + +void DefaultGdbServerProvider::setPort(const quint16 &port) +{ + m_port = port; +} + +QString DefaultGdbServerProvider::host() const +{ + return m_host; +} + +void DefaultGdbServerProvider::setHost(const QString &host) +{ + if (m_host == host) + return; + m_host = host; + providerUpdated(); +} + QString DefaultGdbServerProvider::typeDisplayName() const { return DefaultGdbServerProviderFactory::tr("Default"); @@ -183,8 +206,8 @@ void DefaultGdbServerProviderConfigWidget::applyImpl() auto p = static_cast(provider()); Q_ASSERT(p); - p->m_host = m_hostWidget->host(); - p->m_port = m_hostWidget->port(); + p->setHost(m_hostWidget->host()); + p->setPort(m_hostWidget->port()); p->setInitCommands(m_initCommandsTextEdit->toPlainText()); p->setResetCommands(m_resetCommandsTextEdit->toPlainText()); } diff --git a/src/plugins/baremetal/defaultgdbserverprovider.h b/src/plugins/baremetal/defaultgdbserverprovider.h index 53379d4409..f3a13be169 100644 --- a/src/plugins/baremetal/defaultgdbserverprovider.h +++ b/src/plugins/baremetal/defaultgdbserverprovider.h @@ -56,6 +56,12 @@ public: bool isValid() const; + QString host() const; + void setHost(const QString &host); + + quint16 port() const; + void setPort(const quint16 &port); + private: explicit DefaultGdbServerProvider(); explicit DefaultGdbServerProvider(const DefaultGdbServerProvider &); -- cgit v1.2.1 From 0173c638537e9a53a439ec4be5a9ab7b10a27a79 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 19 Aug 2015 16:33:25 +0200 Subject: SSH: Use "none" authentication type in case of an empty password. The "password" type as used until now should also be okay, but does not work with dropbear. Task-number: QTCREATORBUG-14913 Change-Id: I2fac255acf326e509f68c9de97c3cc9f00b2a373 Reviewed-by: hjk --- src/libs/ssh/sshoutgoingpacket.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libs/ssh/sshoutgoingpacket.cpp b/src/libs/ssh/sshoutgoingpacket.cpp index 7a4a66f853..dc3b916f2f 100644 --- a/src/libs/ssh/sshoutgoingpacket.cpp +++ b/src/libs/ssh/sshoutgoingpacket.cpp @@ -112,9 +112,12 @@ void SshOutgoingPacket::generateServiceRequest(const QByteArray &service) void SshOutgoingPacket::generateUserAuthByPasswordRequestPacket(const QByteArray &user, const QByteArray &service, const QByteArray &pwd) { - init(SSH_MSG_USERAUTH_REQUEST).appendString(user).appendString(service) - .appendString("password").appendBool(false).appendString(pwd) - .finalize(); + init(SSH_MSG_USERAUTH_REQUEST).appendString(user).appendString(service); + if (pwd.isEmpty()) + appendString("none"); // RFC 4252, 5.2 + else + appendString("password").appendBool(false).appendString(pwd); + finalize(); } void SshOutgoingPacket::generateUserAuthByPublicKeyRequestPacket(const QByteArray &user, -- cgit v1.2.1