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

2004-11-19 Alain Magloire

No need for stackframe when creating the Type class,
	but rather use the target in the constructor.
This commit is contained in:
Alain Magloire 2004-11-19 03:38:57 +00:00
parent eecdc3e370
commit 052b582c19
28 changed files with 180 additions and 176 deletions

View file

@ -1,3 +1,7 @@
2004-11-19 Alain Magloire
No need for stackframe when creating the Type class,
but rather use the target in the constructor.
2004-11-19 Alain Magloire 2004-11-19 Alain Magloire
Fix for 78816 Fix for 78816
* src/org/eclipse/cdt/debug/mi/core/MIPlugin.java * src/org/eclipse/cdt/debug/mi/core/MIPlugin.java

View file

@ -42,14 +42,12 @@ public class FunctionFinished extends EndSteppingRange implements ICDIFunctionFi
public ICDIType getReturnType() throws CDIException { public ICDIType getReturnType() throws CDIException {
Session session = (Session)getSession(); Session session = (Session)getSession();
Target target = session.getTarget(fMIEvent.getMISession()); Target target = session.getTarget(fMIEvent.getMISession());
Thread thread = (Thread)target.getCurrentThread();
StackFrame frame = thread.getCurrentStackFrame();
String rType = fMIEvent.getReturnType(); String rType = fMIEvent.getReturnType();
if (rType == null || rType.length() == 0) { if (rType == null || rType.length() == 0) {
throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_type")); //$NON-NLS-1$ throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_type")); //$NON-NLS-1$
} }
SourceManager srcMgr = session.getSourceManager(); SourceManager srcMgr = session.getSourceManager();
return srcMgr.getType(frame, rType); return srcMgr.getType(target, rType);
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -183,7 +183,7 @@ public class SourceManager extends Manager {
public void update(Target target) throws CDIException { public void update(Target target) throws CDIException {
} }
public Type getType(StackFrame frame, String name) throws CDIException { public Type getType(Target target, String name) throws CDIException {
if (name == null) { if (name == null) {
name = new String(); name = new String();
} }
@ -201,21 +201,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(frame, gdbType.toString(), d); aType = new ArrayType(target, gdbType.toString(), d);
break; break;
case GDBType.FUNCTION: case GDBType.FUNCTION:
aType = new FunctionType(frame, gdbType.toString()); aType = new FunctionType(target, gdbType.toString());
break; break;
case GDBType.POINTER: case GDBType.POINTER:
aType = new PointerType(frame, gdbType.toString()); aType = new PointerType(target, gdbType.toString());
break; break;
case GDBType.REFERENCE: case GDBType.REFERENCE:
aType = new ReferenceType(frame, gdbType.toString()); aType = new ReferenceType(target, gdbType.toString());
break; break;
} }
gdbType = ((GDBDerivedType)gdbType).getChild(); gdbType = ((GDBDerivedType)gdbType).getChild();
} else { } else {
aType = toCDIType(frame, gdbType.toString()); aType = toCDIType(target, gdbType.toString());
gdbType = null; gdbType = null;
} }
if (type instanceof DerivedType) { if (type instanceof DerivedType) {
@ -233,7 +233,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(StackFrame frame, String name) throws CDIException { Type toCDIType(Target target, 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();
@ -242,50 +242,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(frame, typename); return new CharType(target, typename);
} else if (typename.equals("wchar_t")) { //$NON-NLS-1$ } else if (typename.equals("wchar_t")) { //$NON-NLS-1$
return new WCharType(frame, typename); return new WCharType(target, typename);
} else if (typename.equals("short")) { //$NON-NLS-1$ } else if (typename.equals("short")) { //$NON-NLS-1$
return new ShortType(frame, typename); return new ShortType(target, typename);
} else if (typename.equals("int")) { //$NON-NLS-1$ } else if (typename.equals("int")) { //$NON-NLS-1$
return new IntType(frame, typename); return new IntType(target, typename);
} else if (typename.equals("long")) { //$NON-NLS-1$ } else if (typename.equals("long")) { //$NON-NLS-1$
return new LongType(frame, typename); return new LongType(target, typename);
} else if (typename.equals("unsigned")) { //$NON-NLS-1$ } else if (typename.equals("unsigned")) { //$NON-NLS-1$
return new IntType(frame, typename, true); return new IntType(target, typename, true);
} else if (typename.equals("signed")) { //$NON-NLS-1$ } else if (typename.equals("signed")) { //$NON-NLS-1$
return new IntType(frame, typename); return new IntType(target, typename);
} else if (typename.equals("bool")) { //$NON-NLS-1$ } else if (typename.equals("bool")) { //$NON-NLS-1$
return new BoolType(frame, typename); return new BoolType(target, typename);
} else if (typename.equals("_Bool")) { //$NON-NLS-1$ } else if (typename.equals("_Bool")) { //$NON-NLS-1$
return new BoolType(frame, typename); return new BoolType(target, typename);
} else if (typename.equals("float")) { //$NON-NLS-1$ } else if (typename.equals("float")) { //$NON-NLS-1$
return new FloatType(frame, typename); return new FloatType(target, typename);
} else if (typename.equals("double")) { //$NON-NLS-1$ } else if (typename.equals("double")) { //$NON-NLS-1$
return new DoubleType(frame, typename); return new DoubleType(target, typename);
} else if (typename.equals("void")) { //$NON-NLS-1$ } else if (typename.equals("void")) { //$NON-NLS-1$
return new VoidType(frame, typename); return new VoidType(target, typename);
} else if (typename.equals("enum")) { //$NON-NLS-1$ } else if (typename.equals("enum")) { //$NON-NLS-1$
return new EnumType(frame, typename); return new EnumType(target, typename);
} else if (typename.equals("union")) { //$NON-NLS-1$ } else if (typename.equals("union")) { //$NON-NLS-1$
return new StructType(frame, typename); return new StructType(target, typename);
} else if (typename.equals("struct")) { //$NON-NLS-1$ } else if (typename.equals("struct")) { //$NON-NLS-1$
return new StructType(frame, typename); return new StructType(target, typename);
} else if (typename.equals("class")) { //$NON-NLS-1$ } else if (typename.equals("class")) { //$NON-NLS-1$
return new StructType(frame, typename); return new StructType(target, 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(frame, typename); return new CharType(target, typename);
} else if (typename.equals("int16_t")) { //$NON-NLS-1$ } else if (typename.equals("int16_t")) { //$NON-NLS-1$
return new ShortType(frame, typename); return new ShortType(target, typename);
} else if (typename.equals("int32_t")) { //$NON-NLS-1$ } else if (typename.equals("int32_t")) { //$NON-NLS-1$
return new LongType(frame, typename); return new LongType(target, typename);
} else if (typename.equals("int64_t")) { //$NON-NLS-1$ } else if (typename.equals("int64_t")) { //$NON-NLS-1$
return new LongLongType(frame, typename); return new LongLongType(target, typename);
} else if (typename.equals("int128_t")) { //$NON-NLS-1$ } else if (typename.equals("int128_t")) { //$NON-NLS-1$
return new IntType(frame, typename); // ???? return new IntType(target, typename); // ????
} }
@ -318,27 +318,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(frame, typename, isUnsigned); return new CharType(target, typename, isUnsigned);
} else if (isShort && (isSigned || isUnsigned)) { } else if (isShort && (isSigned || isUnsigned)) {
return new ShortType(frame, typename, isUnsigned); return new ShortType(target, typename, isUnsigned);
} else if (isInt && (isSigned || isUnsigned)) { } else if (isInt && (isSigned || isUnsigned)) {
return new IntType(frame, typename, isUnsigned); return new IntType(target, typename, isUnsigned);
} else if (isLong && (isInt || isSigned || isUnsigned)) { } else if (isLong && (isInt || isSigned || isUnsigned)) {
return new LongType(frame, typename, isUnsigned); return new LongType(target, typename, isUnsigned);
} else if (isLongLong) { } else if (isLongLong) {
return new LongLongType(frame, typename); return new LongLongType(target, typename);
} else if (isDouble && (isLong || isComplex || isImaginery)) { } else if (isDouble && (isLong || isComplex || isImaginery)) {
return new DoubleType(frame, typename, isComplex, isImaginery, isLong); return new DoubleType(target, typename, isComplex, isImaginery, isLong);
} else if (isFloat && (isComplex || isImaginery)) { } else if (isFloat && (isComplex || isImaginery)) {
return new FloatType(frame, typename, isComplex, isImaginery); return new FloatType(target, typename, isComplex, isImaginery);
} else if (isStruct) { } else if (isStruct) {
return new StructType(frame, typename); return new StructType(target, typename);
} else if (isClass) { } else if (isClass) {
return new StructType(frame, typename); return new StructType(target, typename);
} else if (isUnion) { } else if (isUnion) {
return new StructType(frame, typename); return new StructType(target, typename);
} else if (isEnum) { } else if (isEnum) {
return new EnumType(frame, typename); return new EnumType(target, 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
@ -366,13 +366,13 @@ public class SourceManager extends Manager {
if (isShort && isInt && (isSigned || unSigned)) { if (isShort && isInt && (isSigned || unSigned)) {
return new ShortType(frame, typename, unSigned); return new ShortType(target, typename, unSigned);
} else if (isLong && isInt && (isSigned || unSigned)) { } else if (isLong && isInt && (isSigned || unSigned)) {
return new LongType(frame, typename, unSigned); return new LongType(target, typename, unSigned);
} else if (isLongLong && (isSigned || unSigned)) { } else if (isLongLong && (isSigned || unSigned)) {
return new LongLongType(frame, typename, unSigned); return new LongLongType(target, typename, unSigned);
} else if (isDouble && isLong && (isComplex || isImaginery)) { } else if (isDouble && isLong && (isComplex || isImaginery)) {
return new DoubleType(frame, typename, isComplex, isImaginery, isLong); return new DoubleType(target, typename, isComplex, isImaginery, isLong);
} }
} else if (count == 4) { } else if (count == 4) {
// ISOC allows permutation: // ISOC allows permutation:
@ -392,18 +392,26 @@ 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(frame, typename, unSigned); return new LongLongType(target, 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$
} }
public String getDetailTypeName(StackFrame frame, String typename) throws CDIException { public String getDetailTypeNameFromVariable(StackFrame frame, String variable) throws CDIException {
Target target = (Target)frame.getTarget(); Target target = (Target)frame.getTarget();
Thread currentThread = (Thread)target.getCurrentThread(); Thread currentThread = (Thread)target.getCurrentThread();
StackFrame currentFrame = currentThread.getCurrentStackFrame(); StackFrame currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(frame.getThread(), false); target.setCurrentThread(frame.getThread(), false);
((Thread)frame.getThread()).setCurrentStackFrame(frame, false); ((Thread)frame.getThread()).setCurrentStackFrame(frame, false);
try {
return getDetailTypeName(target, variable);
} finally {
target.setCurrentThread(currentThread, false);
currentThread.setCurrentStackFrame(currentFrame, false);
}
}
public String getDetailTypeName(Target target, String typename) throws CDIException {
try { try {
MISession mi = target.getMISession(); MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
@ -416,13 +424,10 @@ public class SourceManager extends Manager {
return info.getType(); return info.getType();
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
} finally {
target.setCurrentThread(currentThread, false);
currentThread.setCurrentStackFrame(currentFrame, false);
} }
} }
public String getTypeName(StackFrame frame, String variable) throws CDIException { public String getTypeNameFromVariable(StackFrame frame, String variable) throws CDIException {
Target target = (Target)frame.getTarget(); Target target = (Target)frame.getTarget();
Thread currentThread = null; Thread currentThread = null;
StackFrame currentFrame = null; StackFrame currentFrame = null;

View file

@ -548,7 +548,13 @@ public class VariableManager extends Manager {
// Fire a destroyEvent ? // Fire a destroyEvent ?
Target target = (Target)variable.getTarget(); Target target = (Target)variable.getTarget();
MISession mi = target.getMISession(); MISession mi = target.getMISession();
removeMIVar(mi, variable.getMIVar()); // no need to call -var-delete for variable that are not in
// the list most probaby they are children of other variables and in this case
// we should not delete them
List varList = getVariablesList(target);
if (varList.contains(variable)) {
removeMIVar(mi, variable.getMIVar());
}
MIVarDeletedEvent del = new MIVarDeletedEvent(mi, variable.getMIVar().getVarName()); MIVarDeletedEvent del = new MIVarDeletedEvent(mi, variable.getMIVar().getVarName());
mi.fireEvent(del); mi.fireEvent(del);
} }

View file

@ -63,28 +63,28 @@ public class Expression extends CObject implements ICDIExpression {
Target target = (Target)getTarget(); Target target = (Target)getTarget();
Session session = (Session) (target.getSession()); Session session = (Session) (target.getSession());
SourceManager sourceMgr = session.getSourceManager(); SourceManager sourceMgr = session.getSourceManager();
String nametype = sourceMgr.getTypeName((StackFrame)frame, getExpressionText()); String nametype = sourceMgr.getTypeNameFromVariable((StackFrame)frame, getExpressionText());
try { try {
type = sourceMgr.getType((StackFrame)frame, nametype); type = sourceMgr.getType(target, nametype);
} catch (CDIException e) { } catch (CDIException e) {
// Try with ptype. // Try with ptype.
try { try {
String ptype = sourceMgr.getDetailTypeName((StackFrame)frame, nametype); String ptype = sourceMgr.getDetailTypeName(target, nametype);
type = sourceMgr.getType((StackFrame)frame, ptype); type = sourceMgr.getType(target, ptype);
} catch (CDIException ex) { } catch (CDIException ex) {
// Some version of gdb does not work with the name of the class // 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 data --> fails
// ex: class data foo --> ptype foo --> succeed // ex: class data foo --> ptype foo --> succeed
try { try {
String ptype = sourceMgr.getDetailTypeName((StackFrame)frame, getExpressionText()); String ptype = sourceMgr.getDetailTypeNameFromVariable((StackFrame)frame, getExpressionText());
type = sourceMgr.getType((StackFrame)frame, ptype); type = sourceMgr.getType(target, ptype);
} catch (CDIException e2) { } catch (CDIException e2) {
// give up. // give up.
} }
} }
} }
if (type == null) { if (type == null) {
type = new IncompleteType((StackFrame)frame, nametype); type = new IncompleteType(target, nametype);
} }
return type; return type;

View file

@ -170,38 +170,38 @@ public abstract class VariableDescriptor extends CObject implements ICDIVariable
if (fType == null) { if (fType == null) {
String nametype = getTypeName(); String nametype = getTypeName();
Target target = (Target)getTarget(); Target target = (Target)getTarget();
StackFrame frame = (StackFrame)getStackFrame();
if (frame == null) {
Thread thread = (Thread)getThread();
if (thread != null) {
frame = thread.getCurrentStackFrame();
} else {
frame = ((Thread)target.getCurrentThread()).getCurrentStackFrame();
}
}
Session session = (Session) target.getSession(); Session session = (Session) target.getSession();
SourceManager sourceMgr = session.getSourceManager(); SourceManager sourceMgr = session.getSourceManager();
try { try {
fType = sourceMgr.getType(frame, nametype); fType = sourceMgr.getType(target, 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(target, nametype);
fType = sourceMgr.getType(frame, ptype); fType = sourceMgr.getType(target, 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 on 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
StackFrame frame = (StackFrame)getStackFrame();
if (frame == null) {
Thread thread = (Thread)getThread();
if (thread != null) {
frame = thread.getCurrentStackFrame();
} else {
frame = ((Thread)target.getCurrentThread()).getCurrentStackFrame();
}
}
try { try {
String ptype = sourceMgr.getDetailTypeName(frame, getQualifiedName()); String ptype = sourceMgr.getDetailTypeNameFromVariable(frame, getQualifiedName());
fType = sourceMgr.getType(frame, ptype); fType = sourceMgr.getType(target, ptype);
} catch (CDIException e2) { } catch (CDIException e2) {
// give up. // give up.
} }
} }
} }
if (fType == null) { if (fType == null) {
fType = new IncompleteType(frame, nametype); fType = new IncompleteType(target, nametype);
} }
} }
return fType; return fType;
@ -284,7 +284,7 @@ public abstract class VariableDescriptor extends CObject implements ICDIVariable
} }
Session session = (Session) target.getSession(); Session session = (Session) target.getSession();
SourceManager sourceMgr = session.getSourceManager(); SourceManager sourceMgr = session.getSourceManager();
fTypename = sourceMgr.getTypeName(frame, getQualifiedName()); fTypename = sourceMgr.getTypeNameFromVariable(frame, getQualifiedName());
} }
return fTypename; return fTypename;
} }

View file

@ -12,13 +12,13 @@
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.type.ICDIAggregateType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIAggregateType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
public abstract class AggregateType extends Type implements ICDIAggregateType { public abstract class AggregateType extends Type implements ICDIAggregateType {
public AggregateType(StackFrame frame, String typename) { public AggregateType(Target target, String typename) {
super(frame, typename); super(target, typename);
} }
} }

View file

@ -13,7 +13,7 @@ package org.eclipse.cdt.debug.mi.core.cdi.model.type;
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.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -24,8 +24,8 @@ public class ArrayType extends DerivedType implements ICDIArrayType {
/** /**
* @param typename * @param typename
*/ */
public ArrayType(StackFrame frame, String typename,int dim) { public ArrayType(Target target, String typename,int dim) {
super(frame, typename); super(target, typename);
dimension = dim; dimension = dim;
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDIBoolType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIBoolType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,12 +21,12 @@ public class BoolType extends IntegralType implements ICDIBoolType {
/** /**
* @param typename * @param typename
*/ */
public BoolType(StackFrame frame, String typename) { public BoolType(Target target, String typename) {
this(frame, typename, false); this(target, typename, false);
} }
public BoolType(StackFrame frame, String typename, boolean usigned) { public BoolType(Target target, String typename, boolean usigned) {
super(frame, typename, usigned); super(target, typename, usigned);
} }
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDICharType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDICharType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,11 +21,11 @@ public class CharType extends IntegralType implements ICDICharType {
/** /**
* @param typename * @param typename
*/ */
public CharType(StackFrame frame, String typename) { public CharType(Target target, String typename) {
this(frame, typename, false); this(target, typename, false);
} }
public CharType(StackFrame frame, String typename, boolean usigned) { public CharType(Target target, String typename, boolean usigned) {
super(frame, typename, usigned); super(target, typename, usigned);
} }
} }

View file

@ -16,7 +16,6 @@ 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.StackFrame;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
@ -25,8 +24,8 @@ public abstract class DerivedType extends Type implements ICDIDerivedType {
ICDIType derivedType; ICDIType derivedType;
public DerivedType(StackFrame frame, String typename) { public DerivedType(Target target, String typename) {
super(frame, typename); super(target, typename);
} }
public void setComponentType(ICDIType dtype) { public void setComponentType(ICDIType dtype) {
@ -38,17 +37,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((StackFrame)getStackFrame(), name); derivedType = sourceMgr.getType((Target)getTarget(), name);
} catch (CDIException e) { } catch (CDIException e) {
// Try after ptype. // Try after ptype.
try { try {
String ptype = sourceMgr.getDetailTypeName((StackFrame)getStackFrame(), name); String ptype = sourceMgr.getDetailTypeName((Target)getTarget(), name);
derivedType = sourceMgr.getType((StackFrame)getStackFrame(), ptype); derivedType = sourceMgr.getType((Target)getTarget(), ptype);
} catch (CDIException ex) { } catch (CDIException ex) {
} }
} }
if (derivedType == null) { if (derivedType == null) {
derivedType = new IncompleteType((StackFrame)getStackFrame(), name); derivedType = new IncompleteType((Target)getTarget(), name);
} }
} }
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDIDoubleType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDoubleType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,11 +21,11 @@ public class DoubleType extends FloatingPointType implements ICDIDoubleType {
/** /**
* @param typename * @param typename
*/ */
public DoubleType(StackFrame frame, String typename) { public DoubleType(Target target, String typename) {
this(frame, typename, false, false, false); this(target, typename, false, false, false);
} }
public DoubleType(StackFrame frame, String typename, boolean isComplex, boolean isImg, boolean isLong) { public DoubleType(Target target, String typename, boolean isComplex, boolean isImg, boolean isLong) {
super(frame, typename, isComplex, isImg, isLong); super(target, typename, isComplex, isImg, isLong);
} }
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDIEnumType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIEnumType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,11 +21,11 @@ public class EnumType extends IntegralType implements ICDIEnumType {
/** /**
* @param typename * @param typename
*/ */
public EnumType(StackFrame frame, String typename) { public EnumType(Target target, String typename) {
this(frame, typename, false); this(target, typename, false);
} }
public EnumType(StackFrame frame, String typename, boolean usigned) { public EnumType(Target target, String typename, boolean usigned) {
super(frame, typename, usigned); super(target, typename, usigned);
} }
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDIFloatType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,11 +21,11 @@ public class FloatType extends FloatingPointType implements ICDIFloatType {
/** /**
* @param typename * @param typename
*/ */
public FloatType(StackFrame frame, String typename) { public FloatType(Target target, String typename) {
this(frame, typename, false, false); this(target, typename, false, false);
} }
public FloatType(StackFrame frame, String typename, boolean isComplex, boolean isImg) { public FloatType(Target target, String typename, boolean isComplex, boolean isImg) {
super(frame, typename, isComplex, isImg, false); super(target, typename, isComplex, isImg, false);
} }
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDIFloatingPointType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -22,8 +22,8 @@ public abstract class FloatingPointType extends Type implements ICDIFloatingPoin
boolean imaginary; boolean imaginary;
boolean islong; boolean islong;
public FloatingPointType(StackFrame frame, String typename, boolean comp, boolean img, boolean l) { public FloatingPointType(Target target, String typename, boolean comp, boolean img, boolean l) {
super(frame, typename); super(target, typename);
complex = comp; complex = comp;
imaginary = img; imaginary = img;
islong = l; islong = l;

View file

@ -13,7 +13,7 @@ package org.eclipse.cdt.debug.mi.core.cdi.model.type;
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.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,8 +21,8 @@ public class FunctionType extends DerivedType implements ICDIFunctionType {
String params = ""; //$NON-NLS-1$ String params = ""; //$NON-NLS-1$
public FunctionType(StackFrame frame, String typename) { public FunctionType(Target target, String typename) {
super(frame, typename); super(target, typename);
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -11,7 +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.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -20,8 +20,8 @@ public class IncompleteType extends Type {
/** /**
* @param name * @param name
*/ */
public IncompleteType(StackFrame frame, String name) { public IncompleteType(Target target, String name) {
super(frame, name); super(target, name);
} }
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDIIntType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,12 +21,12 @@ public class IntType extends IntegralType implements ICDIIntType {
/** /**
* @param typename * @param typename
*/ */
public IntType(StackFrame frame, String typename) { public IntType(Target target, String typename) {
this(frame, typename, false); this(target, typename, false);
} }
public IntType(StackFrame frame, String typename, boolean isUnsigned) { public IntType(Target target, String typename, boolean isUnsigned) {
super(frame, typename, isUnsigned); super(target, typename, isUnsigned);
} }
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDIIntegralType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntegralType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -20,8 +20,8 @@ public abstract class IntegralType extends Type implements ICDIIntegralType {
boolean unSigned; boolean unSigned;
public IntegralType(StackFrame frame, String typename, boolean isUnsigned) { public IntegralType(Target target, String typename, boolean isUnsigned) {
super(frame, typename); super(target, typename);
unSigned = isUnsigned; unSigned = isUnsigned;
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDILongLongType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongLongType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,11 +21,11 @@ public class LongLongType extends IntegralType implements ICDILongLongType {
/** /**
* @param typename * @param typename
*/ */
public LongLongType(StackFrame frame, String typename) { public LongLongType(Target target, String typename) {
this(frame, typename, false); this(target, typename, false);
} }
public LongLongType(StackFrame frame, String typename, boolean usigned) { public LongLongType(Target target, String typename, boolean usigned) {
super(frame, typename, usigned); super(target, typename, usigned);
} }
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDILongType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,11 +21,11 @@ public class LongType extends IntegralType implements ICDILongType {
/** /**
* @param typename * @param typename
*/ */
public LongType(StackFrame frame, String typename) { public LongType(Target target, String typename) {
this(frame, typename, false); this(target, typename, false);
} }
public LongType(StackFrame frame, String typename, boolean usigned) { public LongType(Target target, String typename, boolean usigned) {
super(frame, typename, usigned); super(target, typename, usigned);
} }
} }

View file

@ -13,14 +13,14 @@ package org.eclipse.cdt.debug.mi.core.cdi.model.type;
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.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
public class PointerType extends DerivedType implements ICDIPointerType { public class PointerType extends DerivedType implements ICDIPointerType {
public PointerType(StackFrame frame, String typename) { public PointerType(Target target, String typename) {
super(frame, typename); super(target, typename);
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -13,7 +13,7 @@ package org.eclipse.cdt.debug.mi.core.cdi.model.type;
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.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -22,8 +22,8 @@ public class ReferenceType extends DerivedType implements ICDIReferenceType {
/** /**
* @param name * @param name
*/ */
public ReferenceType(StackFrame frame, String name) { public ReferenceType(Target target, String name) {
super(frame, name); super(target, name);
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -12,7 +12,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.core.cdi.model.type.ICDIShortType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIShortType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,11 +21,11 @@ public class ShortType extends IntegralType implements ICDIShortType {
/** /**
* @param typename * @param typename
*/ */
public ShortType(StackFrame frame, String typename) { public ShortType(Target target, String typename) {
this(frame, typename, false); this(target, typename, false);
} }
public ShortType(StackFrame frame, String typename, boolean usigned) { public ShortType(Target target, String typename, boolean usigned) {
super(frame, typename, usigned); super(target, typename, usigned);
} }
} }

View file

@ -12,7 +12,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.core.cdi.model.type.ICDIStructType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -21,8 +21,8 @@ public class StructType extends AggregateType implements ICDIStructType {
/** /**
* @param typename * @param typename
*/ */
public StructType(StackFrame frame, String typename) { public StructType(Target target, String typename) {
super(frame, typename); super(target, typename);
} }

View file

@ -11,28 +11,20 @@
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.StackFrame;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
public abstract class Type extends CObject implements ICDIType { public abstract class Type extends CObject implements ICDIType {
StackFrame fStackFrame;
String typename; String typename;
String detailName; String detailName;
public Type(StackFrame frame, String name) { public Type(Target target, String name) {
super((Target)frame.getTarget()); super(target);
typename = name; typename = name;
fStackFrame = frame;
}
public ICDIStackFrame getStackFrame() {
return fStackFrame;
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -12,16 +12,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.type.ICDIVoidType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIVoidType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
public class VoidType extends Type implements ICDIVoidType { public class VoidType extends Type implements ICDIVoidType {
public VoidType(StackFrame frame) { public VoidType(Target target) {
this(frame, "void"); //$NON-NLS-1$ this(target, "void"); //$NON-NLS-1$
} }
public VoidType(StackFrame frame, String typename) { public VoidType(Target target, String typename) {
super(frame, typename); super(target, typename);
} }
} }

View file

@ -13,7 +13,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.core.cdi.model.type.ICDIWCharType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame; import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/** /**
*/ */
@ -22,11 +22,11 @@ public class WCharType extends IntegralType implements ICDIWCharType {
/** /**
* @param typename * @param typename
*/ */
public WCharType(StackFrame frame, String typename) { public WCharType(Target target, String typename) {
this(frame, typename, false); this(target, typename, false);
} }
public WCharType(StackFrame frame, String typename, boolean usigned) { public WCharType(Target target, String typename, boolean usigned) {
super(frame, typename, usigned); super(target, typename, usigned);
} }
} }