Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Cortell2008-02-27 17:24:31 +0000
committerJohn Cortell2008-02-27 17:24:31 +0000
commit55635e6d2057adff0db4f264deb0d40d95e20547 (patch)
treea4f82dd9affd364ec4b69df06f508946d71a634b /debug/org.eclipse.cdt.debug.core
parent928c56b35e61d06a493e9c77d9f47c05a329681e (diff)
downloadorg.eclipse.cdt-55635e6d2057adff0db4f264deb0d40d95e20547.tar.gz
org.eclipse.cdt-55635e6d2057adff0db4f264deb0d40d95e20547.tar.xz
org.eclipse.cdt-55635e6d2057adff0db4f264deb0d40d95e20547.zip
Equip CVariable with a method to expose the underlying CDI object. Discussed with Mikhail and Ken in June 2007.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.core')
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java4
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CLocalVariable.java4
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java4
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java12
4 files changed, 24 insertions, 0 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java
index 95abe2f6784..8dc0579421b 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java
@@ -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;
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CLocalVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CLocalVariable.java
index ea5971c46e9..6bba9a296dd 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CLocalVariable.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CLocalVariable.java
@@ -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;
+ }
}
/**
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java
index a9a12036865..6f8416b1f95 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CRegister.java
@@ -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;
+ }
}
/**
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java
index 2ef152078cd..d138b5959f3 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java
@@ -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();
}

Back to the top