summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristiaan Janssen <christiaan.janssen@qt.io>2021-11-30 16:13:11 +0100
committerChristiaan Janssen <christiaan.janssen@qt.io>2021-12-01 11:32:46 +0000
commitb4eb6ff4dda15e10d79c46a669f1586ea8fdeb36 (patch)
tree78c2f44b1a3e5966b019e605706e6bdab2f997db
parent536f96fef8b92753b3411881fbdfec42acd239b8 (diff)
downloadqt-creator-b4eb6ff4dda15e10d79c46a669f1586ea8fdeb36.tar.gz
McuSupport: fix armgdb registration when creating kit
Task-number: QTCREATORBUG-26631 Change-Id: Ia1854ba2a4d34afff1d2c80aac4c9919cd3142dc Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
-rw-r--r--src/plugins/mcusupport/mcusupportoptions.cpp32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp
index 4a21ece87b..4c9c7dab27 100644
--- a/src/plugins/mcusupport/mcusupportoptions.cpp
+++ b/src/plugins/mcusupport/mcusupportoptions.cpp
@@ -497,8 +497,27 @@ QVariant McuToolChainPackage::debuggerId() const
{
using namespace Debugger;
- QString sub = QString::fromLatin1(m_type == TypeArmGcc ? "bin/arm-none-eabi-gdb-py"
- : m_type == TypeIAR ? "../common/bin/CSpyBat" : "bar/foo-keil-gdb");
+ QString sub, displayName;
+ DebuggerEngineType engineType;
+
+ switch (m_type) {
+ case TypeArmGcc: {
+ sub = QString::fromLatin1("bin/arm-none-eabi-gdb-py");
+ displayName = McuPackage::tr("Arm GDB at %1");
+ engineType = Debugger::GdbEngineType;
+ break; }
+ case TypeIAR: {
+ sub = QString::fromLatin1("../common/bin/CSpyBat");
+ displayName = QLatin1String("CSpy");
+ engineType = Debugger::NoEngineType; // support for IAR missing
+ break; }
+ case TypeKEIL: {
+ sub = QString::fromLatin1("UV4/UV4");
+ displayName = QLatin1String("KEIL uVision Debugger");
+ engineType = Debugger::UvscEngineType;
+ break; }
+ default: return QVariant();
+ }
const FilePath command = path().pathAppended(sub).withExecutableSuffix();
const DebuggerItem *debugger = DebuggerItemManager::findByCommand(command);
@@ -506,11 +525,8 @@ QVariant McuToolChainPackage::debuggerId() const
if (!debugger) {
DebuggerItem newDebugger;
newDebugger.setCommand(command);
- const QString displayName = m_type == TypeArmGcc
- ? McuPackage::tr("Arm GDB at %1")
- : m_type == TypeIAR ? QLatin1String("CSpy")
- : QLatin1String("/bar/foo-keil-gdb");
newDebugger.setUnexpandedDisplayName(displayName.arg(command.toUserOutput()));
+ newDebugger.setEngineType(engineType);
debuggerId = DebuggerItemManager::registerDebugger(newDebugger);
} else {
debuggerId = debugger->id();
@@ -743,7 +759,9 @@ static void setKitDebugger(Kit *k, const McuToolChainPackage *tcPackage)
|| tcPackage->type() == McuToolChainPackage::TypeIAR)
return;
- Debugger::DebuggerKitAspect::setDebugger(k, tcPackage->debuggerId());
+ const QVariant debuggerId = tcPackage->debuggerId();
+ if (debuggerId.isValid())
+ Debugger::DebuggerKitAspect::setDebugger(k, debuggerId);
}
static void setKitDevice(Kit *k, const McuTarget* mcuTarget)