From 7233f702b8e6b56ed1f9eede931025135026ce60 Mon Sep 17 00:00:00 2001 From: Francois Chouinard Date: Sun, 14 Oct 2007 20:41:05 +0000 Subject: [PATCH] Memory block offset fix when comparing 2 blocks to determine the changed bytes between debug steps. --- .../src/org/eclipse/dd/dsf/debug/model/DsfMemoryBlock.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/model/DsfMemoryBlock.java b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/model/DsfMemoryBlock.java index 12ed63f41c9..828882bc35e 100644 --- a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/model/DsfMemoryBlock.java +++ b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/model/DsfMemoryBlock.java @@ -274,11 +274,10 @@ public class DsfMemoryBlock extends PlatformObject implements IMemoryBlockExtens // Flag the changed bytes if (fBlock != null && newLength > 0) { - int offset = fBaseAddress.compareTo(address); - switch (offset) { + switch (fBaseAddress.compareTo(address)) { case -1: { - offset = -offset; + int offset = address.subtract(fBaseAddress).intValue(); int length = Math.min(fLength - offset, newLength); for (int i = 0; i < length; i += 4) { boolean changed = false; @@ -299,6 +298,7 @@ public class DsfMemoryBlock extends PlatformObject implements IMemoryBlockExtens case 0: case 1: { + int offset = fBaseAddress.subtract(address).intValue(); int length = Math.min(newLength - offset, fLength); for (int i = 0; i < length; i += 4) { boolean changed = false;