mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Fix typo: unitialized -> uninitialized
This commit is contained in:
parent
6eb78e7ef2
commit
fbde367fe1
23 changed files with 55 additions and 55 deletions
|
@ -701,7 +701,7 @@ public class MemoryBlockDB implements MemoryBlock {
|
|||
}
|
||||
subBlocks.clear();
|
||||
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));
|
||||
|
||||
}
|
||||
|
|
|
@ -1074,24 +1074,24 @@ public class MemoryMapDB implements Memory, ManagerDB, LiveMemoryListener {
|
|||
}
|
||||
|
||||
@Override
|
||||
public MemoryBlock convertToInitialized(MemoryBlock unitializedBlock, byte initialValue)
|
||||
public MemoryBlock convertToInitialized(MemoryBlock uninitializedBlock, byte initialValue)
|
||||
throws MemoryBlockException, NotFoundException, LockException {
|
||||
lock.acquire();
|
||||
try {
|
||||
checkBlock(unitializedBlock);
|
||||
checkBlock(uninitializedBlock);
|
||||
program.checkExclusiveAccess();
|
||||
if (unitializedBlock.isInitialized()) {
|
||||
if (uninitializedBlock.isInitialized()) {
|
||||
throw new IllegalArgumentException(
|
||||
"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");
|
||||
}
|
||||
long size = unitializedBlock.getSize();
|
||||
long size = uninitializedBlock.getSize();
|
||||
if (size > MAX_BLOCK_SIZE) {
|
||||
throw new MemoryBlockException("Block too large to initialize");
|
||||
}
|
||||
MemoryBlockDB memBlock = (MemoryBlockDB) unitializedBlock;
|
||||
MemoryBlockDB memBlock = (MemoryBlockDB) uninitializedBlock;
|
||||
try {
|
||||
memBlock.initializeBlock(initialValue);
|
||||
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_BYTE_MAPPED = MemoryMapDBAdapterV3.V3_SUB_TYPE_BYTE_MAPPED;
|
||||
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 MemoryMapDBAdapter getAdapter(DBHandle handle, int openMode, MemoryMapDB memMap,
|
||||
|
|
|
@ -167,7 +167,7 @@ class MemoryMapDBAdapterV0 extends MemoryMapDBAdapter {
|
|||
record.setIntValue(SUB_INT_DATA1_COL, bufID);
|
||||
return new BufferSubMemoryBlock(this, record);
|
||||
case UNINITIALIZED:
|
||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNITIALIZED);
|
||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNINITIALIZED);
|
||||
return new UninitializedSubMemoryBlock(this, record);
|
||||
default:
|
||||
throw new IOException("Unknown memory block type: " + type);
|
||||
|
|
|
@ -136,7 +136,7 @@ class MemoryMapDBAdapterV2 extends MemoryMapDBAdapter {
|
|||
record.setIntValue(SUB_INT_DATA1_COL, bufID);
|
||||
return new BufferSubMemoryBlock(this, record);
|
||||
case UNINITIALIZED:
|
||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNITIALIZED);
|
||||
record.setByteValue(SUB_TYPE_COL, SUB_TYPE_UNINITIALIZED);
|
||||
return new UninitializedSubMemoryBlock(this, record);
|
||||
default:
|
||||
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_BYTE_MAPPED = 1;
|
||||
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 Schema V3_BLOCK_SCHEMA = new Schema(V3_VERSION, "Key",
|
||||
|
@ -215,7 +215,7 @@ public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
|||
if (initializeBytes) {
|
||||
return createInitializedBlock(name, startAddr, null, length, permissions);
|
||||
}
|
||||
return createUnitializedBlock(name, startAddr, length, permissions);
|
||||
return createUninitializedBlock(name, startAddr, length, permissions);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -238,7 +238,7 @@ public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
|||
return newBlock;
|
||||
}
|
||||
|
||||
MemoryBlockDB createUnitializedBlock(String name, Address startAddress, long length,
|
||||
MemoryBlockDB createUninitializedBlock(String name, Address startAddress, long length,
|
||||
int permissions) throws IOException, AddressOverflowException {
|
||||
updateAddressMapForAllAddresses(startAddress, length);
|
||||
|
||||
|
@ -246,7 +246,7 @@ public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
|||
DBRecord blockRecord = createMemoryBlockRecord(name, startAddress, length, permissions);
|
||||
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));
|
||||
|
||||
memBlockTable.putRecord(blockRecord);
|
||||
|
@ -420,7 +420,7 @@ public class MemoryMapDBAdapterV3 extends MemoryMapDBAdapter {
|
|||
return new ByteMappedSubMemoryBlock(this, record);
|
||||
case V3_SUB_TYPE_BUFFER:
|
||||
return new BufferSubMemoryBlock(this, record);
|
||||
case V3_SUB_TYPE_UNITIALIZED:
|
||||
case V3_SUB_TYPE_UNINITIALIZED:
|
||||
return new UninitializedSubMemoryBlock(this, record);
|
||||
case V3_SUB_TYPE_FILE_BYTES:
|
||||
return new FileBytesSubMemoryBlock(this, record);
|
||||
|
|
|
@ -79,7 +79,7 @@ class UninitializedSubMemoryBlock extends SubMemoryBlock {
|
|||
adapter.updateSubBlockRecord(record);
|
||||
|
||||
DBRecord newSubRecord = adapter.createSubBlockRecord(-1, 0, newLength,
|
||||
MemoryMapDBAdapter.SUB_TYPE_UNITIALIZED, 0, 0);
|
||||
MemoryMapDBAdapter.SUB_TYPE_UNINITIALIZED, 0, 0);
|
||||
|
||||
return new UninitializedSubMemoryBlock(adapter, newSubRecord);
|
||||
}
|
||||
|
|
|
@ -392,14 +392,14 @@ public interface Memory extends AddressSetView {
|
|||
/**
|
||||
* Convert an existing uninitialized block with an
|
||||
* initialized block.
|
||||
* @param unitializedBlock unitialized block to convert
|
||||
* @param uninitializedBlock uninitialized block to convert
|
||||
* @param initialValue initial value for the bytes
|
||||
* @throws LockException if exclusive lock not in place (see haveLock())
|
||||
* @throws MemoryBlockException if there is no block in memory
|
||||
* at the same address as block or if the block lengths are not
|
||||
* the same.
|
||||
*/
|
||||
public MemoryBlock convertToInitialized(MemoryBlock unitializedBlock, byte initialValue)
|
||||
public MemoryBlock convertToInitialized(MemoryBlock uninitializedBlock, byte initialValue)
|
||||
throws LockException, MemoryBlockException, NotFoundException;
|
||||
|
||||
public MemoryBlock convertToUninitialized(MemoryBlock itializedBlock)
|
||||
|
|
|
@ -75,7 +75,7 @@ public class UniqueMemoryBankTest extends AbstractGenericTest {
|
|||
}
|
||||
|
||||
@Test(expected = LowlevelError.class)
|
||||
public void testGetUnitializedByte() {
|
||||
public void testGetUninitializedByte() {
|
||||
WordInfo info = new WordInfo();
|
||||
info.setByte((byte) 0, 0);
|
||||
info.setByte((byte) 1, 1);
|
||||
|
@ -219,13 +219,13 @@ public class UniqueMemoryBankTest extends AbstractGenericTest {
|
|||
}
|
||||
|
||||
@Test(expected = LowlevelError.class)
|
||||
public void testUnitializedReadStop() {
|
||||
public void testUninitializedReadStop() {
|
||||
byte[] dest = new byte[16];
|
||||
uniqueBank.getChunk(0x1000, 0x10, dest, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnitializedReadContinue() {
|
||||
public void testUninitializedReadContinue() {
|
||||
byte[] dest = new byte[16];
|
||||
int bytesRead = uniqueBank.getChunk(0x1000, 0x10, dest, true);
|
||||
assertEquals(0, bytesRead);
|
||||
|
|
|
@ -123,7 +123,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
|||
assertEquals(addr(9), info.getMaxAddress());
|
||||
try {
|
||||
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) {
|
||||
// expected
|
||||
|
@ -131,7 +131,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testCreateUnitializedOverlayBlock() throws Exception {
|
||||
public void testCreateUninitializedOverlayBlock() throws Exception {
|
||||
MemoryBlock block = mem.createUninitializedBlock("test", addr(0), 10, true);
|
||||
|
||||
assertEquals(10, block.getSize());
|
||||
|
@ -148,7 +148,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
|||
assertEquals(10, info.getLength());
|
||||
try {
|
||||
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) {
|
||||
// expected
|
||||
|
@ -206,7 +206,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
|||
}
|
||||
try {
|
||||
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) {
|
||||
// expected
|
||||
|
@ -243,7 +243,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
|||
}
|
||||
try {
|
||||
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) {
|
||||
// expected
|
||||
|
@ -533,7 +533,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSplitAndJoinUnitializedBlock() throws Exception {
|
||||
public void testSplitAndJoinUninitializedBlock() throws Exception {
|
||||
MemoryBlock block = mem.createUninitializedBlock("test", addr(0), 40, false);
|
||||
mem.split(block, addr(10));
|
||||
MemoryBlock[] blocks = mem.getBlocks();
|
||||
|
@ -977,7 +977,7 @@ public class MemBlockDBTest extends AbstractGenericTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testAddressSourceInfoForUnitialized() throws Exception {
|
||||
public void testAddressSourceInfoForUninitialized() throws Exception {
|
||||
mem.createUninitializedBlock("test", addr(0), 10, false);
|
||||
|
||||
AddressSourceInfo info = mem.getAddressSourceInfo(addr(0));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue