diff options
author | Alain Magloire | 2005-03-23 22:35:56 +0000 |
---|---|---|
committer | Alain Magloire | 2005-03-23 22:35:56 +0000 |
commit | 02cff41bd73fe1ac251ecc4bf158c0a1ec816197 (patch) | |
tree | e52979f070b60afb43b118ab984f2a990a52efd6 | |
parent | 8f2104f4f5d91920f157e6755f2d77f3eb6f12e5 (diff) | |
download | org.eclipse.cdt-02cff41bd73fe1ac251ecc4bf158c0a1ec816197.tar.gz org.eclipse.cdt-02cff41bd73fe1ac251ecc4bf158c0a1ec816197.tar.xz org.eclipse.cdt-02cff41bd73fe1ac251ecc4bf158c0a1ec816197.zip |
2005-03-23 Alain Magloire
Change is the ICDIMemoryBlock&& ICDIMemoryManagement API
* cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java
* cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlockManagement.java
* src/org/eclipse/cdt/debug/internal/core/model/CMemoryBlockExtension.java
4 files changed, 32 insertions, 24 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index ffdb76b8f6d..5d2b90f6de9 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,9 @@ +2005-03-23 Alain Magloire
+ Change is the ICDIMemoryBlock&& ICDIMemoryManagement API
+ * cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java
+ * cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlockManagement.java
+ * src/org/eclipse/cdt/debug/internal/core/model/CMemoryBlockExtension.java
+
2005-03-21 Mikhail Khodjaiants
Bug 80175: Replace the CDT source lookup by the source lookup provided by Eclipse platform.
* MappingSourceContainer.java: new
diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java index 09365cbf87c..3109c680f4b 100644 --- a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java @@ -28,12 +28,11 @@ public interface ICDIMemoryBlock extends ICDIObject { * Bit mask used to indicate a byte is read-only. */ public static final byte READ_ONLY = 0x01; - + /** * Bit mask used to indicate a byte is valid. */ public static final byte VALID = 0x02; - /** * Returns the start address of this memory block. @@ -48,7 +47,12 @@ public interface ICDIMemoryBlock extends ICDIObject { * @return the length of this memory block in bytes */ long getLength(); - + + /** + * @return The size of each memory word in bytes. + */ + int getWordSize(); + /** * Returns the values of the bytes currently contained * in this this memory block. diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlockManagement.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlockManagement.java index b69688622ba..9f53cc70374 100644 --- a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlockManagement.java +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlockManagement.java @@ -11,8 +11,6 @@ package org.eclipse.cdt.debug.core.cdi.model; -import java.math.BigInteger; - import org.eclipse.cdt.debug.core.cdi.CDIException; /** @@ -26,24 +24,14 @@ public interface ICDIMemoryBlockManagement { /** * Returns a memory block specified by given identifier. - * - * @param address - * @param length - how much for address - * @return a memory block with the specified identifier - * @throws CDIException on failure. Reasons include: - */ - ICDIMemoryBlock createMemoryBlock(String address, int length) - throws CDIException; - - /** - * Returns a memory block specified by given identifier. - * + * total = units * wordSize; * @param address - * @param length - how much for address + * @param units - number of units + * @param wordSize - The size of each memory word in bytes * @return a memory block with the specified identifier * @throws CDIException on failure. Reasons include: */ - ICDIMemoryBlock createMemoryBlock(BigInteger address, int length) + ICDIMemoryBlock createMemoryBlock(String address, int units, int wordSize) throws CDIException; /** 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 b0edbc42945..d89ca904e04 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 @@ -57,13 +57,24 @@ public class CMemoryBlockExtension extends CDebugElement implements IMemoryBlock private HashSet fChanges = new HashSet(); + private int fWordSize; + + /** * Constructor for CMemoryBlockExtension. */ public CMemoryBlockExtension( CDebugTarget target, String expression, BigInteger baseAddress ) { + this(target, expression, baseAddress, 1); + } + + /** + * Constructor for CMemoryBlockExtension. + */ + public CMemoryBlockExtension( CDebugTarget target, String expression, BigInteger baseAddress, int wordSize ) { super( target ); fExpression = expression; fBaseAddress = baseAddress; + fWordSize = wordSize; } /* (non-Javadoc) @@ -127,7 +138,7 @@ public class CMemoryBlockExtension extends CDebugElement implements IMemoryBlock disposeCDIBlock(); fBytes = null; } - setCDIBlock( createCDIBlock( address, length ) ); + setCDIBlock( createCDIBlock( address, length, fWordSize ) ); } bytes = getCDIBlock().getBytes(); } @@ -246,8 +257,8 @@ public class CMemoryBlockExtension extends CDebugElement implements IMemoryBlock } } - private ICDIMemoryBlock createCDIBlock( BigInteger address, long length ) throws CDIException { - ICDIMemoryBlock block = ((CDebugTarget)getDebugTarget()).getCDITarget().createMemoryBlock( address.toString(), (int)length ); + private ICDIMemoryBlock createCDIBlock( BigInteger address, long length, int wordSize ) throws CDIException { + ICDIMemoryBlock block = ((CDebugTarget)getDebugTarget()).getCDITarget().createMemoryBlock( address.toString(), (int)length, wordSize ); block.setFrozen( false ); getCDISession().getEventManager().addEventListener( this ); return block; @@ -390,8 +401,7 @@ public class CMemoryBlockExtension extends CDebugElement implements IMemoryBlock * @see org.eclipse.debug.core.model.IMemoryBlockExtension#getAddressibleSize() */ public int getAddressibleSize() { - // TODO Auto-generated method stub - return 0; + return fWordSize; } /* (non-Javadoc) |