diff --git a/src/plugins/debugger/debuggerkitconfigwidget.cpp b/src/plugins/debugger/debuggerkitconfigwidget.cpp index c2955fa..926e9f2 100644 --- a/src/plugins/debugger/debuggerkitconfigwidget.cpp +++ b/src/plugins/debugger/debuggerkitconfigwidget.cpp @@ -145,11 +145,17 @@ static unsigned debuggerConfigurationErrors(const Kit *k) const DebuggerItem *DebuggerKitInformation::debugger(const Kit *kit) { + if (!kit) return 0; const QVariant id = kit->value(DebuggerKitInformation::id()); + if (!id.isValid()) { + qDebug() << __FUNCTION__ << id <<'!'; + return 0; + } + enum Detection { NotDetected, DetectedAutomatically, DetectedByFile, DetectedById }; Detection detection = NotDetected; @@ -183,18 +189,24 @@ const DebuggerItem *DebuggerKitInformation::debugger(const Kit *kit) fileName = FileName::fromUserInput(binary); } } - + qDebug() << __FUNCTION__ << kit->displayName() << id << detection; QTC_CHECK(detection != NotDetected); foreach (const DebuggerItem &item, DebuggerItemManager::debuggers()) { - if (detection == DetectedById && item.id() == id) + if (detection == DetectedById && item.id() == id) { + qDebug() << __FUNCTION__ << "id" << item.command().toUserOutput() << kit->displayName(); return &item; - if (detection == DetectedByFile && item.command() == fileName) + } + if (detection == DetectedByFile && item.command() == fileName) { + qDebug() << __FUNCTION__ << "file" << item.command().toUserOutput() << kit->displayName(); return &item; - if (detection == DetectedAutomatically && item.engineType() == autoEngine) + } + if (detection == DetectedAutomatically && item.engineType() == autoEngine) { + qDebug() << __FUNCTION__ << "auto" << item.command().toUserOutput() << kit->displayName(); return &item; + } } - +qDebug() << __FUNCTION__ << 0 << "for" << kit->displayName(); return 0; }