Package ghidra.test.processors.support
Class PCodeTestAbstractControlBlock
java.lang.Object
ghidra.test.processors.support.PCodeTestAbstractControlBlock
- Direct Known Subclasses:
PCodeTestControlBlock,PCodeTestGroupControlBlock
PCodeTestAbstractControlBlock data is models the general capabilities of the
TestInfo data structure which is used for different puposes as handled by extensions of this
class.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsChangeModifier and TypeFieldDescriptionprotected final AddressSpaceprotected final AddressSpaceprotected final Structureprotected final Addressprotected final intprotected final Program -
Method Summary
ChangeModifier and TypeMethodDescriptionprotected voidapplyU4Data(Address addr) protected longemuRead(PcodeThread<byte[]> emu, Address addr, int size) protected StringemuReadString(PcodeThread<byte[]> emu, Address strPtrAddr) Read an ASCII-encoded string, perhaps with wide characters, from the emulator.protected voidemuWrite(PcodeThread<byte[]> emu, Address addr, int size, long value) getFunctionInfo(int functionIndex) getFunctionInfo(String functionName) protected AddressgetMirroredDataAddress(EmulatorTestRunner emuTestRunner, Address addr) intprotected intgetStructureComponent(Structure testInfoStruct, String fieldName) protected AddressreadCodePointer(MemBuffer buffer, int bufferOffset, boolean updateReference) protected voidreadControlBlock(boolean applyStruct) protected AddressreadDataPointer(MemBuffer buffer, int bufferOffset, boolean updateReference) protected AddressCheck for a Data pointer at the specified address and return the referenced address.protected AddressreadPointer(int controlBlockOffset) REMOVEDStringemuReadString(EmulatorHelper emu, Address strPtrAddr) RemovedREMOVEDlongemuRead(EmulatorHelper emu, Address addr, int size) RemovedREMOVEDvoidemuWrite(EmulatorHelper emu, Address addr, int size, long value) Removed
-
Field Details
-
program
-
codeSpace
-
dataSpace
-
pointerSize
protected final int pointerSize -
infoStructAddr
-
infoProgramStruct
-
-
Method Details
-
getInfoStructureAddress
-
getFunctionInfo
-
getFunctionInfo
-
getNumberFunctions
public int getNumberFunctions() -
readDefinedDataPointer
Check for a Data pointer at the specified address and return the referenced address.- Parameters:
addr- address of stored pointer- Returns:
- pointer referenced address or null if no pointer found
-
readCodePointer
protected Address readCodePointer(MemBuffer buffer, int bufferOffset, boolean updateReference) throws MemoryAccessException - Throws:
MemoryAccessException
-
readDataPointer
-
readPointer
- Throws:
MemoryAccessException
-
applyU4Data
-
getStructureComponent
-
readControlBlock
protected void readControlBlock(boolean applyStruct) throws ghidra.test.processors.support.PCodeTestAbstractControlBlock.InvalidControlBlockException, CodeUnitInsertionException - Throws:
ghidra.test.processors.support.PCodeTestAbstractControlBlock.InvalidControlBlockExceptionCodeUnitInsertionException
-
emuReadString
Read an ASCII-encoded string, perhaps with wide characters, from the emulator.This is really a hack, but suffices for these tests. The character size is taken from the program's data organization. However, even if wide characters are used, this only reads the least-significant byte, effectively truncating each to the ASCII-2 range [0-255].
- Parameters:
emu- the emulatorstrPtrAddr- the pointer to the string- Returns:
- the string
-
emuRead
-
emuWrite
-
getMirroredDataAddress
-