Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Cortell2008-01-04 03:36:50 +0000
committerJohn Cortell2008-01-04 03:36:50 +0000
commit2250bfc3d6728c3b8585afe641c5ae8468363911 (patch)
tree51ec8b94c073b761a463fee74b7f2a6aeda63f07 /debug/org.eclipse.cdt.debug.core
parentbc7b6a3bd897719d03dd78b765286eb8a070fe42 (diff)
downloadorg.eclipse.cdt-2250bfc3d6728c3b8585afe641c5ae8468363911.tar.gz
org.eclipse.cdt-2250bfc3d6728c3b8585afe641c5ae8468363911.tar.xz
org.eclipse.cdt-2250bfc3d6728c3b8585afe641c5ae8468363911.zip
Applied patch in bug 191583. Logic not taking into account blocks with addressable size > 1.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.core')
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CMemoryBlockExtension.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CMemoryBlockExtension.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CMemoryBlockExtension.java
index bf57660c59e..0f380b31d8f 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CMemoryBlockExtension.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CMemoryBlockExtension.java
@@ -384,9 +384,11 @@ public class CMemoryBlockExtension extends CDebugElement implements IMemoryBlock
saveChanges( addresses );
for ( int i = 0; i < addresses.length; ++i ) {
fChanges.add( addresses[i] );
- if ( addresses[i].compareTo( start ) >= 0 && addresses[i].compareTo( start.add( BigInteger.valueOf( length ) ) ) < 0 ) {
- int index = addresses[i].subtract( start ).intValue();
- if ( index >= 0 && index < memBytes.length && index < newBytes.length ) {
+ int addressableSize = fCDIBlock.getWordSize(); // # of bytes per address
+ if ( addresses[i].compareTo( start ) >= 0 && addresses[i].compareTo( start.add( BigInteger.valueOf( length / addressableSize ) ) ) < 0 ) {
+ int index = addressableSize * addresses[i].subtract( start ).intValue();
+ int end = Math.min(Math.min(index + addressableSize, memBytes.length), newBytes.length);
+ for (index = Math.max(index, 0) ; index < end; index++ ) {
memBytes[index].setChanged( true );
memBytes[index].setValue( newBytes[index] );
}

Back to the top