diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java index 07246086dfb..3872f2089cf 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java @@ -1102,38 +1102,29 @@ public class MIVariableManager implements ICommandControl { return; } - // If the variable is a complex structure, there is no need to ask the back-end for a value, - // we can give it the {...} ourselves - // Unless we are dealing with an array, in which case, we want to get the address of it - if (isComplex() && ! isDynamic()) { - if (isArray()) { - // Figure out the address - IExpressionDMContext exprCxt = DMContexts.getAncestorOfType(dmc, IExpressionDMContext.class); - IExpressionDMContext addrCxt = fExpressionService.createExpression(exprCxt, "&(" + exprCxt.getExpression() + ")"); //$NON-NLS-1$//$NON-NLS-2$ + // If we are dealing with an array, in which case, we want to get the address of it. + // When dealing with a complex value, we want to query the back-end to correctly + // address the case of a typedefed pointer (see bug 293832). + if (isArray()) { + // Figure out the address + IExpressionDMContext exprCxt = DMContexts.getAncestorOfType(dmc, IExpressionDMContext.class); + IExpressionDMContext addrCxt = fExpressionService.createExpression(exprCxt, "&(" + exprCxt.getExpression() + ")"); //$NON-NLS-1$//$NON-NLS-2$ - final FormattedValueDMContext formatCxt = new FormattedValueDMContext( - fSession.getId(), - addrCxt, - dmc.getFormatID() - ); + final FormattedValueDMContext formatCxt = new FormattedValueDMContext( + fSession.getId(), + addrCxt, + dmc.getFormatID() + ); - getVariable( - addrCxt, - new DataRequestMonitor(fSession.getExecutor(), rm) { - @Override - protected void handleSuccess() { - getData().getValue(formatCxt, rm); + getVariable( + addrCxt, + new DataRequestMonitor(fSession.getExecutor(), rm) { + @Override + protected void handleSuccess() { + getData().getValue(formatCxt, rm); - } - }); - } else { - // Other complex structure - String complexValue = "{...}"; //$NON-NLS-1$ - setValue(dmc.getFormatID(), complexValue); - rm.setData(new FormattedValueDMData(complexValue)); - rm.done(); - } - + } + }); return; }