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.
|
||||
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:
|
||||
void parseHelper(const GdbMi &input, bool maySort);
|
||||
};
|
||||
|
@@ -929,15 +929,22 @@ static QString displayName(const WatchItem *item)
|
||||
return result;
|
||||
}
|
||||
|
||||
static QString displayValue(const WatchItem *item)
|
||||
|
||||
void WatchItem::updateValueCache() const
|
||||
{
|
||||
QString result = truncateValue(formattedValue(item));
|
||||
result = watchModel(item)->removeNamespaces(result);
|
||||
if (result.isEmpty() && item->address)
|
||||
result += QString::fromLatin1("@0x" + QByteArray::number(item->address, 16));
|
||||
valueCache = truncateValue(formattedValue(this));
|
||||
valueCache = watchModel(this)->removeNamespaces(valueCache);
|
||||
if (valueCache.isEmpty() && this->address)
|
||||
valueCache += QString::fromLatin1("@0x" + QByteArray::number(this->address, 16));
|
||||
// if (origaddr)
|
||||
// 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)
|
||||
|
Reference in New Issue
Block a user