mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 202342
This commit is contained in:
parent
d96a8c57e6
commit
a89a6117aa
1 changed files with 21 additions and 6 deletions
|
@ -77,6 +77,8 @@ public class VariableLayoutNode extends AbstractExpressionLayoutNode<IExpression
|
||||||
return fChildLayoutNodes;
|
return fChildLayoutNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final static int MAX_STRING_VALUE_LENGTH = 40;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDeltaFlags(Object e) {
|
public int getDeltaFlags(Object e) {
|
||||||
/*
|
/*
|
||||||
|
@ -298,7 +300,7 @@ public class VariableLayoutNode extends AbstractExpressionLayoutNode<IExpression
|
||||||
} else {
|
} else {
|
||||||
for (int idx = 0; idx < localColumns.length; idx++) {
|
for (int idx = 0; idx < localColumns.length; idx++) {
|
||||||
if (IDebugVMConstants.COLUMN_ID__VALUE.equals(localColumns[idx])) {
|
if (IDebugVMConstants.COLUMN_ID__VALUE.equals(localColumns[idx])) {
|
||||||
updateFormattedExpressionValue(update, idx, dmc);
|
updateFormattedExpressionValue(update, idx, dmc, getData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -315,7 +317,7 @@ public class VariableLayoutNode extends AbstractExpressionLayoutNode<IExpression
|
||||||
* get the formatted data value for a specific register.
|
* get the formatted data value for a specific register.
|
||||||
*/
|
*/
|
||||||
private void updateFormattedExpressionValue(final ILabelUpdate update, final int labelIndex,
|
private void updateFormattedExpressionValue(final ILabelUpdate update, final int labelIndex,
|
||||||
final IExpressionDMContext dmc)
|
final IExpressionDMContext dmc, final IExpressionDMData expressionDMData)
|
||||||
{
|
{
|
||||||
final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
|
final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
|
||||||
/*
|
/*
|
||||||
|
@ -386,13 +388,26 @@ public class VariableLayoutNode extends AbstractExpressionLayoutNode<IExpression
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill the label/column with the properly formatted data value.
|
// Fill the label/column with the properly formatted data value.
|
||||||
update.setLabel(getData().getFormattedValue(), labelIndex);
|
StringBuffer stringValueBuf = new StringBuffer(getData().getFormattedValue());
|
||||||
|
String stringValue = expressionDMData.getStringValue();
|
||||||
|
if(stringValue != null && stringValue.length() > 0)
|
||||||
|
{
|
||||||
|
stringValueBuf.append(" ");
|
||||||
|
stringValueBuf.append(stringValue.length() > MAX_STRING_VALUE_LENGTH ? stringValue.substring(0, MAX_STRING_VALUE_LENGTH) : stringValue);
|
||||||
|
}
|
||||||
|
update.setLabel(stringValueBuf.toString(), labelIndex);
|
||||||
|
|
||||||
// Color based on change history
|
// Color based on change history
|
||||||
FormattedValueDMData oldData = (FormattedValueDMData) VMCacheManager.getVMCacheManager()
|
FormattedValueDMData oldData = (FormattedValueDMData) VMCacheManager.getVMCacheManager()
|
||||||
.getCache(VariableLayoutNode.this.getVMProvider().getPresentationContext())
|
.getCache(VariableLayoutNode.this.getVMProvider().getPresentationContext())
|
||||||
.getArchivedModelData(valueDmc);
|
.getArchivedModelData(valueDmc);
|
||||||
if (oldData != null && !oldData.getFormattedValue().equals(getData().getFormattedValue())) {
|
|
||||||
|
IExpressionDMData oldDMData = (IExpressionDMData) VMCacheManager.getVMCacheManager().getCache(update.getPresentationContext()).getArchivedModelData(dmc);
|
||||||
|
String oldStringValue = oldDMData == null ? null : oldDMData.getStringValue();
|
||||||
|
|
||||||
|
// highlight the value if either the value (address) has changed or the string (memory at the value) has changed
|
||||||
|
if ((oldData != null && !oldData.getFormattedValue().equals(getData().getFormattedValue()))
|
||||||
|
|| (oldStringValue != null && !oldStringValue.equals(stringValue))) {
|
||||||
update.setBackground(
|
update.setBackground(
|
||||||
DebugUIPlugin.getPreferenceColor(
|
DebugUIPlugin.getPreferenceColor(
|
||||||
IInternalDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB(),
|
IInternalDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue