Java Code Examples for ghidra.program.model.data.DataType#isEquivalent()

The following examples show how to use ghidra.program.model.data.DataType#isEquivalent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataTypeSyncInfo.java    From ghidra with Apache License 2.0 5 votes vote down vote up
public boolean hasChange() {
	if (sourceDt == null) {
		return true;
	}
	if (!DataTypeSynchronizer.namesAreEquivalent(sourceDt, refDt)) {
		return true;
	}
	if (!StringUtils.equals(refDt.getDescription(), sourceDt.getDescription())) {
		return true;
	}
	DataType dt = sourceDt.clone(refDt.getDataTypeManager());
	return !dt.isEquivalent(refDt);
}
 
Example 2
Source File: ExternalFunctionMerger.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private boolean isSameDataType(DataType dt1, DataType dt2) {
	if (dt1 == dt2) {
		return true;
	}
	if (dt1 == null) {
		return (dt2 == null);
	}
	if (dt2 == null) {
		return false;
	}
	return dt1.isEquivalent(dt2); // Should this use isEquivalent() or equals()?
}
 
Example 3
Source File: ListingDiff.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private boolean isSameData(Data data1, Data data2) {
	if (data1.getLength() != data2.getLength()) {
		return false;
	}
	DataType dt1 = data1.getDataType();
	DataType dt2 = data2.getDataType();
	if (!dt1.isEquivalent(dt2)) {
		return false;
	}
	// Detect that data type name or path differs?
	if (!dt1.getPathName().equals(dt2.getPathName())) {
		return false;
	}
	return true;
}
 
Example 4
Source File: ProgramMerge.java    From ghidra with Apache License 2.0 4 votes vote down vote up
private boolean sameDataType(DataType dt1, DataType dt2) {
	return (dt1 == null) ? (dt2 == null) : (dt1.isEquivalent(dt2));
}