1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-19 06:55:23 +02:00

2005-06-27 Alain Magloire

Fix PR 100069
	* cdi/org/eclipse/cdt/debug/mi/core/cdi/Location.java
	* cdi/org/eclipse/cdt/debug/mi/core/cdi/Locator.java
	* cdi/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java
This commit is contained in:
Alain Magloire 2005-06-27 19:34:33 +00:00
parent e931e4a547
commit 0e98d98601
4 changed files with 19 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2005-06-27 Alain Magloire
Fix PR 100069
* cdi/org/eclipse/cdt/debug/mi/core/cdi/Location.java
* cdi/org/eclipse/cdt/debug/mi/core/cdi/Locator.java
* cdi/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java
2005-06-27 Alain Magloire 2005-06-27 Alain Magloire
Refactor the class extending CLICommand to CLIXXXX for more clarity. Refactor the class extending CLICommand to CLIXXXX for more clarity.
Pass the MIVersion in all of the class extending MICommand, this is Pass the MIVersion in all of the class extending MICommand, this is

View file

@ -20,7 +20,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocation;
/** /**
*/ */
public class Location /*implements ICDIFunctionLocation, ICDIAddressLocation */{ public abstract class Location {
BigInteger fAddress = null; BigInteger fAddress = null;
String fFile = null; String fFile = null;

View file

@ -43,7 +43,7 @@ public class Locator extends Location implements ICDILocator {
return false; return false;
} }
boolean equalString(String f1, String f2) { public static boolean equalString(String f1, String f2) {
if (f1 != null && f1.length() > 0 && f2 != null && f2.length() > 0) { if (f1 != null && f1.length() > 0 && f2 != null && f2.length() > 0) {
return f1.equals(f2); return f1.equals(f2);
} else if ((f1 == null || f1.length() == 0) && (f2 == null || f2.length() == 0)) { } else if ((f1 == null || f1.length() == 0) && (f2 == null || f2.length() == 0)) {

View file

@ -143,10 +143,18 @@ public class StackFrame extends CObject implements ICDIStackFrame {
public boolean equals(ICDIStackFrame stackframe) { public boolean equals(ICDIStackFrame stackframe) {
if (stackframe instanceof StackFrame) { if (stackframe instanceof StackFrame) {
StackFrame stack = (StackFrame)stackframe; StackFrame stack = (StackFrame)stackframe;
return cthread != null && boolean equal = cthread != null &&
cthread.equals(stack.getThread()) && cthread.equals(stack.getThread()) &&
getLevel() == stack.getLevel() && getLevel() == stack.getLevel();
getLocator().equals(stack.getLocator()); if (equal) {
ICDILocator otherLocator = stack.getLocator();
ICDILocator myLocator = getLocator();
if (Locator.equalString(myLocator.getFile(), otherLocator.getFile())) {
if (Locator.equalString(myLocator.getFunction(), otherLocator.getFunction())) {
return true;
}
}
}
} }
return super.equals(stackframe); return super.equals(stackframe);
} }