Debugger: Update debugger details when executable is replaced

Store last modified time in persistent storage, and if it is changed,
reinitialize the item.

Change-Id: I15e8c843fecd3cebd528f2dadb64645828a2b221
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2016-03-06 23:26:01 +02:00
committed by Orgad Shaneh
parent 24f34420fd
commit 383737d020
4 changed files with 22 additions and 5 deletions

View File

@@ -256,8 +256,12 @@ void DebuggerItemManager::autoDetectGdbOrLldbDebuggers()
}
foreach (const FileName &command, suspects) {
if (findByCommand(command))
DebuggerItem *existingItem = findByCommand(command);
if (existingItem) {
if (command.toFileInfo().lastModified() != existingItem->lastModified())
existingItem->reinitializeFromFile();
continue;
}
DebuggerItem item;
item.createId();
item.setCommand(command);
@@ -309,9 +313,9 @@ void DebuggerItemManager::readLegacyDebuggers(const FileName &file)
}
}
const DebuggerItem *DebuggerItemManager::findByCommand(const FileName &command)
DebuggerItem *DebuggerItemManager::findByCommand(const FileName &command)
{
foreach (const DebuggerItem &item, m_debuggers)
for (auto &item: m_debuggers)
if (item.command() == command)
return &item;