From 8a84fa9f7258f7205714b73bffd1a3903c7df2dc Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Fri, 9 May 2008 15:46:38 +0000 Subject: [PATCH] Bug 219179 Properly deal with children of pointers when -var-info-path-expression is not available --- .../src/org/eclipse/dd/mi/service/MIVariableManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIVariableManager.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIVariableManager.java index ac5ce0eaf35..fb064a97a11 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIVariableManager.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIVariableManager.java @@ -770,6 +770,7 @@ public class MIVariableManager implements ICommandControl { /** * This method builds a child expression based on its parent's expression. + * It is a fallback solution for when GDB doesn't support the var-info-path-expression. * * Currently, this does not support inherited class such as * class foo : bar { @@ -778,6 +779,13 @@ public class MIVariableManager implements ICommandControl { * because we'll create foo.bar instead of (bar)foo. */ private String buildChildExpression(String parentExp, String childExp) { + // For pointers, the child expression is already contained in the parent, + // so we must simply prefix with * + // See Bug219179 for more information. + if (isPointer()) { + return "*("+parentExp+")"; //$NON-NLS-1$//$NON-NLS-2$ + } + return parentExp + "." + childExp; //$NON-NLS-1$ // No need for a special case for arrays since we deal with arrays differently // and don't call this method for them