summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Dallaway2012-09-24 08:54:41 (EDT)
committer Marc Khouzam2012-09-24 10:10:36 (EDT)
commit57c9d6bd714006e295f674c916c17e5667140564 (patch)
tree6ba604070b7405079b98c155c357336a1bb4f61d
parent285434b5e0590124fdf2dc784e1ea9a7bba2c3cd (diff)
downloadorg.eclipse.cdt-57c9d6bd714006e295f674c916c17e5667140564.zip
org.eclipse.cdt-57c9d6bd714006e295f674c916c17e5667140564.tar.gz
org.eclipse.cdt-57c9d6bd714006e295f674c916c17e5667140564.tar.bz2
Bug 387688: Memory cache update fix
Change-Id: Ic2d14de4381a58cf124a1db01ae0e72533625e44 Reviewed-on: https://git.eclipse.org/r/7447 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIMemory.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIMemory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIMemory.java
index 93ae25b..f75beaa 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIMemory.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIMemory.java
@@ -12,6 +12,7 @@
* Ericsson AB - added memory cache
* Vladimir Prus (CodeSourcery) - support for -data-read-memory-bytes (bug 322658)
* John Dallaway - support for -data-write-memory-bytes (bug 387793)
+ * John Dallaway - memory cache update fix (bug 387688)
*******************************************************************************/
package org.eclipse.cdt.dsf.mi.service;
@@ -841,12 +842,20 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer
System.arraycopy(modBlock, 0, cachedBlock.fBlock, pos, count);
}
+ // Case where the cached block is completely included in the modified block
+ else if (modBlockStart.distanceTo(cachedBlockStart).longValue() >= 0
+ && cachedBlockEnd.distanceTo(modBlockEnd).longValue() >= 0)
+ {
+ int pos = (int) modBlockStart.distanceTo(cachedBlockStart).longValue();
+ System.arraycopy(modBlock, pos, cachedBlock.fBlock, 0, (int) cachedBlock.fLength);
+ }
+
// Case where the beginning of the modified block is within the cached block
else if (cachedBlockStart.distanceTo(modBlockStart).longValue() >= 0
&& modBlockStart.distanceTo(cachedBlockEnd).longValue() > 0)
{
int pos = (int) cachedBlockStart.distanceTo(modBlockStart).longValue();
- int length = (int) cachedBlockStart.distanceTo(modBlockEnd).longValue();
+ int length = (int) modBlockStart.distanceTo(cachedBlockEnd).longValue();
System.arraycopy(modBlock, 0, cachedBlock.fBlock, pos, length);
}