Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Cortell2007-08-22 20:35:40 +0000
committerJohn Cortell2007-08-22 20:35:40 +0000
commitcf73aadd70aac02ffa5cd4fd087e13b719cecc93 (patch)
tree3d5d38e27c6978c79171ee9979dcc37fec9e5b01 /debug/org.eclipse.cdt.debug.core
parent8c03d14f4c97c17fedd499535e69fa6c05060e25 (diff)
downloadorg.eclipse.cdt-cf73aadd70aac02ffa5cd4fd087e13b719cecc93.tar.gz
org.eclipse.cdt-cf73aadd70aac02ffa5cd4fd087e13b719cecc93.tar.xz
org.eclipse.cdt-cf73aadd70aac02ffa5cd4fd087e13b719cecc93.zip
Applied patch in bug 200829
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.java39
1 files changed, 30 insertions, 9 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 2fd4fbfb0bc..40e0402fe66 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
@@ -67,6 +67,16 @@ public class CMemoryBlockExtension extends CDebugElement implements IMemoryBlock
private HashSet fChanges = new HashSet();
+ /**
+ * is fWordSize available?
+ */
+ private boolean fHaveWordSize;
+
+ /**
+ * The number of bytes per address.
+ */
+ private int fWordSize;
+
/**
* Constructor for CMemoryBlockExtension.
@@ -85,6 +95,8 @@ public class CMemoryBlockExtension extends CDebugElement implements IMemoryBlock
super( target );
fExpression = expression;
fBaseAddress = baseAddress;
+ fWordSize= wordSize;
+ fHaveWordSize= true;
}
/**
@@ -129,17 +141,26 @@ public class CMemoryBlockExtension extends CDebugElement implements IMemoryBlock
* @see org.eclipse.debug.core.model.IMemoryBlockExtension#getAddressableSize()
*/
public int getAddressableSize() throws DebugException {
- if (getCDIBlock() == null) {
- try {
- // create a CDI block of an arbitrary size so we can call into
- // the backed to determine the memory's addressable size
- setCDIBlock( createCDIBlock( fBaseAddress, 100 ));
- }
- catch( CDIException e ) {
- targetRequestFailed( e.getMessage(), null );
+ if (!fHaveWordSize) {
+ synchronized (this) {
+ if (!fHaveWordSize) {
+ ICDIMemoryBlock block= getCDIBlock();
+ if (block == null) {
+ try {
+ // create a CDI block of an arbitrary size so we can call into
+ // the backend to determine the memory's addressable size
+ setCDIBlock( block= createCDIBlock( fBaseAddress, 100 ));
+ }
+ catch( CDIException e ) {
+ targetRequestFailed( e.getMessage(), null );
+ }
+ }
+ fWordSize= block.getWordSize();
+ fHaveWordSize= true;
+ }
}
}
- return getCDIBlock().getWordSize();
+ return fWordSize;
}
/* (non-Javadoc)

Back to the top