forked from qt-creator/qt-creator
Debugger: Introduce a cache for pre-rendered value columne entries
Change-Id: Ibdcac8a5ccaa3eab0723205b913056530c510280 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -78,6 +78,9 @@ public:
|
|||||||
bool outdated = false; // \internal item is to be removed.
|
bool outdated = false; // \internal item is to be removed.
|
||||||
double time = 0; // Time used on the dumper side to produce this item
|
double time = 0; // Time used on the dumper side to produce this item
|
||||||
|
|
||||||
|
mutable QString valueCache; // Pre-computed displayed value
|
||||||
|
void updateValueCache() const; // implemented in watchhandler.cpp
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void parseHelper(const GdbMi &input, bool maySort);
|
void parseHelper(const GdbMi &input, bool maySort);
|
||||||
};
|
};
|
||||||
|
@@ -929,15 +929,22 @@ static QString displayName(const WatchItem *item)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString displayValue(const WatchItem *item)
|
|
||||||
|
void WatchItem::updateValueCache() const
|
||||||
{
|
{
|
||||||
QString result = truncateValue(formattedValue(item));
|
valueCache = truncateValue(formattedValue(this));
|
||||||
result = watchModel(item)->removeNamespaces(result);
|
valueCache = watchModel(this)->removeNamespaces(valueCache);
|
||||||
if (result.isEmpty() && item->address)
|
if (valueCache.isEmpty() && this->address)
|
||||||
result += QString::fromLatin1("@0x" + QByteArray::number(item->address, 16));
|
valueCache += QString::fromLatin1("@0x" + QByteArray::number(this->address, 16));
|
||||||
// if (origaddr)
|
// if (origaddr)
|
||||||
// result += QString::fromLatin1(" (0x" + QByteArray::number(origaddr, 16) + ')');
|
// result += QString::fromLatin1(" (0x" + QByteArray::number(origaddr, 16) + ')');
|
||||||
return result;
|
}
|
||||||
|
|
||||||
|
static QString displayValue(const WatchItem *item)
|
||||||
|
{
|
||||||
|
if (item->valueCache.isEmpty())
|
||||||
|
item->updateValueCache();
|
||||||
|
return item->valueCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString displayType(const WatchItem *item)
|
static QString displayType(const WatchItem *item)
|
||||||
|
Reference in New Issue
Block a user