1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 11:55:40 +02:00

Check for ICDIArgument and ICDIVariable

This commit is contained in:
Alain Magloire 2003-03-14 16:23:18 +00:00
parent 7f590106ed
commit 22bf3e3fd6

View file

@ -145,8 +145,13 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#createArgument(ICDIArgumentObject) * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#createArgument(ICDIArgumentObject)
*/ */
public ICDIArgument createArgument(ICDIArgumentObject a) throws CDIException { public ICDIArgument createArgument(ICDIArgumentObject a) throws CDIException {
ArgumentObject argObj = null;
if (a instanceof ArgumentObject) { if (a instanceof ArgumentObject) {
ArgumentObject argObj = (ArgumentObject)a; argObj = (ArgumentObject)a;
} else if (a instanceof Argument) {
argObj = ((Argument)a).getArgumentObject();
}
if (argObj != null) {
Variable variable = findVariable(argObj); Variable variable = findVariable(argObj);
Argument argument = null; Argument argument = null;
if (variable != null && variable instanceof Argument) { if (variable != null && variable instanceof Argument) {
@ -287,8 +292,13 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjectAsArray(ICDIVariableObject, String, int, int) * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjectAsArray(ICDIVariableObject, String, int, int)
*/ */
public ICDIVariableObject getVariableObjectAsArray(ICDIVariableObject object, String type, int start, int end) throws CDIException { public ICDIVariableObject getVariableObjectAsArray(ICDIVariableObject object, String type, int start, int end) throws CDIException {
VariableObject obj = null;
if (object instanceof VariableObject) { if (object instanceof VariableObject) {
VariableObject obj = (VariableObject)object; obj = (VariableObject)object;
} else if (object instanceof Variable) {
obj = ((Variable)object).getVariableObject();
}
if (obj != null) {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("*("); buffer.append("*(");
buffer.append('('); buffer.append('(');
@ -324,8 +334,13 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjectAsArray(ICDIVariableObject, String, int, int) * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjectAsArray(ICDIVariableObject, String, int, int)
*/ */
public ICDIVariableObject getVariableObjectAsType(ICDIVariableObject object, String type) throws CDIException { public ICDIVariableObject getVariableObjectAsType(ICDIVariableObject object, String type) throws CDIException {
VariableObject obj = null;
if (object instanceof VariableObject) { if (object instanceof VariableObject) {
VariableObject obj = (VariableObject)object; obj = (VariableObject)object;
} else if (object instanceof Variable) {
obj = ((Variable)object).getVariableObject();
}
if (obj != null) {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
if (type != null && type.length() > 0) { if (type != null && type.length() > 0) {
// Check if the type is valid. // Check if the type is valid.
@ -405,8 +420,14 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#createVariable(ICDIVariableObject) * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#createVariable(ICDIVariableObject)
*/ */
public ICDIVariable createVariable(ICDIVariableObject v) throws CDIException { public ICDIVariable createVariable(ICDIVariableObject v) throws CDIException {
VariableObject varObj = null;
if (v instanceof VariableObject) { if (v instanceof VariableObject) {
VariableObject varObj = (VariableObject)v; varObj = (VariableObject)v;
}
if (v instanceof Variable) {
varObj = ((Variable)v).getVariableObject();
}
if (varObj != null) {
Variable variable = findVariable(varObj); Variable variable = findVariable(varObj);
if (variable == null) { if (variable == null) {
String name = varObj.getName(); String name = varObj.getName();