forked from qt-creator/qt-creator
Debugger: Prefer debuggers in PATH to others when setting up kits
Task-number: QTCREATORBUG-18188 Change-Id: Iaee65491cca5d7a66b6fbb70c2500395a995790d Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -59,14 +59,20 @@ DebuggerKitInformation::DebuggerKitInformation()
|
||||
QVariant DebuggerKitInformation::defaultValue(const Kit *k) const
|
||||
{
|
||||
const Abi toolChainAbi = ToolChainKitInformation::targetAbi(k);
|
||||
const QStringList paths = Environment::systemEnvironment().path();
|
||||
QVariant nextBestFit;
|
||||
foreach (const DebuggerItem &item, DebuggerItemManager::debuggers()) {
|
||||
foreach (const Abi targetAbi, item.abis()) {
|
||||
if (targetAbi.isCompatibleWith(toolChainAbi))
|
||||
return item.id();
|
||||
if (targetAbi.isCompatibleWith(toolChainAbi)) {
|
||||
if (paths.contains(item.command().toFileInfo().absolutePath()))
|
||||
return item.id(); // prefer debuggers found in PATH over those found elsewhere
|
||||
if (nextBestFit.isNull())
|
||||
nextBestFit = item.id();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
return nextBestFit;
|
||||
}
|
||||
|
||||
void DebuggerKitInformation::setup(Kit *k)
|
||||
|
||||
Reference in New Issue
Block a user