overturetool / overture

The Overture Tool
http://overturetool.org
GNU General Public License v3.0
48 stars 25 forks source link

Declared type column wrong in Expressions view #176

Closed joey-coleman closed 11 years ago

joey-coleman commented 11 years ago

The following bug was originally reported on Sourceforge by nick_battle, 2013-05-30 07:33:59.863000:

If you stop at a breakpoint and evaluate an expression in the Expressions view, you can also opt to show the actual and declared types (Layout/Select Columns). The actual type is reasonably the most specific type that includes the value - eg. 123 is a nat1. But the declared type is harder to work out, and seems to be showing the same value as the actual type anyway (eg. if it is a single variable, the 123 may be a real or real|bool; if it is an expression, I'm not sure what the declared type should be!).

It might be easiest if we disable the declared type column and just allow actual type to be shown?

joey-coleman commented 11 years ago

Comment by lausdahl, 2013-08-05 20:42:31.902000:

  • status: open --> closed
joey-coleman commented 11 years ago

Comment by lausdahl, 2013-08-05 20:42:32.305000:

There is nothing (not easily) we can do about this because Eclipse treats them as the same internally. It is probably something they added for future versions:

See org.eclipse.debug.internal.ui.model.elements.ExpressionLabelProvider

/**
 * Returns text for a specific columns for the expression/value.
 * 
 * @param expression expression to retrieve text for
 * @param value the value associated with the variable
 * @param context presentation context specifying how to display the text
 * @param columnId the column to get the text for
 * @return the label text
 * @throws CoreException Error while retrieving data from model.
 * 
 * @since 3.6
 */
private String getColumnText(IExpression expression, IValue value, IPresentationContext context, String columnId) throws CoreException {
    if (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(columnId)) {
        return getExpressionName(expression, context);
    } else if (IDebugUIConstants.COLUMN_ID_VARIABLE_VALUE.equals(columnId)) {
        return getExpressionValueText(expression, value, context);
    } else if (IDebugUIConstants.COLUMN_ID_VARIABLE_TYPE.equals(columnId) ||
            IDebugUIConstants.COLUMN_ID_VARIABLE_VALUE_TYPE.equals(columnId)) 
    {
        if (value != null) {
            return getValueTypeName(null, value, context);
        }
    }   
    return null;
}