From 9b25ab5329acf4c5ef1d824f4726909269f67e89 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 7 Sep 2023 13:21:06 +0200 Subject: [PATCH 1/5] CppEditor: Fix removal of "foreign" clang include directories The version number does not necessarily contain all version parts anymore. See also 628babb5cb2c9170946b9f0de6c16005f7e39fa7. Fixes: QTCREATORBUG-29571 Change-Id: I71fec628c54b430cf2fe0fe54f4f309a2f811043 Reviewed-by: Christian Stenger --- src/plugins/cppeditor/compileroptionsbuilder_test.cpp | 2 ++ src/plugins/cppeditor/headerpathfilter.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/compileroptionsbuilder_test.cpp b/src/plugins/cppeditor/compileroptionsbuilder_test.cpp index b09a8061fc7..8e142fcc86e 100644 --- a/src/plugins/cppeditor/compileroptionsbuilder_test.cpp +++ b/src/plugins/cppeditor/compileroptionsbuilder_test.cpp @@ -281,6 +281,8 @@ void CompilerOptionsBuilderTest::testClangHeadersAndCppIncludePathsOrderLinux() t.builtIn("/usr/local/include"), t.builtIn("/usr/lib/gcc/x86_64-linux-gnu/4.8/include"), t.builtIn("/usr/include/x86_64-linux-gnu"), + t.builtIn("/usr/lib64/clang/16/include"), + t.builtIn("/usr/lib/clang/15.0.7/include"), t.builtIn("/usr/include")}; CompilerOptionsBuilder compilerOptionsBuilder(t.finalize(), UseSystemHeader::No, UseTweakedHeaderPaths::Yes, UseLanguageDefines::No, UseBuildSystemWarnings::No, diff --git a/src/plugins/cppeditor/headerpathfilter.cpp b/src/plugins/cppeditor/headerpathfilter.cpp index 4def05060c1..bc1625643f4 100644 --- a/src/plugins/cppeditor/headerpathfilter.cpp +++ b/src/plugins/cppeditor/headerpathfilter.cpp @@ -104,7 +104,7 @@ bool isClangSystemHeaderPath(const HeaderPath &headerPath) // For example GCC on macOS uses system clang include path which makes clang code model // include incorrect system headers. static const QRegularExpression clangIncludeDir( - R"(\A.*/lib\d*/clang/\d+\.\d+(\.\d+)?/include\z)"); + R"(\A.*/lib\d*/clang/\d+(\.\d+){0,2}/include\z)"); return clangIncludeDir.match(headerPath.path).hasMatch(); } From 7986776f58d038359a7d36585c9dd44191c4069a Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Wed, 6 Sep 2023 08:38:12 +0200 Subject: [PATCH 2/5] Terminal: Fix incorrect signal connection The "process" exiting does not necessarily correspond to the stub exiting. As an example, on linux, gnome-terminal will immediately spawn a new process for the new terminal window and exit itself. The stub will then simply run in the detached terminal window. Fixes: QTCREATORBUG-29488 Change-Id: Ifac0795495901b80638bd10d720b036c09f0146c Reviewed-by: Christian Stenger --- src/libs/utils/externalterminalprocessimpl.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libs/utils/externalterminalprocessimpl.cpp b/src/libs/utils/externalterminalprocessimpl.cpp index 9ac01a7ee74..5cff874eb76 100644 --- a/src/libs/utils/externalterminalprocessimpl.cpp +++ b/src/libs/utils/externalterminalprocessimpl.cpp @@ -111,8 +111,6 @@ expected_str ProcessStubCreator::startStubProcess(const ProcessSetupData if (detached) QObject::connect(process, &Process::done, process, &Process::deleteLater); - QObject::connect(process, &Process::done, m_interface, &TerminalInterface::onStubExited); - process->setWorkingDirectory(setupData.m_workingDirectory); if constexpr (HostOsInfo::isWindowsHost()) { From 6defd083efb1b324903740926e0d54d195c5e429 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 7 Sep 2023 14:51:01 +0200 Subject: [PATCH 3/5] CtfVisualizer: Never crash with uncaught exception when loading JSON If we retrieve a value of a type that doesn't match the actual type in the JSON, the JSON library throws an exception. We should have checks to avoid this, but as a global measure never let exceptions through to Qt Creator. Change-Id: Ibfe830d745a94810f874ccca82b83d57ea72f31e Reviewed-by: Ulf Hermann Reviewed-by: --- src/plugins/ctfvisualizer/ctfvisualizertool.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp index 05cf55d729f..9ec24b5a337 100644 --- a/src/plugins/ctfvisualizer/ctfvisualizertool.cpp +++ b/src/plugins/ctfvisualizer/ctfvisualizertool.cpp @@ -162,8 +162,11 @@ void CtfVisualizerTool::loadJson() auto *task = new QFuture(futureInterface); QThread *thread = QThread::create([this, filename, futureInterface]() { - m_traceManager->load(filename); - + try { + m_traceManager->load(filename); + } catch (...) { + // nlohmann::json can throw exceptions when requesting type that is wrong + } m_modelAggregator->moveToThread(QApplication::instance()->thread()); m_modelAggregator->setParent(this); futureInterface->reportFinished(); From 05b6678d5685a9f1c5fffcf057a170468d88a29c Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 8 Sep 2023 08:43:05 +0200 Subject: [PATCH 4/5] Debugger: Fix gdb debugging without terminal Amends 373886bc21926e77803110765d90a339b57d3af2. Change-Id: I200391d702dc447508b52a9a3f210d08626b1bbf Reviewed-by: Christian Stenger Reviewed-by: Marcus Tillmanns Reviewed-by: hjk --- src/plugins/debugger/gdb/gdbengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 49d28c46fdc..8b36ef539e6 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1450,7 +1450,7 @@ void GdbEngine::handleStop2(const GdbMi &data) void GdbEngine::handleStop3() { - if (terminal() && state() != InferiorRunOk) { + if (!terminal() || state() != InferiorRunOk) { DebuggerCommand cmd("-thread-info", Discardable); cmd.callback = CB(handleThreadInfo); runCommand(cmd); From 91b67da6da6497ee1179bbfe1d4e0fd2c3e998ce Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 8 Sep 2023 12:45:52 +0200 Subject: [PATCH 5/5] Update qbs submodule to HEAD of 2.1 branch Change-Id: Ia27a1690a12a447871d639a739057557860b8b03 Reviewed-by: Christian Stenger --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index b607fac54ec..40d30480847 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit b607fac54ecc6e047a10ac7321884dafb6912ee1 +Subproject commit 40d304808479ea72c1d02dacf007ab8b05851e2e