mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
2004-11-03 Alain Magloire
Partial fix for 77435 * cdi/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/VariableDescriptor.java
This commit is contained in:
parent
86af48c1f9
commit
2475ef9679
3 changed files with 52 additions and 19 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2004-11-03 Alain Magloire
|
||||||
|
Partial fix for 77435
|
||||||
|
* cdi/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java
|
||||||
|
* cdi/org/eclipse/cdt/debug/mi/core/cdi/model/VariableDescriptor.java
|
||||||
|
|
||||||
2004-11-02 Alain Magloire
|
2004-11-02 Alain Magloire
|
||||||
Refactor ICDIConfiguratio --> ICDISessionConfiguration and ICDITargetConfiguration
|
Refactor ICDIConfiguratio --> ICDISessionConfiguration and ICDITargetConfiguration
|
||||||
* cdi/org/eclipse/cdt/debug/core/cdi/Session.java
|
* cdi/org/eclipse/cdt/debug/core/cdi/Session.java
|
||||||
|
|
|
@ -125,10 +125,7 @@ public class VariableManager extends Manager {
|
||||||
if (vars[i].getName().equals(name)
|
if (vars[i].getName().equals(name)
|
||||||
&& vars[i].getCastingArrayStart() == v.getCastingArrayStart()
|
&& vars[i].getCastingArrayStart() == v.getCastingArrayStart()
|
||||||
&& vars[i].getCastingArrayEnd() == v.getCastingArrayEnd()
|
&& vars[i].getCastingArrayEnd() == v.getCastingArrayEnd()
|
||||||
&& ((vars[i].getCastingType() == null && v.getCastingType() == null)
|
&& VariableDescriptor.equalsCasting(vars[i], v)) {
|
||||||
|| (vars[i].getCastingType() != null
|
|
||||||
&& v.getCastingType() != null
|
|
||||||
&& vars[i].getCastingType().equals(v.getCastingType())))) {
|
|
||||||
// check threads
|
// check threads
|
||||||
ICDIThread thread = vars[i].getThread();
|
ICDIThread thread = vars[i].getThread();
|
||||||
if ((vthread == null && thread == null) ||
|
if ((vthread == null && thread == null) ||
|
||||||
|
@ -291,11 +288,16 @@ public class VariableManager extends Manager {
|
||||||
throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_variable_object")); //$NON-NLS-1$
|
throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_variable_object")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
String casting = varDesc.getCastingType();
|
String[] castings = varDesc.getCastingTypes();
|
||||||
if (casting != null && casting.length() > 0) {
|
if (castings == null) {
|
||||||
type = "(" + type + ")" + "(" + casting + " )"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
castings = new String[] { type };
|
||||||
|
} else {
|
||||||
|
String[] temp = new String[castings.length + 1];
|
||||||
|
System.arraycopy(castings, 0, temp, 0, castings.length);
|
||||||
|
temp[castings.length] = type;
|
||||||
|
castings = temp;
|
||||||
}
|
}
|
||||||
vo.setCastingType(type);
|
vo.setCastingTypes(castings);
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
|
||||||
public abstract class VariableDescriptor extends CObject implements ICDIVariableDescriptor {
|
public abstract class VariableDescriptor extends CObject implements ICDIVariableDescriptor {
|
||||||
|
|
||||||
// Casting info.
|
// Casting info.
|
||||||
String castingType;
|
String[] castingTypes;
|
||||||
int castingIndex;
|
int castingIndex;
|
||||||
int castingLength;
|
int castingLength;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ public abstract class VariableDescriptor extends CObject implements ICDIVariable
|
||||||
stackdepth = desc.getStackDepth();
|
stackdepth = desc.getStackDepth();
|
||||||
castingIndex = desc.getCastingArrayStart();
|
castingIndex = desc.getCastingArrayStart();
|
||||||
castingLength = desc.getCastingArrayEnd();
|
castingLength = desc.getCastingArrayEnd();
|
||||||
castingType = desc.getCastingType();
|
castingTypes = desc.getCastingTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
public VariableDescriptor(Target target, Thread thread, StackFrame stack, String n, String fn, int pos, int depth) {
|
public VariableDescriptor(Target target, Thread thread, StackFrame stack, String n, String fn, int pos, int depth) {
|
||||||
|
@ -103,11 +103,11 @@ public abstract class VariableDescriptor extends CObject implements ICDIVariable
|
||||||
return castingLength;
|
return castingLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCastingType(String t) {
|
public void setCastingTypes(String[] t) {
|
||||||
castingType = t;
|
castingTypes = t;
|
||||||
}
|
}
|
||||||
public String getCastingType() {
|
public String[] getCastingTypes() {
|
||||||
return castingType;
|
return castingTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,10 +128,22 @@ public abstract class VariableDescriptor extends CObject implements ICDIVariable
|
||||||
buffer.append(')');
|
buffer.append(')');
|
||||||
buffer.append('@').append(castingLength);
|
buffer.append('@').append(castingLength);
|
||||||
fn = buffer.toString();
|
fn = buffer.toString();
|
||||||
} else if (castingType != null && castingType.length() > 0) {
|
} else if (castingTypes != null && castingTypes.length > 0) {
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
buffer.append("((").append(castingType).append(')'); //$NON-NLS-1$
|
for (int i = 0; i < castingTypes.length; ++i) {
|
||||||
buffer.append(fn).append(')');
|
if (castingTypes[i] != null && castingTypes[i].length() > 0) {
|
||||||
|
if (buffer.length() == 0) {
|
||||||
|
buffer.append('(').append(castingTypes[i]).append(')');
|
||||||
|
buffer.append(fn);
|
||||||
|
} else {
|
||||||
|
buffer.insert(0, '(');
|
||||||
|
buffer.append(')');
|
||||||
|
StringBuffer b = new StringBuffer();
|
||||||
|
b.append('(').append(castingTypes[i]).append(')');
|
||||||
|
buffer.insert(0, b.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
fn = buffer.toString();
|
fn = buffer.toString();
|
||||||
}
|
}
|
||||||
return fn;
|
return fn;
|
||||||
|
@ -277,6 +289,21 @@ public abstract class VariableDescriptor extends CObject implements ICDIVariable
|
||||||
return qualifiedName;
|
return qualifiedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean equalsCasting(VariableDescriptor var1, VariableDescriptor var2) {
|
||||||
|
String[] castings1 = var1.getCastingTypes();
|
||||||
|
String[] castings2 = var2.getCastingTypes();
|
||||||
|
if (castings1 == null && castings2 == null) {
|
||||||
|
return true;
|
||||||
|
} else if (castings1 != null && castings2 != null && castings1.length == castings2.length) {
|
||||||
|
for (int i = 0; i < castings1.length; ++i) {
|
||||||
|
if (!castings1[i].equals(castings2[i])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor#equals(ICDIVariableDescriptor)
|
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor#equals(ICDIVariableDescriptor)
|
||||||
*/
|
*/
|
||||||
|
@ -286,8 +313,7 @@ public abstract class VariableDescriptor extends CObject implements ICDIVariable
|
||||||
if (desc.getName().equals(getName())
|
if (desc.getName().equals(getName())
|
||||||
&& desc.getCastingArrayStart() == getCastingArrayStart()
|
&& desc.getCastingArrayStart() == getCastingArrayStart()
|
||||||
&& desc.getCastingArrayEnd() == getCastingArrayEnd()
|
&& desc.getCastingArrayEnd() == getCastingArrayEnd()
|
||||||
&& ((desc.getCastingType() == null && getCastingType() == null)
|
&& equalsCasting(desc, this)) {
|
||||||
|| (desc.getCastingType() != null && getCastingType() != null && desc.getCastingType().equals(getCastingType())))) {
|
|
||||||
|
|
||||||
// Check the threads
|
// Check the threads
|
||||||
ICDIThread varThread = null;
|
ICDIThread varThread = null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue