Interface IMemoryBlockExtension
- All Superinterfaces:
IAdaptable
,IDebugElement
,IMemoryBlock
IMemoryBlock
. Allows
for bytes to be accessed in a larger address space, and for state information
to be provided for each byte.
Clients may optionally implement this interface when providing implementations of
IMemoryBlock
.
- Since:
- 3.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Connects the given client to this memory block.void
disconnect
(Object client) Disconnects the given client from this memory block.void
dispose()
Dispose this memory block.int
Returns this memory block's addressable size in number of bytes.int
Returns the address size of this memory block in number of bytes.Returns the base address of this memory block as a big integer.Returns the length of this memory block, or -1 if unbounded.getBytesFromAddress
(BigInteger address, long units) Returns bytes from this memory block based on the given address and the addressable size of this memory block.getBytesFromOffset
(BigInteger unitOffset, long addressableUnits) Returns bytes from this memory block based on the base address and addressable size of this memory block.Object[]
Returns the possibly empty list of clients currently connected to this memory block.Returns the expression used to create this memory block.Returns the hard end address of this memory block as a big integer, ornull
if none.Returns the origin of this memory block.Returns the hard start address of this memory block as a big integer, ornull
if none.void
setBaseAddress
(BigInteger address) Sets the base address of this memory block to the given address.void
setValue
(BigInteger offset, byte[] bytes) Sets bytes in this memory block at the specified offset within this memory block to the specified bytes.boolean
Returns whether the base address of this memory block can be modified.boolean
Returns whether this memory block manages the change state of its bytes.Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
Methods inherited from interface org.eclipse.debug.core.model.IDebugElement
getDebugTarget, getLaunch, getModelIdentifier
Methods inherited from interface org.eclipse.debug.core.model.IMemoryBlock
getBytes, getLength, getStartAddress, setValue, supportsValueModification
-
Method Details
-
getExpression
String getExpression()Returns the expression used to create this memory block. An expression can be used as name for a memory block and typically represents an expression used to compute a base address for a memory block.- Returns:
- the expression used to create this memory block
-
getBigBaseAddress
Returns the base address of this memory block as a big integer. The address is in terms of addressable units.- Returns:
- the base address of this memory block
- Throws:
DebugException
- if unable to retrieve the base address
-
getMemoryBlockStartAddress
Returns the hard start address of this memory block as a big integer, ornull
if none. Anull
start address indicates that memory may be retrieved at any address less than this memory block's base address.- Returns:
- the hard start address of this memory block or
null
- Throws:
DebugException
- if unable to retrieve the start address of this memory block.
-
getMemoryBlockEndAddress
Returns the hard end address of this memory block as a big integer, ornull
if none. Anull
end address indicates that memory may be retrieved from any positive offset relative to the base address of this memory block.- Returns:
- the hard end address of this memory block or
null
- Throws:
DebugException
- if unable to retrieve the end address of this memory block.
-
getBigLength
Returns the length of this memory block, or -1 if unbounded. Returns "end address - start address" for a memory block with a fixed length (i.e. when both start and end address are known). Returns -1 for an unbounded memory block (i.e. when start or end address isnull
).- Returns:
- length of this memory block or -1 if unbounded
- Throws:
DebugException
- if unable to retrieve the length of this memory block.
-
getAddressSize
Returns the address size of this memory block in number of bytes. The address size indicates the number of bytes used to construct an address.- Returns:
- address size in number of bytes
- Throws:
DebugException
- if unable to retrieve the address size
-
supportBaseAddressModification
Returns whether the base address of this memory block can be modified.- Returns:
- whether the base address of this memory block can be modified
- Throws:
DebugException
- is unable to determine if base address modification is supported
-
supportsChangeManagement
boolean supportsChangeManagement()Returns whether this memory block manages the change state of its bytes.If a memory block manages changes the memory block is responsible for setting the
CHANGED
state of itsMemoryByte
's returned fromgetBytesFromAddress
andgetBytesFromOffset
. The changed state of a byte should be updated each time a thread suspends in a memory block's target.- Returns:
- whether this memory block manages the change state of its bytes
-
setBaseAddress
Sets the base address of this memory block to the given address.- Parameters:
address
- new base address- Throws:
DebugException
- if unable to modify the base address, or modification of the base address fails
-
getBytesFromOffset
Returns bytes from this memory block based on the base address and addressable size of this memory block.A memory block may be asked to retrieve bytes beyond it's start or end address. If a memory block is unable to retrieve memory outside these boundaries, implementations should return memory bytes with the
READABLE
bit turned off for each byte outside the of the accessible range. An exception should not be thrown in this case.- Parameters:
unitOffset
- zero based offset into this memory block at which to start retrieving bytes in terms of addressable units. Client should retrieve memory starting from "base address + offset".addressableUnits
- the number of addressable units to retrieve- Returns:
- an array of bytes from this memory block based on the given offset
and number of units. The size of the array returned must to be equal to
units
*getAddressableSize()
. - Throws:
DebugException
- if unable to retrieve the specified bytes due to a failure communicating with the target- See Also:
-
getBytesFromAddress
Returns bytes from this memory block based on the given address and the addressable size of this memory block.A memory block may be asked to retrieve bytes beyond it's start or end address. If a memory block is unable to retrieve memory outside these boundaries, implementations should return memory bytes with the
READABLE
bit turned off for each byte outside the of the accessible range. An exception should not be thrown in this case.- Parameters:
address
- address at which to begin retrieving bytes in terms of addressable unitsunits
- is the number of addressable units of memory to retrieve- Returns:
- an array of bytes from this memory block based on the given address
and number of units. The size of the array returned must to be equal to
units
*getAddressableSize()
. - Throws:
DebugException
- if unable to retrieve the specified bytes due to a failure communicating with the target- See Also:
-
setValue
Sets bytes in this memory block at the specified offset within this memory block to the specified bytes. The offset is zero based. After successfully modifying the specified bytes, a debug event should be fired with a kind ofCHANGE
.- Parameters:
offset
- the zero based offset at which to set the new value. Modify the memory starting from base address + offset.bytes
- replacement bytes- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the debug target. The DebugException's status code contains the underlying exception responsible for the failure.
- This memory block does not support value modification
- The specified offset is greater than or equal to the length of this memory block, or the number of bytes specified goes beyond the end of this memory block (index of out of range)
- See Also:
-
connect
Connects the given client to this memory block. Allows a memory block to know when it is being monitored. Has no effect if an identical client is already connected.Memory blocks supporting change management may selectively turn off change management when no clients are connected, for reasons of efficiency. Clients that require access to change state information are required to connect to a memory block before change information is considered to be valid.
- Parameters:
client
- the client to connect
-
disconnect
Disconnects the given client from this memory block. Has no effect if an identical client is not already connected.- Parameters:
client
- the client to disconnect
-
getConnections
Object[] getConnections()Returns the possibly empty list of clients currently connected to this memory block.- Returns:
- the possibly empty list of clients currently connected to this memory block
-
dispose
Dispose this memory block. Connected clients are disconnected.- Throws:
DebugException
- if the memory block cannot be disposed.
-
getMemoryBlockRetrieval
IMemoryBlockRetrieval getMemoryBlockRetrieval()Returns the origin of this memory block.- Returns:
- the origin of this memory block
-
getAddressableSize
Returns this memory block's addressable size in number of bytes. The addressable size of memory block indicates the minimum number of bytes that can be retrieved as a single unit.- Returns:
- this memory block's addressable size
- Throws:
DebugException
- if the addressable size cannot be obtained.
-