mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Provide equality for :
file:linenumber and file:functioname
This commit is contained in:
parent
4eb6c43261
commit
734438b514
1 changed files with 19 additions and 14 deletions
|
@ -10,12 +10,6 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocation;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author alain
|
|
||||||
*
|
|
||||||
* To change this generated comment edit the template variable "typecomment":
|
|
||||||
* Window>Preferences>Java>Templates.
|
|
||||||
* To enable and disable the creation of type comments go to
|
|
||||||
* Window>Preferences>Java>Code Generation.
|
|
||||||
*/
|
*/
|
||||||
public class Location implements ICDILocation {
|
public class Location implements ICDILocation {
|
||||||
|
|
||||||
|
@ -29,7 +23,9 @@ public class Location implements ICDILocation {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location(String f, String fnct, int l, long a) {
|
public Location(String f, String fnct, int l, long a) {
|
||||||
|
if (f != null)
|
||||||
file = f;
|
file = f;
|
||||||
|
if (fnct != null)
|
||||||
function = fnct;
|
function = fnct;
|
||||||
line = l;
|
line = l;
|
||||||
addr = a;
|
addr = a;
|
||||||
|
@ -80,12 +76,21 @@ public class Location implements ICDILocation {
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.ICDILocation#equals(ICDILocation)
|
* @see org.eclipse.cdt.debug.core.cdi.ICDILocation#equals(ICDILocation)
|
||||||
*/
|
*/
|
||||||
public boolean equals(ICDILocation location) {
|
public boolean equals(ICDILocation location) {
|
||||||
if (location instanceof Location) {
|
String ofile = location.getFile();
|
||||||
Location loc = (Location)location;
|
if (ofile == null) {
|
||||||
return addr == loc.getAddress() &&
|
ofile = "";
|
||||||
file.equals(loc.getFile()) &&
|
}
|
||||||
function.equals(loc.getFunction()) &&
|
String ofunction = location.getFunction();
|
||||||
line == loc.getLineNumber();
|
if (ofunction == null) {
|
||||||
|
ofunction = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file.equals(ofile) && line == location.getLineNumber()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file.equals(ofile) && function.equals(ofunction)) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return super.equals(location);
|
return super.equals(location);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue