ios: improve automatic kits

* fix incorrect old kits
* avoid adding a special debugger

Change-Id: I233068dbb9958045cdc2e875337297748b2b4ff8
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Fawzi Mohamed
2013-11-05 11:32:47 +01:00
parent 242cba3065
commit 9a4caa4b4c
4 changed files with 50 additions and 29 deletions

View File

@@ -38,10 +38,12 @@
#include <utils/fileutils.h>
#include <utils/persistentsettings.h>
#include <utils/qtcassert.h>
#include <utils/hostosinfo.h>
#include <QDebug>
#include <QDir>
#include <QFileInfo>
#include <QProcess>
using namespace ProjectExplorer;
using namespace Utils;
@@ -217,6 +219,19 @@ void DebuggerItemManager::autoDetectGdbOrLldbDebuggers()
QFileInfoList suspects;
if (HostOsInfo::isMacHost()) {
QProcess lldbInfo;
lldbInfo.start(QLatin1String("xcrun"), QStringList() << QLatin1String("--find")
<< QLatin1String("lldb"));
if (!lldbInfo.waitForFinished(2000)) {
lldbInfo.kill();
lldbInfo.waitForFinished();
} else {
QByteArray lPath = lldbInfo.readAll();
suspects.append(QFileInfo(QString::fromLocal8Bit(lPath.data(), lPath.size() -1)));
}
}
QStringList path = Environment::systemEnvironment().path();
foreach (const QString &base, path) {
QDir dir(base);
@@ -301,6 +316,14 @@ const DebuggerItem *DebuggerItemManager::findById(const QVariant &id)
return 0;
}
const DebuggerItem *DebuggerItemManager::findByEngineType(DebuggerEngineType engineType)
{
foreach (const DebuggerItem &item, m_debuggers)
if (item.engineType() == engineType && item.isValid())
return &item;
return 0;
}
void DebuggerItemManager::restoreDebuggers()
{
// Read debuggers from SDK