1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 351898 - Add guard to populate expression column for variables that

return error on evaluation.
This commit is contained in:
Pawel Piech 2011-07-14 12:12:48 -07:00
parent 9f3bf0a326
commit a33ed9c492

View file

@ -731,7 +731,7 @@ public class VariableVMNode extends AbstractExpressionVMNode
int count = 0; int count = 0;
for (final IPropertiesUpdate update : updates) { for (final IPropertiesUpdate update : updates) {
IExpression expression = (IExpression)DebugPlugin.getAdapter(update.getElement(), IExpression.class); final IExpression expression = (IExpression)DebugPlugin.getAdapter(update.getElement(), IExpression.class);
if (expression != null) { if (expression != null) {
update.setProperty(AbstractExpressionVMNode.PROP_ELEMENT_EXPRESSION, expression.getExpressionText()); update.setProperty(AbstractExpressionVMNode.PROP_ELEMENT_EXPRESSION, expression.getExpressionText());
} }
@ -761,10 +761,13 @@ public class VariableVMNode extends AbstractExpressionVMNode
if (isSuccess()) { if (isSuccess()) {
fillExpressionDataProperties(update, getData()); fillExpressionDataProperties(update, getData());
} else { } else {
// In case of an error fill in the expression next in the name column. // In case of an error fill in the expression text in the name column and expressions columns.
IExpressionDMContext dmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IExpressions.IExpressionDMContext.class); IExpressionDMContext dmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IExpressions.IExpressionDMContext.class);
if (dmc != null && dmc.getExpression() != null) { if (dmc != null && dmc.getExpression() != null) {
update.setProperty(PROP_NAME, dmc.getExpression()); update.setProperty(PROP_NAME, dmc.getExpression());
if (expression == null) {
update.setProperty(PROP_ELEMENT_EXPRESSION, dmc.getExpression());
}
} }
update.setStatus(getStatus()); update.setStatus(getStatus());
} }