Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java
index eb80fef034a..c858e7137dd 100644
--- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java
+++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java
@@ -253,6 +253,16 @@ public abstract class Variable extends VariableDescriptor implements ICDIVariabl
// so it is pretty safe without to do without any other type checks
childFake = true;
// fn remains unchanged otherwise it would be like x->public
+ } else if (cpp && childName.equals(vars[i].getType())) {
+ // it is a base class (which is returned by GDB as a field)
+ // (type of a child is the name of a child)
+ if (t instanceof ICDIPointerType) {
+ // fn -> casting to pointer base class
+ fn = "(" + childName + "*)" + fn;//$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ // fn -> casting to base class
+ fn = "(" + childName + ")" + fn;//$NON-NLS-1$ //$NON-NLS-2$
+ }
} else if (t instanceof ICDIArrayType) {
// For Array gdb varobj only return the index, override here.
int index = castingIndex + i;

Back to the top