mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Fix typo: unitialized -> uninitialized
This commit is contained in:
parent
6eb78e7ef2
commit
fbde367fe1
23 changed files with 55 additions and 55 deletions
|
@ -332,7 +332,7 @@ public class DBTraceGuestPlatformMappedMemory implements Memory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MemoryBlock convertToInitialized(MemoryBlock unitializedBlock, byte initialValue)
|
public MemoryBlock convertToInitialized(MemoryBlock uninitializedBlock, byte initialValue)
|
||||||
throws LockException, MemoryBlockException, NotFoundException {
|
throws LockException, MemoryBlockException, NotFoundException {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,7 +257,7 @@ public abstract class AbstractDBTraceProgramViewMemory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MemoryBlock convertToInitialized(MemoryBlock unitializedBlock, byte initialValue)
|
public MemoryBlock convertToInitialized(MemoryBlock uninitializedBlock, byte initialValue)
|
||||||
throws LockException, MemoryBlockException, NotFoundException {
|
throws LockException, MemoryBlockException, NotFoundException {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,7 +247,7 @@
|
||||||
<UL>
|
<UL>
|
||||||
<LI><B>Initialized</B> - Specify a value and a new block will be created
|
<LI><B>Initialized</B> - Specify a value and a new block will be created
|
||||||
using that value for every byte in the block. </LI>
|
using that value for every byte in the block. </LI>
|
||||||
<LI><B>Uninitialized</B> - An unitialized block will be created.</LI>
|
<LI><B>Uninitialized</B> - An uninitialized block will be created.</LI>
|
||||||
<LI><B>File Bytes</B> - Select from a list of imported files and enter
|
<LI><B>File Bytes</B> - Select from a list of imported files and enter
|
||||||
a starting offset for that file. Those bytes will be the initial value for the block.</LI>
|
a starting offset for that file. Those bytes will be the initial value for the block.</LI>
|
||||||
<P><I><IMG src="help/shared/note.png" border="0"> You can use the "Add To Program"
|
<P><I><IMG src="help/shared/note.png" border="0"> You can use the "Add To Program"
|
||||||
|
|
|
@ -263,7 +263,7 @@ public class DisassemblerPlugin extends Plugin {
|
||||||
cmd = new DisassembleCommand(addr, restrictedSet, true);
|
cmd = new DisassembleCommand(addr, restrictedSet, true);
|
||||||
}
|
}
|
||||||
catch (MemoryAccessException e) {
|
catch (MemoryAccessException e) {
|
||||||
tool.setStatusInfo("Can't disassemble unitialized memory!", true);
|
tool.setStatusInfo("Can't disassemble uninitialized memory!", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cmd != null) {
|
if (cmd != null) {
|
||||||
|
@ -333,7 +333,7 @@ public class DisassemblerPlugin extends Plugin {
|
||||||
cmd = new ArmDisassembleCommand(addr, null, thumbMode);
|
cmd = new ArmDisassembleCommand(addr, null, thumbMode);
|
||||||
}
|
}
|
||||||
catch (MemoryAccessException e) {
|
catch (MemoryAccessException e) {
|
||||||
tool.setStatusInfo("Can't disassemble unitialized memory!", true);
|
tool.setStatusInfo("Can't disassemble uninitialized memory!", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cmd != null) {
|
if (cmd != null) {
|
||||||
|
@ -357,7 +357,7 @@ public class DisassemblerPlugin extends Plugin {
|
||||||
cmd = new Hcs12DisassembleCommand(addr, null, xgMode);
|
cmd = new Hcs12DisassembleCommand(addr, null, xgMode);
|
||||||
}
|
}
|
||||||
catch (MemoryAccessException e) {
|
catch (MemoryAccessException e) {
|
||||||
tool.setStatusInfo("Can't disassemble unitialized memory!", true);
|
tool.setStatusInfo("Can't disassemble uninitialized memory!", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cmd != null) {
|
if (cmd != null) {
|
||||||
|
@ -381,7 +381,7 @@ public class DisassemblerPlugin extends Plugin {
|
||||||
cmd = new MipsDisassembleCommand(addr, null, mips16);
|
cmd = new MipsDisassembleCommand(addr, null, mips16);
|
||||||
}
|
}
|
||||||
catch (MemoryAccessException e) {
|
catch (MemoryAccessException e) {
|
||||||
tool.setStatusInfo("Can't disassemble unitialized memory!", true);
|
tool.setStatusInfo("Can't disassemble uninitialized memory!", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cmd != null) {
|
if (cmd != null) {
|
||||||
|
@ -405,7 +405,7 @@ public class DisassemblerPlugin extends Plugin {
|
||||||
cmd = new PowerPCDisassembleCommand(addr, null, vle);
|
cmd = new PowerPCDisassembleCommand(addr, null, vle);
|
||||||
}
|
}
|
||||||
catch (MemoryAccessException e) {
|
catch (MemoryAccessException e) {
|
||||||
tool.setStatusInfo("Can't disassemble unitialized memory!", true);
|
tool.setStatusInfo("Can't disassemble uninitialized memory!", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cmd != null) {
|
if (cmd != null) {
|
||||||
|
|
|
@ -79,7 +79,7 @@ class AddBlockDialog extends DialogComponentProvider implements ChangeListener {
|
||||||
|
|
||||||
private final static String MAPPED = "Mapped";
|
private final static String MAPPED = "Mapped";
|
||||||
private final static String UNMAPPED = "Unmapped";
|
private final static String UNMAPPED = "Unmapped";
|
||||||
private static final String UNITIALIZED = "UNITIALIZED";
|
private static final String UNINITIALIZED = "UNINITIALIZED";
|
||||||
private static final String INITIALIZED = "INITIALIZED";
|
private static final String INITIALIZED = "INITIALIZED";
|
||||||
private static final String FILE_BYTES = "FILE_BYTES";
|
private static final String FILE_BYTES = "FILE_BYTES";
|
||||||
private JPanel inializedTypePanel;
|
private JPanel inializedTypePanel;
|
||||||
|
@ -246,7 +246,7 @@ class AddBlockDialog extends DialogComponentProvider implements ChangeListener {
|
||||||
initializedTypeCardLayout = new CardLayout();
|
initializedTypeCardLayout = new CardLayout();
|
||||||
|
|
||||||
inializedTypePanel = new JPanel(initializedTypeCardLayout);
|
inializedTypePanel = new JPanel(initializedTypeCardLayout);
|
||||||
inializedTypePanel.add(new JPanel(), UNITIALIZED);
|
inializedTypePanel.add(new JPanel(), UNINITIALIZED);
|
||||||
inializedTypePanel.add(buildInitalValuePanel(), INITIALIZED);
|
inializedTypePanel.add(buildInitalValuePanel(), INITIALIZED);
|
||||||
inializedTypePanel.add(buildFileBytesPanel(), FILE_BYTES);
|
inializedTypePanel.add(buildFileBytesPanel(), FILE_BYTES);
|
||||||
return inializedTypePanel;
|
return inializedTypePanel;
|
||||||
|
@ -312,7 +312,7 @@ class AddBlockDialog extends DialogComponentProvider implements ChangeListener {
|
||||||
commentField.setText("");
|
commentField.setText("");
|
||||||
initialValueField.setValue(Long.valueOf(0));
|
initialValueField.setValue(Long.valueOf(0));
|
||||||
model.setBlockType(MemoryBlockType.DEFAULT);
|
model.setBlockType(MemoryBlockType.DEFAULT);
|
||||||
model.setInitializedType(AddBlockModel.InitializedType.UNITIALIZED);
|
model.setInitializedType(AddBlockModel.InitializedType.UNINITIALIZED);
|
||||||
model.setInitialValue(0);
|
model.setInitialValue(0);
|
||||||
|
|
||||||
readCB.setSelected(model.isRead());
|
readCB.setSelected(model.isRead());
|
||||||
|
@ -353,8 +353,8 @@ class AddBlockDialog extends DialogComponentProvider implements ChangeListener {
|
||||||
initializedTypeCardLayout.show(inializedTypePanel, INITIALIZED);
|
initializedTypeCardLayout.show(inializedTypePanel, INITIALIZED);
|
||||||
}
|
}
|
||||||
else if (uninitializedRB.isSelected()) {
|
else if (uninitializedRB.isSelected()) {
|
||||||
model.setInitializedType(InitializedType.UNITIALIZED);
|
model.setInitializedType(InitializedType.UNINITIALIZED);
|
||||||
initializedTypeCardLayout.show(inializedTypePanel, UNITIALIZED);
|
initializedTypeCardLayout.show(inializedTypePanel, UNINITIALIZED);
|
||||||
}
|
}
|
||||||
else if (initializedFromFileBytesRB.isSelected()) {
|
else if (initializedFromFileBytesRB.isSelected()) {
|
||||||
model.setInitializedType(InitializedType.INITIALIZED_FROM_FILE_BYTES);
|
model.setInitializedType(InitializedType.INITIALIZED_FROM_FILE_BYTES);
|
||||||
|
|
|
@ -61,7 +61,7 @@ class AddBlockModel {
|
||||||
private long fileBytesOffset = -1;
|
private long fileBytesOffset = -1;
|
||||||
|
|
||||||
enum InitializedType {
|
enum InitializedType {
|
||||||
UNITIALIZED, INITIALIZED_FROM_VALUE, INITIALIZED_FROM_FILE_BYTES;
|
UNINITIALIZED, INITIALIZED_FROM_VALUE, INITIALIZED_FROM_FILE_BYTES;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddBlockModel(PluginTool tool, Program program) {
|
AddBlockModel(PluginTool tool, Program program) {
|
||||||
|
@ -127,7 +127,7 @@ class AddBlockModel {
|
||||||
isOverlay = false;
|
isOverlay = false;
|
||||||
schemeDestByteCount = blockType == MemoryBlockType.BIT_MAPPED ? 8 : 1;
|
schemeDestByteCount = blockType == MemoryBlockType.BIT_MAPPED ? 8 : 1;
|
||||||
schemeSrcByteCount = 1;
|
schemeSrcByteCount = 1;
|
||||||
initializedType = InitializedType.UNITIALIZED;
|
initializedType = InitializedType.UNINITIALIZED;
|
||||||
validateInfo();
|
validateInfo();
|
||||||
listener.stateChanged(null);
|
listener.stateChanged(null);
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ class AddBlockModel {
|
||||||
case INITIALIZED_FROM_VALUE:
|
case INITIALIZED_FROM_VALUE:
|
||||||
return new AddInitializedMemoryBlockCmd(blockName, comment, source, startAddr,
|
return new AddInitializedMemoryBlockCmd(blockName, comment, source, startAddr,
|
||||||
length, isRead, isWrite, isExecute, isVolatile, (byte) initialValue, isOverlay);
|
length, isRead, isWrite, isExecute, isVolatile, (byte) initialValue, isOverlay);
|
||||||
case UNITIALIZED:
|
case UNINITIALIZED:
|
||||||
return new AddUninitializedMemoryBlockCmd(blockName, comment, source, startAddr,
|
return new AddUninitializedMemoryBlockCmd(blockName, comment, source, startAddr,
|
||||||
length, isRead, isWrite, isExecute, isVolatile, isOverlay);
|
length, isRead, isWrite, isExecute, isVolatile, isOverlay);
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -358,7 +358,7 @@ class MemoryMapModel extends AbstractSortedTableModel<MemoryBlock> {
|
||||||
initializeBlock(block);
|
initializeBlock(block);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
revertBlockToUnitialized(block);
|
revertBlockToUninitialized(block);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -392,9 +392,9 @@ class MemoryMapModel extends AbstractSortedTableModel<MemoryBlock> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void revertBlockToUnitialized(MemoryBlock block) {
|
private void revertBlockToUninitialized(MemoryBlock block) {
|
||||||
int result = OptionDialog.showYesNoDialog(provider.getComponent(),
|
int result = OptionDialog.showYesNoDialog(provider.getComponent(),
|
||||||
"Confirm Setting Block To Unitialized",
|
"Confirm Setting Block To Uninitialized",
|
||||||
"Are you sure you want to remove the bytes from this block? \n\n" +
|
"Are you sure you want to remove the bytes from this block? \n\n" +
|
||||||
"This will result in removing all functions, instructions, data,\n" +
|
"This will result in removing all functions, instructions, data,\n" +
|
||||||
"and outgoing references from the block!");
|
"and outgoing references from the block!");
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class AoutHeaderMIPS extends AoutHeader {
|
||||||
gp_value = reader.readNextInt();
|
gp_value = reader.readNextInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUnitializedDataStart() {
|
public int getUninitializedDataStart() {
|
||||||
return bss_start;
|
return bss_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,7 @@ public class AddBlockModelTest extends AbstractGhidraHeadedIntegrationTest
|
||||||
model.setStartAddress(getAddr(0x100));
|
model.setStartAddress(getAddr(0x100));
|
||||||
model.setLength(100);
|
model.setLength(100);
|
||||||
model.setBlockType(MemoryBlockType.BIT_MAPPED);
|
model.setBlockType(MemoryBlockType.BIT_MAPPED);
|
||||||
assertEquals(InitializedType.UNITIALIZED, model.getInitializedType());
|
assertEquals(InitializedType.UNINITIALIZED, model.getInitializedType());
|
||||||
model.setBaseAddress(getAddr(0x2000));
|
model.setBaseAddress(getAddr(0x2000));
|
||||||
|
|
||||||
assertTrue(model.execute());
|
assertTrue(model.execute());
|
||||||
|
@ -251,7 +251,7 @@ public class AddBlockModelTest extends AbstractGhidraHeadedIntegrationTest
|
||||||
model.setStartAddress(getAddr(0x100));
|
model.setStartAddress(getAddr(0x100));
|
||||||
model.setLength(100);
|
model.setLength(100);
|
||||||
model.setBlockType(MemoryBlockType.BYTE_MAPPED);
|
model.setBlockType(MemoryBlockType.BYTE_MAPPED);
|
||||||
assertEquals(InitializedType.UNITIALIZED, model.getInitializedType());
|
assertEquals(InitializedType.UNINITIALIZED, model.getInitializedType());
|
||||||
model.setBaseAddress(getAddr(0x2000));
|
model.setBaseAddress(getAddr(0x2000));
|
||||||
|
|
||||||
assertTrue(model.execute());
|
assertTrue(model.execute());
|
||||||
|
|
|
@ -478,7 +478,7 @@ public class MemoryMapProvider1Test extends AbstractGhidraHeadedIntegrationTest
|
||||||
@Test
|
@Test
|
||||||
public void testSortBlockType() throws Exception {
|
public void testSortBlockType() throws Exception {
|
||||||
|
|
||||||
// add a bit overlay block, live block, and an unitialized block
|
// add a bit overlay block, live block, and an uninitialized block
|
||||||
tx(program, () -> {
|
tx(program, () -> {
|
||||||
memory.createBitMappedBlock(".Bit", getAddr(0), getAddr(0x01001000), 0x100, false);
|
memory.createBitMappedBlock(".Bit", getAddr(0), getAddr(0x01001000), 0x100, false);
|
||||||
memory.createUninitializedBlock(".Uninit", getAddr(0x3000), 0x200, false);
|
memory.createUninitializedBlock(".Uninit", getAddr(0x3000), 0x200, false);
|
||||||
|
@ -504,7 +504,7 @@ public class MemoryMapProvider1Test extends AbstractGhidraHeadedIntegrationTest
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSortBlockTypeDescending() throws Exception {
|
public void testSortBlockTypeDescending() throws Exception {
|
||||||
// add a bit overlay block, live block, and an unitialized block
|
// add a bit overlay block, live block, and an uninitialized block
|
||||||
tx(program, () -> {
|
tx(program, () -> {
|
||||||
memory.createBitMappedBlock(".Bit", getAddr(0), getAddr(0x01001000), 0x100, false);
|
memory.createBitMappedBlock(".Bit", getAddr(0), getAddr(0x01001000), 0x100, false);
|
||||||
memory.createUninitializedBlock(".Uninit", getAddr(0x3000), 0x200, false);
|
memory.createUninitializedBlock(".Uninit", getAddr(0x3000), 0x200, false);
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class MemoryBlockUtilTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetByteOnUnitializedBlock() {
|
public void testGetByteOnUninitializedBlock() {
|
||||||
MemoryBlock block = MemoryBlockUtils.createUninitializedBlock(prog, false, "a",
|
MemoryBlock block = MemoryBlockUtils.createUninitializedBlock(prog, false, "a",
|
||||||
space.getAddress(3000), 1000, "Acomment", "Asource", true, true, true, log);
|
space.getAddress(3000), 1000, "Acomment", "Asource", true, true, true, log);
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class MyTestMemory extends AddressSet implements Memory {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MemoryBlock convertToInitialized(MemoryBlock unitializedBlock, byte initialValue)
|
public MemoryBlock convertToInitialized(MemoryBlock uninitializedBlock, byte initialValue)
|
||||||
throws MemoryBlockException, NotFoundException {
|
throws MemoryBlockException, NotFoundException {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2871,7 +2871,7 @@ ProtoStoreSymbol::~ProtoStoreSymbol(void)
|
||||||
|
|
||||||
/// Retrieve the specified ProtoParameter object, making sure it is a ParameterSymbol.
|
/// Retrieve the specified ProtoParameter object, making sure it is a ParameterSymbol.
|
||||||
/// If it doesn't exist, or if the object in the specific slot is not a ParameterSymbol,
|
/// If it doesn't exist, or if the object in the specific slot is not a ParameterSymbol,
|
||||||
/// allocate an (unitialized) parameter.
|
/// allocate an (uninitialized) parameter.
|
||||||
/// \param i is the specified input slot
|
/// \param i is the specified input slot
|
||||||
/// \return the corresponding parameter
|
/// \return the corresponding parameter
|
||||||
ParameterSymbol *ProtoStoreSymbol::getSymbolBacked(int4 i)
|
ParameterSymbol *ProtoStoreSymbol::getSymbolBacked(int4 i)
|
||||||
|
|
|
@ -701,7 +701,7 @@ public class MemoryBlockDB implements MemoryBlock {
|
||||||
}
|
}
|
||||||
subBlocks.clear();
|
subBlocks.clear();
|
||||||
DBRecord subRecord = adapter.createSubBlockRecord(id, 0, length,
|
DBRecord subRecord = adapter.createSubBlockRecord(id, 0, length,
|
||||||
MemoryMapDBAdapter.SUB_TYPE_UNITIALIZED, 0, 0);
|
MemoryMapDBAdapter.SUB_TYPE_UNINITIALIZED, 0, 0);
|
||||||
subBlocks.add(new UninitializedSubMemoryBlock(adapter, subRecord));
|
subBlocks.add(new UninitializedSubMemoryBlock(adapter, subRecord));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1074,24 +1074,24 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MemoryBlock convertToInitialized(MemoryBlock unitializedBlock, byte initialValue)
|
public MemoryBlock convertToInitialized(MemoryBlock uninitializedBlock, byte initialValue)
|
||||||
throws MemoryBlockException, NotFoundException, LockException {
|
throws MemoryBlockException, NotFoundException, LockException {
|
||||||
lock.acquire();
|
lock.acquire();
|
||||||
try {
|
try {
|
||||||
checkBlock(unitializedBlock);
|
checkBlock(uninitializedBlock);
|
||||||
program.checkExclusiveAccess();
|
program.checkExclusiveAccess();
|
||||||
if (unitializedBlock.isInitialized()) {
|
if (uninitializedBlock.isInitialized()) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Only an Uninitialized Block may be converted to an Initialized Block");
|
"Only an Uninitialized Block may be converted to an Initialized Block");
|
||||||
}
|
}
|
||||||
if (unitializedBlock.getType() != MemoryBlockType.DEFAULT) {
|
if (uninitializedBlock.getType() != MemoryBlockType.DEFAULT) {
|
||||||
throw new IllegalArgumentException("Block is of a type that cannot be initialized");
|
throw new IllegalArgumentException("Block is of a type that cannot be initialized");
|
||||||
}
|
}
|
||||||
long size = unitializedBlock.getSize();
|
long size = uninitializedBlock.getSize();
|
||||||
if (size > MAX_BLOCK_SIZE) {
|
if (size > MAX_BLOCK_SIZE) {
|
||||||
throw new MemoryBlockException("Block too large to initialize");
|
throw new MemoryBlockException("Block too large to initialize");
|
||||||
}
|
}
|
||||||
MemoryBlockDB memBlock = (MemoryBlockDB) unitializedBlock;
|
MemoryBlockDB memBlock = (MemoryBlockDB) uninitializedBlock;
|
||||||
try {
|
try {
|
||||||
memBlock.initializeBlock(initialValue);
|
memBlock.initializeBlock(initialValue);
|
||||||
initializeBlocks();
|
initializeBlocks();
|
||||||
|
|
|
@ -72,7 +72,7 @@ abstract class MemoryMapDBAdapter {
|
||||||
static final byte SUB_TYPE_BIT_MAPPED = MemoryMapDBAdapterV3.V3_SUB_TYPE_BIT_MAPPED;
|
static final byte SUB_TYPE_BIT_MAPPED = MemoryMapDBAdapterV3.V3_SUB_TYPE_BIT_MAPPED;
|
||||||
static final byte SUB_TYPE_BYTE_MAPPED = MemoryMapDBAdapterV3.V3_SUB_TYPE_BYTE_MAPPED;
|
static final byte SUB_TYPE_BYTE_MAPPED = MemoryMapDBAdapterV3.V3_SUB_TYPE_BYTE_MAPPED;
|
||||||
static final byte SUB_TYPE_BUFFER = MemoryMapDBAdapterV3.V3_SUB_TYPE_BUFFER;
|
static final byte SUB_TYPE_BUFFER = MemoryMapDBAdapterV3.V3_SUB_TYPE_BUFFER;
|
||||||
static final byte SUB_TYPE_UNITIALIZED = MemoryMapDBAdapterV3.V3_SUB_TYPE_UNITIALIZED;
|
static final byte SUB_TYPE_UNINITIALIZED = MemoryMapDBAdapterV3.V3_SUB_TYPE_UNINITIALIZED;
|
||||||
static final byte SUB_TYPE_FILE_BYTES = MemoryMapDBAdapterV3.V3_SUB_TYPE_FILE_BYTES;
|
static final byte SUB_TYPE_FILE_BYTES = MemoryMapDBAdapterV3.V3_SUB_TYPE_FILE_BYTES;
|
||||||
|
|
||||||
static MemoryMapDBAdapter getAdapter(DBHandle handle, int openMode, MemoryMapDB memMap,
|
static MemoryMapDBAdapter getAdapter(DBHandle handle, int openMode, MemoryMapDB memMap,
|
||||||
|
|
|
@ -167,7 +167,7 @@ class MemoryMapDBAdapterV0 extends MemoryMapDBAdapter {
|
||||||
record.setIntValue(SUB_INT_DATA1_COL, bufID);
|
record.setIntValue(SUB_INT_DATA1_COL, bufID);
|
||||||
return new BufferSubMemoryBlock(this, record);
|
return new BufferSubMemoryBlock(this, record);
|
||||||
case UNINITIALIZED:
|
case UNINITIALIZED:
|
||||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNITIALIZED);
|
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNINITIALIZED);
|
||||||
return new UninitializedSubMemoryBlock(this, record);
|
return new UninitializedSubMemoryBlock(this, record);
|
||||||
default:
|
default:
|
||||||
throw new IOException("Unknown memory block type: " + type);
|
throw new IOException("Unknown memory block type: " + type);
|
||||||
|
|
|
@ -136,7 +136,7 @@ class MemoryMapDBAdapterV2 extends MemoryMapDBAdapter {
|
||||||
record.setIntValue(SUB_INT_DATA1_COL, bufID);
|
record.setIntValue(SUB_INT_DATA1_COL, bufID);
|
||||||
return new BufferSubMemoryBlock(this, record);
|
return new BufferSubMemoryBlock(this, record);
|
||||||
case UNINITIALIZED:
|
case UNINITIALIZED:
|
||||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNITIALIZED);
|
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNINITIALIZED);
|
||||||
return new UninitializedSubMemoryBlock(this, record);
|
return new UninitializedSubMemoryBlock(this, record);
|
||||||
default:
|
default:
|
||||||
throw new IOException("Unknown memory block type: " + type);
|
throw new IOException("Unknown memory block type: " + type);
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
||||||
static final byte V3_SUB_TYPE_BIT_MAPPED = 0;
|
static final byte V3_SUB_TYPE_BIT_MAPPED = 0;
|
||||||
static final byte V3_SUB_TYPE_BYTE_MAPPED = 1;
|
static final byte V3_SUB_TYPE_BYTE_MAPPED = 1;
|
||||||
static final byte V3_SUB_TYPE_BUFFER = 2;
|
static final byte V3_SUB_TYPE_BUFFER = 2;
|
||||||
static final byte V3_SUB_TYPE_UNITIALIZED = 3;
|
static final byte V3_SUB_TYPE_UNINITIALIZED = 3;
|
||||||
static final byte V3_SUB_TYPE_FILE_BYTES = 4;
|
static final byte V3_SUB_TYPE_FILE_BYTES = 4;
|
||||||
|
|
||||||
static Schema V3_BLOCK_SCHEMA = new Schema(V3_VERSION, "Key",
|
static Schema V3_BLOCK_SCHEMA = new Schema(V3_VERSION, "Key",
|
||||||
|
@ -215,7 +215,7 @@ public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
||||||
if (initializeBytes) {
|
if (initializeBytes) {
|
||||||
return createInitializedBlock(name, startAddr, null, length, permissions);
|
return createInitializedBlock(name, startAddr, null, length, permissions);
|
||||||
}
|
}
|
||||||
return createUnitializedBlock(name, startAddr, length, permissions);
|
return createUninitializedBlock(name, startAddr, length, permissions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -238,7 +238,7 @@ public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
||||||
return newBlock;
|
return newBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryBlockDB createUnitializedBlock(String name, Address startAddress, long length,
|
MemoryBlockDB createUninitializedBlock(String name, Address startAddress, long length,
|
||||||
int permissions) throws IOException, AddressOverflowException {
|
int permissions) throws IOException, AddressOverflowException {
|
||||||
updateAddressMapForAllAddresses(startAddress, length);
|
updateAddressMapForAllAddresses(startAddress, length);
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
||||||
DBRecord blockRecord = createMemoryBlockRecord(name, startAddress, length, permissions);
|
DBRecord blockRecord = createMemoryBlockRecord(name, startAddress, length, permissions);
|
||||||
long key = blockRecord.getKey();
|
long key = blockRecord.getKey();
|
||||||
|
|
||||||
DBRecord subRecord = createSubBlockRecord(key, 0, length, V3_SUB_TYPE_UNITIALIZED, 0, 0);
|
DBRecord subRecord = createSubBlockRecord(key, 0, length, V3_SUB_TYPE_UNINITIALIZED, 0, 0);
|
||||||
subBlocks.add(new UninitializedSubMemoryBlock(this, subRecord));
|
subBlocks.add(new UninitializedSubMemoryBlock(this, subRecord));
|
||||||
|
|
||||||
memBlockTable.putRecord(blockRecord);
|
memBlockTable.putRecord(blockRecord);
|
||||||
|
@ -420,7 +420,7 @@ public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
||||||
return new ByteMappedSubMemoryBlock(this, record);
|
return new ByteMappedSubMemoryBlock(this, record);
|
||||||
case V3_SUB_TYPE_BUFFER:
|
case V3_SUB_TYPE_BUFFER:
|
||||||
return new BufferSubMemoryBlock(this, record);
|
return new BufferSubMemoryBlock(this, record);
|
||||||
case V3_SUB_TYPE_UNITIALIZED:
|
case V3_SUB_TYPE_UNINITIALIZED:
|
||||||
return new UninitializedSubMemoryBlock(this, record);
|
return new UninitializedSubMemoryBlock(this, record);
|
||||||
case V3_SUB_TYPE_FILE_BYTES:
|
case V3_SUB_TYPE_FILE_BYTES:
|
||||||
return new FileBytesSubMemoryBlock(this, record);
|
return new FileBytesSubMemoryBlock(this, record);
|
||||||
|
|
|
@ -79,7 +79,7 @@ class UninitializedSubMemoryBlock extends SubMemoryBlock {
|
||||||
adapter.updateSubBlockRecord(record);
|
adapter.updateSubBlockRecord(record);
|
||||||
|
|
||||||
DBRecord newSubRecord = adapter.createSubBlockRecord(-1, 0, newLength,
|
DBRecord newSubRecord = adapter.createSubBlockRecord(-1, 0, newLength,
|
||||||
MemoryMapDBAdapter.SUB_TYPE_UNITIALIZED, 0, 0);
|
MemoryMapDBAdapter.SUB_TYPE_UNINITIALIZED, 0, 0);
|
||||||
|
|
||||||
return new UninitializedSubMemoryBlock(adapter, newSubRecord);
|
return new UninitializedSubMemoryBlock(adapter, newSubRecord);
|
||||||
}
|
}
|
||||||
|
|
|
@ -392,14 +392,14 @@ public interface Memory extends AddressSetView {
|
||||||
/**
|
/**
|
||||||
* Convert an existing uninitialized block with an
|
* Convert an existing uninitialized block with an
|
||||||
* initialized block.
|
* initialized block.
|
||||||
* @param unitializedBlock unitialized block to convert
|
* @param uninitializedBlock uninitialized block to convert
|
||||||
* @param initialValue initial value for the bytes
|
* @param initialValue initial value for the bytes
|
||||||
* @throws LockException if exclusive lock not in place (see haveLock())
|
* @throws LockException if exclusive lock not in place (see haveLock())
|
||||||
* @throws MemoryBlockException if there is no block in memory
|
* @throws MemoryBlockException if there is no block in memory
|
||||||
* at the same address as block or if the block lengths are not
|
* at the same address as block or if the block lengths are not
|
||||||
* the same.
|
* the same.
|
||||||
*/
|
*/
|
||||||
public MemoryBlock convertToInitialized(MemoryBlock unitializedBlock, byte initialValue)
|
public MemoryBlock convertToInitialized(MemoryBlock uninitializedBlock, byte initialValue)
|
||||||
throws LockException, MemoryBlockException, NotFoundException;
|
throws LockException, MemoryBlockException, NotFoundException;
|
||||||
|
|
||||||
public MemoryBlock convertToUninitialized(MemoryBlock itializedBlock)
|
public MemoryBlock convertToUninitialized(MemoryBlock itializedBlock)
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class UniqueMemoryBankTest extends AbstractGenericTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = LowlevelError.class)
|
@Test(expected = LowlevelError.class)
|
||||||
public void testGetUnitializedByte() {
|
public void testGetUninitializedByte() {
|
||||||
WordInfo info = new WordInfo();
|
WordInfo info = new WordInfo();
|
||||||
info.setByte((byte) 0, 0);
|
info.setByte((byte) 0, 0);
|
||||||
info.setByte((byte) 1, 1);
|
info.setByte((byte) 1, 1);
|
||||||
|
@ -219,13 +219,13 @@ public class UniqueMemoryBankTest extends AbstractGenericTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = LowlevelError.class)
|
@Test(expected = LowlevelError.class)
|
||||||
public void testUnitializedReadStop() {
|
public void testUninitializedReadStop() {
|
||||||
byte[] dest = new byte[16];
|
byte[] dest = new byte[16];
|
||||||
uniqueBank.getChunk(0x1000, 0x10, dest, false);
|
uniqueBank.getChunk(0x1000, 0x10, dest, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnitializedReadContinue() {
|
public void testUninitializedReadContinue() {
|
||||||
byte[] dest = new byte[16];
|
byte[] dest = new byte[16];
|
||||||
int bytesRead = uniqueBank.getChunk(0x1000, 0x10, dest, true);
|
int bytesRead = uniqueBank.getChunk(0x1000, 0x10, dest, true);
|
||||||
assertEquals(0, bytesRead);
|
assertEquals(0, bytesRead);
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
||||||
assertEquals(addr(9), info.getMaxAddress());
|
assertEquals(addr(9), info.getMaxAddress());
|
||||||
try {
|
try {
|
||||||
block.getByte(addr(0));
|
block.getByte(addr(0));
|
||||||
fail("expected exception trying to read bytes on unitialized block");
|
fail("expected exception trying to read bytes on uninitialized block");
|
||||||
}
|
}
|
||||||
catch (MemoryAccessException e) {
|
catch (MemoryAccessException e) {
|
||||||
// expected
|
// expected
|
||||||
|
@ -131,7 +131,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreateUnitializedOverlayBlock() throws Exception {
|
public void testCreateUninitializedOverlayBlock() throws Exception {
|
||||||
MemoryBlock block = mem.createUninitializedBlock("test", addr(0), 10, true);
|
MemoryBlock block = mem.createUninitializedBlock("test", addr(0), 10, true);
|
||||||
|
|
||||||
assertEquals(10, block.getSize());
|
assertEquals(10, block.getSize());
|
||||||
|
@ -148,7 +148,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
||||||
assertEquals(10, info.getLength());
|
assertEquals(10, info.getLength());
|
||||||
try {
|
try {
|
||||||
block.getByte(block.getStart());
|
block.getByte(block.getStart());
|
||||||
fail("expected exception trying to read bytes on unitialized block");
|
fail("expected exception trying to read bytes on uninitialized block");
|
||||||
}
|
}
|
||||||
catch (MemoryAccessException e) {
|
catch (MemoryAccessException e) {
|
||||||
// expected
|
// expected
|
||||||
|
@ -206,7 +206,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
mem.getByte(block.getStart().add(10));
|
mem.getByte(block.getStart().add(10));
|
||||||
fail("expected exception trying to read bytes on mapped unitialized block");
|
fail("expected exception trying to read bytes on mapped uninitialized block");
|
||||||
}
|
}
|
||||||
catch (MemoryAccessException e) {
|
catch (MemoryAccessException e) {
|
||||||
// expected
|
// expected
|
||||||
|
@ -243,7 +243,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
mem.getByte(block.getStart().add(8));
|
mem.getByte(block.getStart().add(8));
|
||||||
fail("expected exception trying to read bytes on mapped unitialized block");
|
fail("expected exception trying to read bytes on mapped uninitialized block");
|
||||||
}
|
}
|
||||||
catch (MemoryAccessException e) {
|
catch (MemoryAccessException e) {
|
||||||
// expected
|
// expected
|
||||||
|
@ -533,7 +533,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSplitAndJoinUnitializedBlock() throws Exception {
|
public void testSplitAndJoinUninitializedBlock() throws Exception {
|
||||||
MemoryBlock block = mem.createUninitializedBlock("test", addr(0), 40, false);
|
MemoryBlock block = mem.createUninitializedBlock("test", addr(0), 40, false);
|
||||||
mem.split(block, addr(10));
|
mem.split(block, addr(10));
|
||||||
MemoryBlock[] blocks = mem.getBlocks();
|
MemoryBlock[] blocks = mem.getBlocks();
|
||||||
|
@ -977,7 +977,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAddressSourceInfoForUnitialized() throws Exception {
|
public void testAddressSourceInfoForUninitialized() throws Exception {
|
||||||
mem.createUninitializedBlock("test", addr(0), 10, false);
|
mem.createUninitializedBlock("test", addr(0), 10, false);
|
||||||
|
|
||||||
AddressSourceInfo info = mem.getAddressSourceInfo(addr(0));
|
AddressSourceInfo info = mem.getAddressSourceInfo(addr(0));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue