mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 23:05:47 +02:00
Fix compareBlocks not to take to account the starting address.
This commit is contained in:
parent
8eb2617607
commit
f8ef29c102
1 changed files with 6 additions and 7 deletions
|
@ -87,17 +87,16 @@ public class MemoryManager extends SessionObject implements ICDIMemoryManager {
|
||||||
* @return Long[] array of modified addresses.
|
* @return Long[] array of modified addresses.
|
||||||
*/
|
*/
|
||||||
Long[] compareBlocks (MemoryBlock oldBlock, MemoryBlock newBlock) throws CDIException {
|
Long[] compareBlocks (MemoryBlock oldBlock, MemoryBlock newBlock) throws CDIException {
|
||||||
if (oldBlock.getStartAddress() != newBlock.getStartAddress()) {
|
|
||||||
return new Long[0];
|
|
||||||
}
|
|
||||||
byte[] oldBytes = oldBlock.getBytes();
|
byte[] oldBytes = oldBlock.getBytes();
|
||||||
byte[] newBytes = newBlock.getBytes();
|
byte[] newBytes = newBlock.getBytes();
|
||||||
List aList = new ArrayList(oldBytes.length);
|
List aList = new ArrayList(newBytes.length);
|
||||||
for (int i = 0; i < oldBytes.length; i++) {
|
for (int i = 0; i < newBytes.length; i++) {
|
||||||
if (i < newBytes.length) {
|
if (i < oldBytes.length) {
|
||||||
if (oldBytes[i] != newBytes[i]) {
|
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]);
|
return (Long[])aList.toArray(new Long[0]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue