From 9a06e1f65c25424696ad9a1ced5eec7560f30f80 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 6 Jun 2024 15:01:42 +0200 Subject: [PATCH] Debugger: prefer 64 bit cdb and remove auto detected 32 bit cdb Change-Id: I57a4b0cb25a6d33478bc7a5cde9a427cfc5214c6 Reviewed-by: Christian Stenger --- src/plugins/debugger/debuggeritem.cpp | 7 +++++-- src/plugins/debugger/debuggeritemmanager.cpp | 6 ++++++ src/plugins/debugger/debuggerkitaspect.cpp | 9 +++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index c5b1bc7f6b6..dff784341a7 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -440,8 +440,11 @@ static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &t return matchOnMultiarch; } - if (debuggerAbi.wordWidth() == 64 && targetAbi.wordWidth() == 32) - return DebuggerItem::MatchesSomewhat; + if (debuggerAbi.wordWidth() == 64 && targetAbi.wordWidth() == 32) { + return HostOsInfo::isWindowsHost() && engineType == CdbEngineType + ? DebuggerItem::MatchesPerfectly + : DebuggerItem::MatchesSomewhat; + } if (debuggerAbi.wordWidth() != 0 && debuggerAbi.wordWidth() != targetAbi.wordWidth()) return matchOnMultiarch; diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index 4d9d663d0d0..23dcee4ee6a 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -783,6 +783,12 @@ void DebuggerItemModel::readDebuggers(const FilePath &fileName, bool isSystem) .arg(item.command().toUserOutput(), item.id().toString(), fileName.toUserOutput()); continue; } + if (item.engineType() == CdbEngineType + && Abi::abisOfBinary(item.command()).value(0).wordWidth() == 32) { + qWarning() << QString("32 bit CDB \"%1\" (%2) read from \"%3\" dropped since it is not supported anymore.") + .arg(item.command().toUserOutput(), item.id().toString(), fileName.toUserOutput()); + continue; + } // FIXME: During startup, devices are not yet available, so we cannot check if the file still exists. if (!item.command().needsDevice() && !item.command().isExecutableFile()) { qWarning() << QString("DebuggerItem \"%1\" (%2) read from \"%3\" dropped since the command is not executable.") diff --git a/src/plugins/debugger/debuggerkitaspect.cpp b/src/plugins/debugger/debuggerkitaspect.cpp index 10559a70840..15a3e8827c1 100644 --- a/src/plugins/debugger/debuggerkitaspect.cpp +++ b/src/plugins/debugger/debuggerkitaspect.cpp @@ -388,6 +388,15 @@ public: k->setValue(DebuggerKitAspect::id(), bestLevel != DebuggerItem::DoesNotMatch ? bestItem.id() : QVariant()); } + void fix(Kit *k) override + { + const QVariant id = k->value(DebuggerKitAspect::id()); + if (Utils::anyOf(DebuggerItemManager::debuggers(), Utils::equal(&DebuggerItem::id, id))) + return; + k->removeKeySilently(DebuggerKitAspect::id()); + setup(k); + } + KitAspect *createKitAspect(Kit *k) const override { return new Internal::DebuggerKitAspectImpl(k, this);