forked from qt-creator/qt-creator
Debugger: Fix configuration upgrade path from 2.8
Change-Id: I67547dfad529ebb918741721b691c39bb0e69720 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -159,26 +159,6 @@ void DebuggerItem::fromMap(const QVariantMap &data)
|
|||||||
if (abi.isValid())
|
if (abi.isValid())
|
||||||
abis.append(abi);
|
abis.append(abi);
|
||||||
}
|
}
|
||||||
|
|
||||||
// // Check for special 'auto' entry for binary written by the sdktool during
|
|
||||||
// // installation. Try to autodetect.
|
|
||||||
// if (command == QLatin1String("auto")) {
|
|
||||||
// command.clear();
|
|
||||||
// switch (engineType) {
|
|
||||||
// case Debugger::GdbEngineType: // Auto-detect system gdb on Unix
|
|
||||||
// if (Abi::hostAbi().os() != Abi::WindowsOS)
|
|
||||||
// comman = Environment::systemEnvironment().searchInPath(QLatin1String("gdb"));
|
|
||||||
// break;
|
|
||||||
// case Debugger::CdbEngineType: { // Auto-detect system CDB on Windows.
|
|
||||||
// const QPair<QString, QString> cdbs = autoDetectCdbDebugger();
|
|
||||||
// binary = cdbs.second.isEmpty() ? cdbs.first : cdbs.second;
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// default:
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// command = FileName::fromString(binary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DebuggerItem::userOutput() const
|
QString DebuggerItem::userOutput() const
|
||||||
@@ -330,16 +310,32 @@ DebuggerItem DebuggerKitInformation::debuggerItem(const ProjectExplorer::Kit *k)
|
|||||||
if (!k)
|
if (!k)
|
||||||
return DebuggerItem();
|
return DebuggerItem();
|
||||||
|
|
||||||
QVariant id = k->value(DEBUGGER_INFORMATION);
|
// We used to have:
|
||||||
if (!id.isValid())
|
// <valuemap type="QVariantMap" key="Debugger.Information">
|
||||||
return DebuggerItem();
|
// <value type="QString" key="Binary">/data/dev/debugger/gdb-git/gdb/gdb</value>
|
||||||
|
// <value type="int" key="EngineType">1</value>
|
||||||
|
// </valuemap>
|
||||||
|
// Starting with 3.0 we have:
|
||||||
|
// <value type="QString" key="Debugger.Information">{75ecf347-f221-44c3-b613-ea1d29929cd4}</value>
|
||||||
|
|
||||||
|
QVariant id = k->value(DEBUGGER_INFORMATION);
|
||||||
|
|
||||||
|
QString pathOrUid;
|
||||||
|
if (id.type() == QVariant::Map) // 2.x
|
||||||
|
pathOrUid = id.toMap().value(QLatin1String("Binary")).toString();
|
||||||
|
else if (id.type() == QVariant::String) // 3.x
|
||||||
|
pathOrUid = id.toString();
|
||||||
|
|
||||||
|
DebuggerItem *item;
|
||||||
|
if (pathOrUid.startsWith(QLatin1Char('{')))
|
||||||
|
item = DebuggerItemManager::debuggerFromId(id);
|
||||||
|
else
|
||||||
|
item = DebuggerItemManager::debuggerFromPath(pathOrUid);
|
||||||
|
|
||||||
DebuggerItem *item = DebuggerItemManager::debuggerFromId(id);
|
|
||||||
QTC_ASSERT(item, return DebuggerItem());
|
QTC_ASSERT(item, return DebuggerItem());
|
||||||
return *item;
|
return *item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DebuggerKitInformation::setDebuggerItem(Kit *k,
|
void DebuggerKitInformation::setDebuggerItem(Kit *k,
|
||||||
DebuggerEngineType type, const Utils::FileName &command)
|
DebuggerEngineType type, const Utils::FileName &command)
|
||||||
{
|
{
|
||||||
@@ -741,6 +737,14 @@ DebuggerItem *DebuggerItemManager::debuggerFromId(const QVariant &id)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DebuggerItem *DebuggerItemManager::debuggerFromPath(const QString &path)
|
||||||
|
{
|
||||||
|
foreach (DebuggerItem *item, theDebuggerItemManager()->m_debuggers)
|
||||||
|
if (item->command.toString() == path)
|
||||||
|
return item;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
QModelIndex DebuggerItemManager::currentIndex() const
|
QModelIndex DebuggerItemManager::currentIndex() const
|
||||||
{
|
{
|
||||||
QStandardItem *current = m_itemFromDebugger.value(m_currentDebugger);
|
QStandardItem *current = m_itemFromDebugger.value(m_currentDebugger);
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public:
|
|||||||
QList<DebuggerItem *> findDebuggers(const ProjectExplorer::Abi &abi) const;
|
QList<DebuggerItem *> findDebuggers(const ProjectExplorer::Abi &abi) const;
|
||||||
DebuggerItem *currentDebugger() const { return m_currentDebugger; }
|
DebuggerItem *currentDebugger() const { return m_currentDebugger; }
|
||||||
static DebuggerItem *debuggerFromId(const QVariant &id);
|
static DebuggerItem *debuggerFromId(const QVariant &id);
|
||||||
|
static DebuggerItem *debuggerFromPath(const QString &path);
|
||||||
QModelIndex currentIndex() const;
|
QModelIndex currentIndex() const;
|
||||||
void setCurrentIndex(const QModelIndex &index);
|
void setCurrentIndex(const QModelIndex &index);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user