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

Equip CVariable with a method to expose the underlying CDI object. Discussed with Mikhail and Ken in June 2007.

This commit is contained in:
John Cortell 2008-02-27 17:24:31 +00:00
parent 928c56b35e
commit 55635e6d20
4 changed files with 24 additions and 0 deletions

View file

@ -312,6 +312,10 @@ public class CGlobalVariable extends CVariable implements ICGlobalVariable {
public boolean isSameDescriptor( ICDIVariableDescriptor desc ) {
return getCDIVariableObject().equals( desc );
}
public ICDIObject getCdiObject() {
return fCDIVariable;
}
}
private IGlobalVariableDescriptor fDescriptor;

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.debug.internal.core.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDILocalVariableDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration2;
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
@ -304,6 +305,9 @@ public class CLocalVariable extends CVariable {
public boolean isSameDescriptor( ICDIVariableDescriptor desc ) {
return getCDIVariableObject().equals( desc );
}
public ICDIObject getCdiObject() {
return fCDIVariable;
}
}
/**

View file

@ -318,6 +318,10 @@ public class CRegister extends CVariable implements ICRegister {
public boolean isSameDescriptor( ICDIVariableDescriptor desc ) {
return getCDIVariableObject().equals( desc );
}
public ICDIObject getCdiObject() {
return fCDIRegister;
}
}
/**

View file

@ -61,6 +61,10 @@ public abstract class CVariable extends AbstractCVariable implements ICDIEventLi
int sizeof();
void invalidateValue();
void preserve();
// Note: the CDI object association can change; e.g., if a "Cast to Type"
// or "Display as Array" is done on the element.
ICDIObject getCdiObject();
}
/**
@ -636,6 +640,14 @@ public abstract class CVariable extends AbstractCVariable implements ICDIEventLi
fName = name;
}
public ICDIObject getCdiObject() {
IInternalVariable iv = getCurrentInternalVariable();
if ( iv != null ) {
return iv.getCdiObject();
}
return null;
}
protected CSettingsManager getFormatManager() {
return ((CDebugTarget) getDebugTarget()).getFormatManager();
}