forked from qt-creator/qt-creator
QtSupport: Try harder at providing the right debugger
... for a temporary kit created by the importer. The way the importer works is that it sets up a random kit (with a default toolchain) and then overwrites toolchain and Qt version. If the new toolchain is of a different type than the original one, the debugger will not match anymore. Fix this by calling fix() on the changed kit and adapting the DebuggerKitAspect so that it sets itself up from scratch if the current value doesn't match the toolchain. Fixes: QTCREATORBUG-27758 Change-Id: Ib0539f07c0c38728de89a49299b7d2439afc5744 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -264,11 +264,21 @@ void DebuggerKitAspect::fix(Kit *k)
|
||||
return;
|
||||
|
||||
if (rawId.type() == QVariant::String) {
|
||||
if (!DebuggerItemManager::findById(rawId)) {
|
||||
const DebuggerItem * const item = DebuggerItemManager::findById(rawId);
|
||||
if (!item) {
|
||||
qWarning("Unknown debugger id %s in kit %s",
|
||||
qPrintable(rawId.toString()), qPrintable(k->displayName()));
|
||||
k->setValue(DebuggerKitAspect::id(), QVariant());
|
||||
setup(k);
|
||||
return;
|
||||
}
|
||||
const Abi tcAbi = ToolChainKitAspect::targetAbi(k);
|
||||
for (const Abi &abi : item->abis()) {
|
||||
if (abi.isCompatibleWith(tcAbi))
|
||||
return;
|
||||
}
|
||||
k->setValue(DebuggerKitAspect::id(), QVariant());
|
||||
setup(k);
|
||||
return; // All fine (now).
|
||||
}
|
||||
|
||||
|
@@ -90,6 +90,7 @@ Kit *QtProjectImporter::createTemporaryKit(const QtVersionData &versionData,
|
||||
}
|
||||
|
||||
additionalSetup(k);
|
||||
k->fix();
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user