Debugger: Rework display length limitation systems

There are two values now, one to limit an entry in the L&E view
(default 100) and a hard upper limit (at 1 mio).

If displayed values are elided, the true length is shown in addition.

Change-Id: I180b70446c18e258c164e5af75b88d4c8b6c53f2
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hjk
2014-05-16 00:18:17 +02:00
parent 382730b130
commit 40052046fd
14 changed files with 179 additions and 154 deletions

View File

@@ -126,6 +126,7 @@ WatchData::WatchData() :
size(0),
bitpos(0),
bitsize(0),
elided(0),
hasChildren(false),
valueEnabled(true),
valueEditable(true),
@@ -142,12 +143,12 @@ bool WatchData::isEqual(const WatchData &other) const
&& name == other.name
&& value == other.value
&& editvalue == other.editvalue
&& valuetooltip == other.valuetooltip
&& type == other.type
&& displayedType == other.displayedType
&& variable == other.variable
&& address == other.address
&& size == other.size
&& elided == other.elided
&& hasChildren == other.hasChildren
&& valueEnabled == other.valueEnabled
&& valueEditable == other.valueEditable
@@ -312,6 +313,9 @@ QString WatchData::toString() const
if (isValueKnown() && !value.isEmpty())
str << "value=\"" << value << doubleQuoteComma;
if (elided)
str << "valueelided=\"" << elided << doubleQuoteComma;
if (!editvalue.isEmpty())
str << "editvalue=\"<...>\",";
// str << "editvalue=\"" << editvalue << doubleQuoteComma;
@@ -382,7 +386,7 @@ QString WatchData::toToolTip() const
formatToolTipRow(str, tr("Internal Type"), QLatin1String(type));
if (!displayedType.isEmpty())
formatToolTipRow(str, tr("Displayed Type"), displayedType);
QString val = valuetooltip.isEmpty() ? value : valuetooltip;
QString val = value;
// Automatically display hex value for unsigned integers.
if (!val.isEmpty() && val.at(0).isDigit() && isIntType(type)) {
bool ok;
@@ -458,13 +462,6 @@ void WatchData::updateValue(const GdbMi &item)
}
}
void setWatchDataValueToolTip(WatchData &data, const GdbMi &mi,
int encoding)
{
if (mi.isValid())
data.valuetooltip = decodeData(mi.data(), encoding);
}
void WatchData::updateChildCount(const GdbMi &mi)
{
if (mi.isValid())
@@ -629,6 +626,10 @@ void parseWatchData(const QSet<QByteArray> &expandedINames,
if (mi.isValid())
data.typeFormats = QString::fromUtf8(mi.data());
mi = item["valueelided"];
if (mi.isValid())
data.elided = mi.toInt();
mi = item["bitpos"];
if (mi.isValid())
data.bitpos = mi.toInt();