1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

2004-10-28 Alain Magloire

Add ICDIValue.getType() and ICDIExpression.geType() new methods.
This commit is contained in:
Alain Magloire 2004-10-28 17:08:54 +00:00
parent 28848655d5
commit dc0936d60d
27 changed files with 196 additions and 148 deletions

View file

@ -1,3 +1,6 @@
2004-10-28 Alain Magloire
Add ICDIValue.getType() and ICDIExpression.geType() new methods.
2004-10-26 Alain Magloire 2004-10-26 Alain Magloire
Remove ICDIMemoryManager in CDI Remove ICDIMemoryManager in CDI
* cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java * cdi/org/eclipse/cdt/debug/mi/core/cdi/Session.java

View file

@ -185,7 +185,7 @@ public class SourceManager extends Manager {
public void update(Target target) throws CDIException { public void update(Target target) throws CDIException {
} }
public Type getType(VariableObject vo, String name) throws CDIException { public Type getType(ICDIStackFrame frame, String name) throws CDIException {
if (name == null) { if (name == null) {
name = new String(); name = new String();
} }
@ -203,21 +203,21 @@ public class SourceManager extends Manager {
switch(gdbType.getType()) { switch(gdbType.getType()) {
case GDBType.ARRAY: case GDBType.ARRAY:
int d = ((GDBDerivedType)gdbType).getDimension(); int d = ((GDBDerivedType)gdbType).getDimension();
aType = new ArrayType(vo, gdbType.toString(), d); aType = new ArrayType(frame, gdbType.toString(), d);
break; break;
case GDBType.FUNCTION: case GDBType.FUNCTION:
aType = new FunctionType(vo, gdbType.toString()); aType = new FunctionType(frame, gdbType.toString());
break; break;
case GDBType.POINTER: case GDBType.POINTER:
aType = new PointerType(vo, gdbType.toString()); aType = new PointerType(frame, gdbType.toString());
break; break;
case GDBType.REFERENCE: case GDBType.REFERENCE:
aType = new ReferenceType(vo, gdbType.toString()); aType = new ReferenceType(frame, gdbType.toString());
break; break;
} }
gdbType = ((GDBDerivedType)gdbType).getChild(); gdbType = ((GDBDerivedType)gdbType).getChild();
} else { } else {
aType = toCDIType(vo, gdbType.toString()); aType = toCDIType(frame, gdbType.toString());
gdbType = null; gdbType = null;
} }
if (type instanceof DerivedType) { if (type instanceof DerivedType) {
@ -235,7 +235,7 @@ public class SourceManager extends Manager {
throw new CDIException(CdiResources.getString("cdi.SourceManager.Unknown_type")); //$NON-NLS-1$ throw new CDIException(CdiResources.getString("cdi.SourceManager.Unknown_type")); //$NON-NLS-1$
} }
Type toCDIType(VariableObject vo, String name) throws CDIException { Type toCDIType(ICDIStackFrame frame, String name) throws CDIException {
// Check the derived types and agregate types // Check the derived types and agregate types
if (name == null) { if (name == null) {
name = new String(); name = new String();
@ -244,50 +244,50 @@ public class SourceManager extends Manager {
// Check the primitives. // Check the primitives.
if (typename.equals("char")) { //$NON-NLS-1$ if (typename.equals("char")) { //$NON-NLS-1$
return new CharType(vo, typename); return new CharType(frame, typename);
} else if (typename.equals("wchar_t")) { //$NON-NLS-1$ } else if (typename.equals("wchar_t")) { //$NON-NLS-1$
return new WCharType(vo, typename); return new WCharType(frame, typename);
} else if (typename.equals("short")) { //$NON-NLS-1$ } else if (typename.equals("short")) { //$NON-NLS-1$
return new ShortType(vo, typename); return new ShortType(frame, typename);
} else if (typename.equals("int")) { //$NON-NLS-1$ } else if (typename.equals("int")) { //$NON-NLS-1$
return new IntType(vo, typename); return new IntType(frame, typename);
} else if (typename.equals("long")) { //$NON-NLS-1$ } else if (typename.equals("long")) { //$NON-NLS-1$
return new LongType(vo, typename); return new LongType(frame, typename);
} else if (typename.equals("unsigned")) { //$NON-NLS-1$ } else if (typename.equals("unsigned")) { //$NON-NLS-1$
return new IntType(vo, typename, true); return new IntType(frame, typename, true);
} else if (typename.equals("signed")) { //$NON-NLS-1$ } else if (typename.equals("signed")) { //$NON-NLS-1$
return new IntType(vo, typename); return new IntType(frame, typename);
} else if (typename.equals("bool")) { //$NON-NLS-1$ } else if (typename.equals("bool")) { //$NON-NLS-1$
return new BoolType(vo, typename); return new BoolType(frame, typename);
} else if (typename.equals("_Bool")) { //$NON-NLS-1$ } else if (typename.equals("_Bool")) { //$NON-NLS-1$
return new BoolType(vo, typename); return new BoolType(frame, typename);
} else if (typename.equals("float")) { //$NON-NLS-1$ } else if (typename.equals("float")) { //$NON-NLS-1$
return new FloatType(vo, typename); return new FloatType(frame, typename);
} else if (typename.equals("double")) { //$NON-NLS-1$ } else if (typename.equals("double")) { //$NON-NLS-1$
return new DoubleType(vo, typename); return new DoubleType(frame, typename);
} else if (typename.equals("void")) { //$NON-NLS-1$ } else if (typename.equals("void")) { //$NON-NLS-1$
return new VoidType(vo, typename); return new VoidType(frame, typename);
} else if (typename.equals("enum")) { //$NON-NLS-1$ } else if (typename.equals("enum")) { //$NON-NLS-1$
return new EnumType(vo, typename); return new EnumType(frame, typename);
} else if (typename.equals("union")) { //$NON-NLS-1$ } else if (typename.equals("union")) { //$NON-NLS-1$
return new StructType(vo, typename); return new StructType(frame, typename);
} else if (typename.equals("struct")) { //$NON-NLS-1$ } else if (typename.equals("struct")) { //$NON-NLS-1$
return new StructType(vo, typename); return new StructType(frame, typename);
} else if (typename.equals("class")) { //$NON-NLS-1$ } else if (typename.equals("class")) { //$NON-NLS-1$
return new StructType(vo, typename); return new StructType(frame, typename);
} }
// GDB has some special types for int // GDB has some special types for int
if (typename.equals("int8_t")) { //$NON-NLS-1$ if (typename.equals("int8_t")) { //$NON-NLS-1$
return new CharType(vo, typename); return new CharType(frame, typename);
} else if (typename.equals("int16_t")) { //$NON-NLS-1$ } else if (typename.equals("int16_t")) { //$NON-NLS-1$
return new ShortType(vo, typename); return new ShortType(frame, typename);
} else if (typename.equals("int32_t")) { //$NON-NLS-1$ } else if (typename.equals("int32_t")) { //$NON-NLS-1$
return new LongType(vo, typename); return new LongType(frame, typename);
} else if (typename.equals("int64_t")) { //$NON-NLS-1$ } else if (typename.equals("int64_t")) { //$NON-NLS-1$
return new LongLongType(vo, typename); return new LongLongType(frame, typename);
} else if (typename.equals("int128_t")) { //$NON-NLS-1$ } else if (typename.equals("int128_t")) { //$NON-NLS-1$
return new IntType(vo, typename); return new IntType(frame, typename); // ????
} }
@ -320,27 +320,27 @@ public class SourceManager extends Manager {
boolean isEnum = first.equals("enum"); //$NON-NLS-1$ boolean isEnum = first.equals("enum"); //$NON-NLS-1$
if (isChar && (isSigned || isUnsigned)) { if (isChar && (isSigned || isUnsigned)) {
return new CharType(vo, typename, isUnsigned); return new CharType(frame, typename, isUnsigned);
} else if (isShort && (isSigned || isUnsigned)) { } else if (isShort && (isSigned || isUnsigned)) {
return new ShortType(vo, typename, isUnsigned); return new ShortType(frame, typename, isUnsigned);
} else if (isInt && (isSigned || isUnsigned)) { } else if (isInt && (isSigned || isUnsigned)) {
return new IntType(vo, typename, isUnsigned); return new IntType(frame, typename, isUnsigned);
} else if (isLong && (isInt || isSigned || isUnsigned)) { } else if (isLong && (isInt || isSigned || isUnsigned)) {
return new LongType(vo, typename, isUnsigned); return new LongType(frame, typename, isUnsigned);
} else if (isLongLong) { } else if (isLongLong) {
return new LongLongType(vo, typename); return new LongLongType(frame, typename);
} else if (isDouble && (isLong || isComplex || isImaginery)) { } else if (isDouble && (isLong || isComplex || isImaginery)) {
return new DoubleType(vo, typename, isComplex, isImaginery, isLong); return new DoubleType(frame, typename, isComplex, isImaginery, isLong);
} else if (isFloat && (isComplex || isImaginery)) { } else if (isFloat && (isComplex || isImaginery)) {
return new FloatType(vo, typename, isComplex, isImaginery); return new FloatType(frame, typename, isComplex, isImaginery);
} else if (isStruct) { } else if (isStruct) {
return new StructType(vo, typename); return new StructType(frame, typename);
} else if (isClass) { } else if (isClass) {
return new StructType(vo, typename); return new StructType(frame, typename);
} else if (isUnion) { } else if (isUnion) {
return new StructType(vo, typename); return new StructType(frame, typename);
} else if (isEnum) { } else if (isEnum) {
return new EnumType(vo, typename); return new EnumType(frame, typename);
} }
} else if (count == 3) { } else if (count == 3) {
// ISOC allows permutation. replace short by: long or short // ISOC allows permutation. replace short by: long or short
@ -368,13 +368,13 @@ public class SourceManager extends Manager {
if (isShort && isInt && (isSigned || unSigned)) { if (isShort && isInt && (isSigned || unSigned)) {
return new ShortType(vo, typename, unSigned); return new ShortType(frame, typename, unSigned);
} else if (isLong && isInt && (isSigned || unSigned)) { } else if (isLong && isInt && (isSigned || unSigned)) {
return new LongType(vo, typename, unSigned); return new LongType(frame, typename, unSigned);
} else if (isLongLong && (isSigned || unSigned)) { } else if (isLongLong && (isSigned || unSigned)) {
return new LongLongType(vo, typename, unSigned); return new LongLongType(frame, typename, unSigned);
} else if (isDouble && isLong && (isComplex || isImaginery)) { } else if (isDouble && isLong && (isComplex || isImaginery)) {
return new DoubleType(vo, typename, isComplex, isImaginery, isLong); return new DoubleType(frame, typename, isComplex, isImaginery, isLong);
} }
} else if (count == 4) { } else if (count == 4) {
// ISOC allows permutation: // ISOC allows permutation:
@ -394,7 +394,7 @@ public class SourceManager extends Manager {
|| (third.equals("long") && fourth.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$ || (third.equals("long") && fourth.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$
if (isLongLong && isInt && (isSigned || unSigned)) { if (isLongLong && isInt && (isSigned || unSigned)) {
return new LongLongType(vo, typename, unSigned); return new LongLongType(frame, typename, unSigned);
} }
} }
throw new CDIException(CdiResources.getString("cdi.SourceManager.Unknown_type")); //$NON-NLS-1$ throw new CDIException(CdiResources.getString("cdi.SourceManager.Unknown_type")); //$NON-NLS-1$
@ -425,10 +425,9 @@ public class SourceManager extends Manager {
} }
} }
public String getTypeName(VariableObject vo, String variable) throws CDIException { public String getTypeName(ICDIStackFrame frame, String variable) throws CDIException {
Session session = (Session)getSession(); Session session = (Session)getSession();
ICDIStackFrame frame = vo.getStackFrame(); Target target = (Target)frame.getTarget();
Target target = (Target)vo.getTarget();
ICDIThread currentThread = null; ICDIThread currentThread = null;
ICDIStackFrame currentFrame = null; ICDIStackFrame currentFrame = null;
if (frame != null) { if (frame != null) {

View file

@ -15,11 +15,15 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources; import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.SourceManager;
import org.eclipse.cdt.debug.mi.core.cdi.model.type.IncompleteType;
import org.eclipse.cdt.debug.mi.core.cdi.model.type.Type;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory; import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIVarCreate; import org.eclipse.cdt.debug.mi.core.command.MIVarCreate;
import org.eclipse.cdt.debug.mi.core.command.MIVarDelete; import org.eclipse.cdt.debug.mi.core.command.MIVarDelete;
@ -35,6 +39,7 @@ public class Expression extends CObject implements ICDIExpression {
private int id; private int id;
String fExpression; String fExpression;
Variable fVariable; Variable fVariable;
Type fType;
public Expression(Target target, String ex) { public Expression(Target target, String ex) {
super(target); super(target);
@ -60,6 +65,41 @@ public class Expression extends CObject implements ICDIExpression {
return false; return false;
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#getType()
*/
public ICDIType getType(ICDIStackFrame frame) throws CDIException {
Type type = null;
Target target = (Target)getTarget();
Session session = (Session) (target.getSession());
SourceManager sourceMgr = session.getSourceManager();
String nametype = sourceMgr.getTypeName(frame, getExpressionText());
try {
type = sourceMgr.getType(frame, nametype);
} catch (CDIException e) {
// Try with ptype.
try {
String ptype = sourceMgr.getDetailTypeName(frame, nametype);
type = sourceMgr.getType(frame, ptype);
} catch (CDIException ex) {
// Some version of gdb does not work with the name of the class
// ex: class data foo --> ptype data --> fails
// ex: class data foo --> ptype foo --> succeed
try {
String ptype = sourceMgr.getDetailTypeName(frame, getExpressionText());
type = sourceMgr.getType(frame, ptype);
} catch (CDIException e2) {
// give up.
}
}
}
if (type == null) {
type = new IncompleteType(frame, nametype);
}
return type;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExpression#getValue(org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame) * @see org.eclipse.cdt.debug.core.cdi.model.ICDIExpression#getValue(org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame)
*/ */

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources; import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
@ -99,4 +100,11 @@ public class Value extends CObject implements ICDIValue {
return variable.getChildren(); return variable.getChildren();
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getType()
*/
public ICDIType getType() throws CDIException {
return variable.getType();
}
} }

View file

@ -167,28 +167,28 @@ public class VariableObject extends CObject implements ICDIVariableObject {
frame = target.getCurrentThread().getCurrentStackFrame(); frame = target.getCurrentThread().getCurrentStackFrame();
} }
SourceManager sourceMgr = session.getSourceManager(); SourceManager sourceMgr = session.getSourceManager();
String nametype = sourceMgr.getTypeName(this, getQualifiedName()); String nametype = sourceMgr.getTypeName(frame, getQualifiedName());
try { try {
type = sourceMgr.getType(this, nametype); type = sourceMgr.getType(frame, nametype);
} catch (CDIException e) { } catch (CDIException e) {
// Try with ptype. // Try with ptype.
try { try {
String ptype = sourceMgr.getDetailTypeName(frame, nametype); String ptype = sourceMgr.getDetailTypeName(frame, nametype);
type = sourceMgr.getType(this, ptype); type = sourceMgr.getType(frame, ptype);
} catch (CDIException ex) { } catch (CDIException ex) {
// Some version of gdb does not work woth the name of the class // Some version of gdb does not work woth the name of the class
// ex: class data foo --> ptype data --> fails // ex: class data foo --> ptype data --> fails
// ex: class data foo --> ptype foo --> succeed // ex: class data foo --> ptype foo --> succeed
try { try {
String ptype = sourceMgr.getDetailTypeName(frame, getQualifiedName()); String ptype = sourceMgr.getDetailTypeName(frame, getQualifiedName());
type = sourceMgr.getType(this, ptype); type = sourceMgr.getType(frame, ptype);
} catch (CDIException e2) { } catch (CDIException e2) {
// give up. // give up.
} }
} }
} }
if (type == null) { if (type == null) {
type = new IncompleteType(this, nametype); type = new IncompleteType(frame, nametype);
} }
} }
return type; return type;

View file

@ -11,14 +11,14 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIAggregateType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIAggregateType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
public abstract class AggregateType extends Type implements ICDIAggregateType { public abstract class AggregateType extends Type implements ICDIAggregateType {
public AggregateType(VariableObject vo, String typename) { public AggregateType(ICDIStackFrame frame, String typename) {
super(vo, typename); super(frame, typename);
} }
} }

View file

@ -11,9 +11,9 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -24,8 +24,8 @@ public class ArrayType extends DerivedType implements ICDIArrayType {
/** /**
* @param typename * @param typename
*/ */
public ArrayType(VariableObject vo, String typename,int dim) { public ArrayType(ICDIStackFrame frame, String typename,int dim) {
super(vo, typename); super(frame, typename);
dimension = dim; dimension = dim;
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIBoolType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIBoolType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,12 +21,12 @@ public class BoolType extends IntegralType implements ICDIBoolType {
/** /**
* @param typename * @param typename
*/ */
public BoolType(VariableObject vo, String typename) { public BoolType(ICDIStackFrame frame, String typename) {
this(vo, typename, false); this(frame, typename, false);
} }
public BoolType(VariableObject vo, String typename, boolean usigned) { public BoolType(ICDIStackFrame frame, String typename, boolean usigned) {
super(vo, typename, usigned); super(frame, typename, usigned);
} }
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDICharType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDICharType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,11 +21,11 @@ public class CharType extends IntegralType implements ICDICharType {
/** /**
* @param typename * @param typename
*/ */
public CharType(VariableObject vo, String typename) { public CharType(ICDIStackFrame frame, String typename) {
this(vo, typename, false); this(frame, typename, false);
} }
public CharType(VariableObject vo, String typename, boolean usigned) { public CharType(ICDIStackFrame frame, String typename, boolean usigned) {
super(vo, typename, usigned); super(frame, typename, usigned);
} }
} }

View file

@ -12,12 +12,12 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDerivedType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDerivedType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.SourceManager; import org.eclipse.cdt.debug.mi.core.cdi.SourceManager;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -25,8 +25,8 @@ public abstract class DerivedType extends Type implements ICDIDerivedType {
ICDIType derivedType; ICDIType derivedType;
public DerivedType(VariableObject vo, String typename) { public DerivedType(ICDIStackFrame frame, String typename) {
super(vo, typename); super(frame, typename);
} }
public void setComponentType(ICDIType dtype) { public void setComponentType(ICDIType dtype) {
@ -38,17 +38,17 @@ public abstract class DerivedType extends Type implements ICDIDerivedType {
Session session = (Session)target.getSession(); Session session = (Session)target.getSession();
SourceManager sourceMgr = session.getSourceManager(); SourceManager sourceMgr = session.getSourceManager();
try { try {
derivedType = sourceMgr.getType(getVariableObject(), name); derivedType = sourceMgr.getType(getStackFrame(), name);
} catch (CDIException e) { } catch (CDIException e) {
// Try after ptype. // Try after ptype.
try { try {
String ptype = sourceMgr.getDetailTypeName(getVariableObject().getStackFrame(), name); String ptype = sourceMgr.getDetailTypeName(getStackFrame(), name);
derivedType = sourceMgr.getType(getVariableObject(), ptype); derivedType = sourceMgr.getType(getStackFrame(), ptype);
} catch (CDIException ex) { } catch (CDIException ex) {
} }
} }
if (derivedType == null) { if (derivedType == null) {
derivedType = new IncompleteType(getVariableObject(), name); derivedType = new IncompleteType(getStackFrame(), name);
} }
} }
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDoubleType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDoubleType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,11 +21,11 @@ public class DoubleType extends FloatingPointType implements ICDIDoubleType {
/** /**
* @param typename * @param typename
*/ */
public DoubleType(VariableObject vo, String typename) { public DoubleType(ICDIStackFrame frame, String typename) {
this(vo, typename, false, false, false); this(frame, typename, false, false, false);
} }
public DoubleType(VariableObject vo, String typename, boolean isComplex, boolean isImg, boolean isLong) { public DoubleType(ICDIStackFrame frame, String typename, boolean isComplex, boolean isImg, boolean isLong) {
super(vo, typename, isComplex, isImg, isLong); super(frame, typename, isComplex, isImg, isLong);
} }
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIEnumType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIEnumType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,11 +21,11 @@ public class EnumType extends IntegralType implements ICDIEnumType {
/** /**
* @param typename * @param typename
*/ */
public EnumType(VariableObject vo, String typename) { public EnumType(ICDIStackFrame frame, String typename) {
this(vo, typename, false); this(frame, typename, false);
} }
public EnumType(VariableObject vo, String typename, boolean usigned) { public EnumType(ICDIStackFrame frame, String typename, boolean usigned) {
super(vo, typename, usigned); super(frame, typename, usigned);
} }
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,11 +21,11 @@ public class FloatType extends FloatingPointType implements ICDIFloatType {
/** /**
* @param typename * @param typename
*/ */
public FloatType(VariableObject vo, String typename) { public FloatType(ICDIStackFrame frame, String typename) {
this(vo, typename, false, false); this(frame, typename, false, false);
} }
public FloatType(VariableObject vo, String typename, boolean isComplex, boolean isImg) { public FloatType(ICDIStackFrame frame, String typename, boolean isComplex, boolean isImg) {
super(vo, typename, isComplex, isImg, false); super(frame, typename, isComplex, isImg, false);
} }
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -22,8 +22,8 @@ public abstract class FloatingPointType extends Type implements ICDIFloatingPoin
boolean imaginary; boolean imaginary;
boolean islong; boolean islong;
public FloatingPointType(VariableObject vo, String typename, boolean comp, boolean img, boolean l) { public FloatingPointType(ICDIStackFrame frame, String typename, boolean comp, boolean img, boolean l) {
super(vo, typename); super(frame, typename);
complex = comp; complex = comp;
imaginary = img; imaginary = img;
islong = l; islong = l;

View file

@ -11,9 +11,9 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFunctionType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFunctionType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,8 +21,8 @@ public class FunctionType extends DerivedType implements ICDIFunctionType {
String params = ""; //$NON-NLS-1$ String params = ""; //$NON-NLS-1$
public FunctionType(VariableObject vo, String typename) { public FunctionType(ICDIStackFrame frame, String typename) {
super(vo, typename); super(frame, typename);
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -11,9 +11,7 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
/** /**
*/ */
@ -22,8 +20,8 @@ public class IncompleteType extends Type {
/** /**
* @param name * @param name
*/ */
public IncompleteType(VariableObject vo, String name) { public IncompleteType(ICDIStackFrame frame, String name) {
super(vo, name); super(frame, name);
} }
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,12 +21,12 @@ public class IntType extends IntegralType implements ICDIIntType {
/** /**
* @param typename * @param typename
*/ */
public IntType(VariableObject vo, String typename) { public IntType(ICDIStackFrame frame, String typename) {
this(vo, typename, false); this(frame, typename, false);
} }
public IntType(VariableObject vo, String typename, boolean isUnsigned) { public IntType(ICDIStackFrame frame, String typename, boolean isUnsigned) {
super(vo, typename, isUnsigned); super(frame, typename, isUnsigned);
} }
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntegralType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntegralType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -20,8 +20,8 @@ public abstract class IntegralType extends Type implements ICDIIntegralType {
boolean unSigned; boolean unSigned;
public IntegralType(VariableObject vo, String typename, boolean isUnsigned) { public IntegralType(ICDIStackFrame frame, String typename, boolean isUnsigned) {
super(vo, typename); super(frame, typename);
unSigned = isUnsigned; unSigned = isUnsigned;
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongLongType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongLongType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,11 +21,11 @@ public class LongLongType extends IntegralType implements ICDILongLongType {
/** /**
* @param typename * @param typename
*/ */
public LongLongType(VariableObject vo, String typename) { public LongLongType(ICDIStackFrame frame, String typename) {
this(vo, typename, false); this(frame, typename, false);
} }
public LongLongType(VariableObject vo, String typename, boolean usigned) { public LongLongType(ICDIStackFrame frame, String typename, boolean usigned) {
super(vo, typename, usigned); super(frame, typename, usigned);
} }
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,11 +21,11 @@ public class LongType extends IntegralType implements ICDILongType {
/** /**
* @param typename * @param typename
*/ */
public LongType(VariableObject vo, String typename) { public LongType(ICDIStackFrame frame, String typename) {
this(vo, typename, false); this(frame, typename, false);
} }
public LongType(VariableObject vo, String typename, boolean usigned) { public LongType(ICDIStackFrame frame, String typename, boolean usigned) {
super(vo, typename, usigned); super(frame, typename, usigned);
} }
} }

View file

@ -11,16 +11,16 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
public class PointerType extends DerivedType implements ICDIPointerType { public class PointerType extends DerivedType implements ICDIPointerType {
public PointerType(VariableObject vo, String typename) { public PointerType(ICDIStackFrame frame, String typename) {
super(vo, typename); super(frame, typename);
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -11,9 +11,9 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -22,8 +22,8 @@ public class ReferenceType extends DerivedType implements ICDIReferenceType {
/** /**
* @param name * @param name
*/ */
public ReferenceType(VariableObject vo, String name) { public ReferenceType(ICDIStackFrame frame, String name) {
super(vo, name); super(frame, name);
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIShortType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIShortType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,11 +21,11 @@ public class ShortType extends IntegralType implements ICDIShortType {
/** /**
* @param typename * @param typename
*/ */
public ShortType(VariableObject vo, String typename) { public ShortType(ICDIStackFrame frame, String typename) {
this(vo, typename, false); this(frame, typename, false);
} }
public ShortType(VariableObject vo, String typename, boolean usigned) { public ShortType(ICDIStackFrame frame, String typename, boolean usigned) {
super(vo, typename, usigned); super(frame, typename, usigned);
} }
} }

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -21,8 +21,8 @@ public class StructType extends AggregateType implements ICDIStructType {
/** /**
* @param typename * @param typename
*/ */
public StructType(VariableObject vo, String typename) { public StructType(ICDIStackFrame frame, String typename) {
super(vo, typename); super(frame, typename);
} }

View file

@ -11,27 +11,27 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.model.CObject; import org.eclipse.cdt.debug.mi.core.cdi.model.CObject;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
public abstract class Type extends CObject implements ICDIType { public abstract class Type extends CObject implements ICDIType {
VariableObject fVariableObject; ICDIStackFrame fStackFrame;
String typename; String typename;
String detailName; String detailName;
public Type(VariableObject vo, String name) { public Type(ICDIStackFrame frame, String name) {
super((Target)vo.getTarget()); super((Target)frame.getTarget());
typename = name; typename = name;
fVariableObject = vo; fStackFrame = frame;
} }
public VariableObject getVariableObject() { public ICDIStackFrame getStackFrame() {
return fVariableObject; return fStackFrame;
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -11,14 +11,14 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIVoidType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIVoidType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
public class VoidType extends Type implements ICDIVoidType { public class VoidType extends Type implements ICDIVoidType {
public VoidType(VariableObject vo, String typename) { public VoidType(ICDIStackFrame frame, String typename) {
super(vo, typename); super(frame, typename);
} }
} }

View file

@ -12,8 +12,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type; package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharType;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
/** /**
*/ */
@ -22,11 +22,11 @@ public class WCharType extends IntegralType implements ICDIWCharType {
/** /**
* @param typename * @param typename
*/ */
public WCharType(VariableObject vo, String typename) { public WCharType(ICDIStackFrame frame, String typename) {
this(vo, typename, false); this(frame, typename, false);
} }
public WCharType(VariableObject vo, String typename, boolean usigned) { public WCharType(ICDIStackFrame frame, String typename, boolean usigned) {
super(vo, typename, usigned); super(frame, typename, usigned);
} }
} }