1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-17 21:25:58 +02:00

Call ptype as a fallback

This commit is contained in:
Alain Magloire 2003-05-25 02:30:12 +00:00
parent 7a4f1833a5
commit ed9a85d9b7

View file

@ -8,6 +8,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.ICDIVariableManager; import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager;
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.ICDITarget;
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.ICDIArrayType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType;
@ -169,11 +170,11 @@ public class Variable extends CObject implements ICDIVariable {
//value = new FunctionValue(this); //value = new FunctionValue(this);
value = new Value(this); value = new Value(this);
} else if (t instanceof ICDIPointerType) { } else if (t instanceof ICDIPointerType) {
((ICDIPointerType)t).getComponentType(); //((ICDIPointerType)t).getComponentType();
//value = new PointerValue(this); //value = new PointerValue(this);
value = new Value(this); value = new Value(this);
} else if (t instanceof ICDIArrayType) { } else if (t instanceof ICDIArrayType) {
((ICDIArrayType)t).getComponentType(); //((ICDIArrayType)t).getComponentType();
//value = new ArrayValue(this); //value = new ArrayValue(this);
value = new Value(this); value = new Value(this);
} else if (t instanceof ICDIStructType) { } else if (t instanceof ICDIStructType) {
@ -285,20 +286,22 @@ public class Variable extends CObject implements ICDIVariable {
*/ */
public ICDIType getType() throws CDIException { public ICDIType getType() throws CDIException {
if (type == null) { if (type == null) {
Session session = (Session)(getTarget().getSession()); ICDITarget target = getTarget();
Session session = (Session)(target.getSession());
SourceManager sourceMgr = (SourceManager)session.getSourceManager(); SourceManager sourceMgr = (SourceManager)session.getSourceManager();
String typename = getTypeName(); String typename = getTypeName();
try { try {
type = sourceMgr.getType(getTarget(), typename); type = sourceMgr.getType(target, typename);
} catch (CDIException e) { } catch (CDIException e) {
type = new IncompleteType(getTarget(), typename); // Try with ptype.
// // Try after ptype. try {
// String ptype = sourceMgr.getDetailTypeName(typename); String ptype = sourceMgr.getDetailTypeName(typename);
// try { type = sourceMgr.getType(target, ptype);
// type = sourceMgr.getType(ptype); } catch (CDIException ex) {
// } catch (CDIException ex) { }
// type = new IncompleteType(typename); }
// } if (type == null) {
type = new IncompleteType(target, typename);
} }
} }
return type; return type;