1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 14:55:41 +02:00

Fix compareBlocks not to take to account the starting address.

This commit is contained in:
Alain Magloire 2002-11-20 14:41:50 +00:00
parent 8eb2617607
commit f8ef29c102

View file

@ -87,17 +87,16 @@ public class MemoryManager extends SessionObject implements ICDIMemoryManager {
* @return Long[] array of modified addresses.
*/
Long[] compareBlocks (MemoryBlock oldBlock, MemoryBlock newBlock) throws CDIException {
if (oldBlock.getStartAddress() != newBlock.getStartAddress()) {
return new Long[0];
}
byte[] oldBytes = oldBlock.getBytes();
byte[] newBytes = newBlock.getBytes();
List aList = new ArrayList(oldBytes.length);
for (int i = 0; i < oldBytes.length; i++) {
if (i < newBytes.length) {
List aList = new ArrayList(newBytes.length);
for (int i = 0; i < newBytes.length; i++) {
if (i < oldBytes.length) {
if (oldBytes[i] != newBytes[i]) {
aList.add(new Long(oldBlock.getStartAddress() + i));
aList.add(new Long(newBlock.getStartAddress() + i));
}
} else {
aList.add(new Long(newBlock.getStartAddress() + i));
}
}
return (Long[])aList.toArray(new Long[0]);