1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

[304010] - exploring values of base class fields

This commit is contained in:
Alena Laskavaia 2010-04-08 21:07:13 +00:00
parent 119d848c62
commit 92b10b9ca5

View file

@ -256,12 +256,13 @@ public abstract class Variable extends VariableDescriptor implements ICDIVariabl
} else if (cpp && childName.equals(vars[i].getType())) { } else if (cpp && childName.equals(vars[i].getType())) {
// it is a base class (which is returned by GDB as a field) // it is a base class (which is returned by GDB as a field)
// (type of a child is the name of a child) // (type of a child is the name of a child)
String childNameForCast = childName.contains("::") ? "'" + childName + "'" : childName; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (t instanceof ICDIPointerType) { if (t instanceof ICDIPointerType) {
// fn -> casting to pointer base class // fn -> casting to pointer base class
fn = "(" + childName + "*)" + fn;//$NON-NLS-1$ //$NON-NLS-2$ fn = "(struct " + childNameForCast + ")(*" + fn + ")";//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} else { } else {
// fn -> casting to base class // fn -> casting to base class
fn = "(" + childName + ")" + fn;//$NON-NLS-1$ //$NON-NLS-2$ fn = "(struct " + childNameForCast + ")" + fn;//$NON-NLS-1$ //$NON-NLS-2$
} }
} else if (t instanceof ICDIArrayType) { } else if (t instanceof ICDIArrayType) {
// For Array gdb varobj only return the index, override here. // For Array gdb varobj only return the index, override here.