mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 17:55:39 +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:
parent
928c56b35e
commit
55635e6d20
4 changed files with 24 additions and 0 deletions
|
@ -312,6 +312,10 @@ public class CGlobalVariable extends CVariable implements ICGlobalVariable {
|
||||||
public boolean isSameDescriptor( ICDIVariableDescriptor desc ) {
|
public boolean isSameDescriptor( ICDIVariableDescriptor desc ) {
|
||||||
return getCDIVariableObject().equals( desc );
|
return getCDIVariableObject().equals( desc );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICDIObject getCdiObject() {
|
||||||
|
return fCDIVariable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IGlobalVariableDescriptor fDescriptor;
|
private IGlobalVariableDescriptor fDescriptor;
|
||||||
|
|
|
@ -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.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentDescriptor;
|
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.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.ICDITargetConfiguration2;
|
||||||
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;
|
||||||
|
@ -304,6 +305,9 @@ public class CLocalVariable extends CVariable {
|
||||||
public boolean isSameDescriptor( ICDIVariableDescriptor desc ) {
|
public boolean isSameDescriptor( ICDIVariableDescriptor desc ) {
|
||||||
return getCDIVariableObject().equals( desc );
|
return getCDIVariableObject().equals( desc );
|
||||||
}
|
}
|
||||||
|
public ICDIObject getCdiObject() {
|
||||||
|
return fCDIVariable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -318,6 +318,10 @@ public class CRegister extends CVariable implements ICRegister {
|
||||||
public boolean isSameDescriptor( ICDIVariableDescriptor desc ) {
|
public boolean isSameDescriptor( ICDIVariableDescriptor desc ) {
|
||||||
return getCDIVariableObject().equals( desc );
|
return getCDIVariableObject().equals( desc );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICDIObject getCdiObject() {
|
||||||
|
return fCDIRegister;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -61,6 +61,10 @@ public abstract class CVariable extends AbstractCVariable implements ICDIEventLi
|
||||||
int sizeof();
|
int sizeof();
|
||||||
void invalidateValue();
|
void invalidateValue();
|
||||||
void preserve();
|
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;
|
fName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICDIObject getCdiObject() {
|
||||||
|
IInternalVariable iv = getCurrentInternalVariable();
|
||||||
|
if ( iv != null ) {
|
||||||
|
return iv.getCdiObject();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
protected CSettingsManager getFormatManager() {
|
protected CSettingsManager getFormatManager() {
|
||||||
return ((CDebugTarget) getDebugTarget()).getFormatManager();
|
return ((CDebugTarget) getDebugTarget()).getFormatManager();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue