Package org.eclipse.debug.core.model
Class MemoryByte
- java.lang.Object
-
- org.eclipse.debug.core.model.MemoryByte
-
public class MemoryByte extends Object
A byte of memory in a memory block. Each byte of memory has a value and attributes indicating if the byte is read-only, valid, or if its value has changed.Clients may instantiate this class. Clients may subclass this class to add other attributes to a memory byte, as required.
- Since:
- 3.1
- See Also:
IMemoryBlockExtension
-
-
Field Summary
Fields Modifier and Type Field Description static byteBIG_ENDIANBit mask used to indicate a this byte of memory is big endian.static byteCHANGEDBit mask used to indicate a byte has changed since the last suspend event.static byteENDIANESS_KNOWNBit mask used to indicate that the endianess of this byte of memory is known.protected byteflagsAttribute flags.static byteHISTORY_KNOWNBit mask used to indicate a memory byte has history to determine if its value has changed.static byteREADABLEBit mask used to indicate a byte is readable.protected bytevalueValue of this byte.static byteWRITABLEBit mask used to indicate a byte is writable.
-
Constructor Summary
Constructors Constructor Description MemoryByte()Constructs a readable, writable memory byte without a change history, and a value of 0.MemoryByte(byte byteValue)Constructs a readable, writable memory byte without a change history, with the given value.MemoryByte(byte byteValue, byte byteFlags)Constructs a memory byte with the given value and attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytegetFlags()Returns this memory byte's attribute as a bit mask.bytegetValue()Returns the value of this memory byte.booleanisBigEndian()Returns whether this byte of memory is big endian.booleanisChanged()Returns whether this memory byte has changed.booleanisEndianessKnown()Returns whether the endianess of this byte of memory is known.booleanisHistoryKnown()Returns whether the history of this byte is known.booleanisReadable()Returns whether this memory byte is readable.booleanisWritable()Returns whether this memory byte is writable.voidsetBigEndian(boolean isBigEndian)Sets whether this byte of memory is big endian.voidsetChanged(boolean changed)Sets whether this memory byte has changed.voidsetEndianessKnown(boolean isEndianessKnown)Sets whether the endianess of this byte of memory is known.voidsetFlags(byte flags)Sets this memory byte's attributes based on the given bit mask.voidsetHistoryKnown(boolean known)Sets whether the history of this byte is known.voidsetReadable(boolean readable)Sets whether this memory byte is readable.voidsetValue(byte value)Sets the value of this memory byte.voidsetWritable(boolean writable)Sets whether this memory byte is writable.
-
-
-
Field Detail
-
WRITABLE
public static final byte WRITABLE
Bit mask used to indicate a byte is writable.- See Also:
- Constant Field Values
-
READABLE
public static final byte READABLE
Bit mask used to indicate a byte is readable. A memory byte is readable when its value and attributes are retrievable. Otherwise, a byte is considered non-readable.- See Also:
- Constant Field Values
-
CHANGED
public static final byte CHANGED
Bit mask used to indicate a byte has changed since the last suspend event.- See Also:
DebugEvent.SUSPEND, Constant Field Values
-
HISTORY_KNOWN
public static final byte HISTORY_KNOWN
Bit mask used to indicate a memory byte has history to determine if its value has changed. When a memory byte's history is unknown, the change state has no meaning.- See Also:
- Constant Field Values
-
BIG_ENDIAN
public static final byte BIG_ENDIAN
Bit mask used to indicate a this byte of memory is big endian. If this byte of memory is little endian, turn this bit mask to off.- See Also:
- Constant Field Values
-
ENDIANESS_KNOWN
public static final byte ENDIANESS_KNOWN
Bit mask used to indicate that the endianess of this byte of memory is known. When a memory byte's endianess is unknown, the endianess of this byte has no meaning.- See Also:
- Constant Field Values
-
value
protected byte value
Value of this byte.
-
flags
protected byte flags
Attribute flags.To specify READABLE: flags |= MemoryByte.READABLE; To specify WRITABLE: flags |= MemoryByte.WRITABLE;
-
-
Constructor Detail
-
MemoryByte
public MemoryByte()
Constructs a readable, writable memory byte without a change history, and a value of 0. The byte's endianess is known and is little endian by default.
-
MemoryByte
public MemoryByte(byte byteValue)
Constructs a readable, writable memory byte without a change history, with the given value. The byte's endianess is known and is little endian by default.- Parameters:
byteValue- value of this memory byte
-
MemoryByte
public MemoryByte(byte byteValue, byte byteFlags)Constructs a memory byte with the given value and attributes.- Parameters:
byteValue- value of this memory bytebyteFlags- attributes of the byte specified as a bit mask
-
-
Method Detail
-
getFlags
public byte getFlags()
Returns this memory byte's attribute as a bit mask.- Returns:
- this memory byte's attribute as a bit mask
-
setFlags
public void setFlags(byte flags)
Sets this memory byte's attributes based on the given bit mask.- Parameters:
flags- bit mask of attributes
-
getValue
public byte getValue()
Returns the value of this memory byte.- Returns:
- the value of this memory byte
-
setValue
public void setValue(byte value)
Sets the value of this memory byte.- Parameters:
value- the new value of this memory byte
-
setReadable
public void setReadable(boolean readable)
Sets whether this memory byte is readable. A memory byte is considered readable when its value and attributes are retrievable.- Parameters:
readable- whether this memory byte is readable
-
isReadable
public boolean isReadable()
Returns whether this memory byte is readable. A memory byte is considered readable when its value and attributes are retrievable.- Returns:
- whether this memory byte is readable
-
setWritable
public void setWritable(boolean writable)
Sets whether this memory byte is writable.- Parameters:
writable- whether this memory byte is writable.
-
isWritable
public boolean isWritable()
Returns whether this memory byte is writable.- Returns:
- whether this memory byte is writable
-
setChanged
public void setChanged(boolean changed)
Sets whether this memory byte has changed.- Parameters:
changed- whether this memory byte has changed
-
isChanged
public boolean isChanged()
Returns whether this memory byte has changed.- Returns:
- whether this memory byte has changed
-
setHistoryKnown
public void setHistoryKnown(boolean known)
Sets whether the history of this byte is known. When history is unknown, the change state of a memory byte has no meaning.- Parameters:
known- whether the change state of this byte is known
-
isHistoryKnown
public boolean isHistoryKnown()
Returns whether the history of this byte is known. When history is unknown, the change state of a memory byte has no meaning.- Returns:
- whether the change state of this byte is known
-
setBigEndian
public void setBigEndian(boolean isBigEndian)
Sets whether this byte of memory is big endian.- Parameters:
isBigEndian- whether the byte of memory is big endian.
-
isBigEndian
public boolean isBigEndian()
Returns whether this byte of memory is big endian.- Returns:
- whether the byte of memory is big endian.
-
setEndianessKnown
public void setEndianessKnown(boolean isEndianessKnown)
Sets whether the endianess of this byte of memory is known. If the endianess is unknown, the endianess of this byte has no meaning.- Parameters:
isEndianessKnown- whether the endianess of this byte is known.
-
isEndianessKnown
public boolean isEndianessKnown()
Returns whether the endianess of this byte of memory is known. If the endianess is unknown, the endianess of this byte has no meaning.- Returns:
- whether the endianess of this byte of memory is known.
-
-