Package ghidra.test.processors.support
Class EmulatorTestRunner
java.lang.Object
ghidra.test.processors.support.EmulatorTestRunner
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsChangeConstructorDescriptionEmulatorTestRunner(Program program, PCodeTestGroup testGroup, ExecutionListener executionListener) -
Method Summary
ChangeModifier and TypeMethodDescriptionvoidaddDumpPoint(Address breakAddr, Address dumpAddr, int dumpSize, int elementSize, EmulatorTestRunner.DumpFormat elementFormat, String comment) Add memory dump pointvoidaddDumpPoint(Address breakAddr, Register dumpAddrReg, int relativeOffset, AddressSpace dumpAddrSpace, int dumpSize, int elementSize, EmulatorTestRunner.DumpFormat elementFormat, String comment) Add memory dump pointvoiddispose()NEWbooleanexecute(int timeLimitMS) Execute test group without instruction stepping/tracingbooleanexecuteSingleStep(int stepLimit) intGet number of CALLOTHER errors detected when a test pass was registered.NEWPcodeThread<byte[]> getRegisterValue(Register reg) NEWbooleanAllows the emulator to run until it's interrupted, returning true if the interrupt is caused by a breakpoint.voidsetContextRegister(RegisterValue ctxRegValue) voidsetRegister(String regName, long value) voidsetRegister(String regName, BigInteger value) NEWbooleanStep the emulator one instruction, returning true if it's completed without interruption.REMOVEDEmulatorHelperRemovedREMOVEDbooleanexecute(int timeLimitMS, TaskMonitor monitor) Removed
-
Constructor Details
-
EmulatorTestRunner
public EmulatorTestRunner(Program program, PCodeTestGroup testGroup, ExecutionListener executionListener)
-
-
Method Details
-
dispose
public void dispose() -
getTestGroup
-
getProgram
-
getEmulatorThread NEW
-
setContextRegister
-
getCurrentAddress
-
getCurrentInstruction
-
getRegisterValue
-
getRegisterValueString
-
setRegister
-
setRegister
-
addDumpPoint
public void addDumpPoint(Address breakAddr, Address dumpAddr, int dumpSize, int elementSize, EmulatorTestRunner.DumpFormat elementFormat, String comment) Add memory dump point- Parameters:
breakAddr- instruction address at which execution should pause (before it is executed) so that the specified memory may be dumped to the log during trace execution mode.dumpAddr- memory address which should be dumpeddumpSize- number elements which should be dumpedelementSize- size of each element in bytes (be reasonable!)elementFormat- HEX, DECIMAL or FLOATcomment- dump comment
-
addDumpPoint
public void addDumpPoint(Address breakAddr, Register dumpAddrReg, int relativeOffset, AddressSpace dumpAddrSpace, int dumpSize, int elementSize, EmulatorTestRunner.DumpFormat elementFormat, String comment) Add memory dump point- Parameters:
breakAddr- instruction address at which execution should pause (before it is executed) so that the specified memory may be dumped to the log during trace execution mode.dumpAddrReg- register containing the memory address offset which should be dumpedrelativeOffset- dump register relative offsetdumpAddrSpace- address space to which memory offset should be applieddumpSize- number elements which should be dumpedelementSize- size of each element in bytes (be reasonable!)elementFormat- HEX, DECIMAL or FLOATcomment- dump comment
-
getEmuError
-
getCallOtherErrors
public int getCallOtherErrors()Get number of CALLOTHER errors detected when a test pass was registered. This number should be subtracted from the pass count and possibly added to the failure count. Number does not reflect total number of CALLOTHER pcodeops encountered but only the number of passed tests affected. See log for all CALLOTHER executions detected.- Returns:
- number of CALLOTHER errors
-
runToBreakpoint NEW
public boolean runToBreakpoint()Allows the emulator to run until it's interrupted, returning true if the interrupt is caused by a breakpoint.- Returns:
- true if interrupted by a breakpoint, false otherwise. This may also run indefinitely.
-
stepIgnoreBreakpoints NEW
public boolean stepIgnoreBreakpoints()Step the emulator one instruction, returning true if it's completed without interruption.- Returns:
- true if completed, false if interrupted. Though unlikely, this may also run indefinitely.
-
execute NEW
public boolean execute(int timeLimitMS) Execute test group without instruction stepping/tracing- Parameters:
timeLimitMS- the maximum number of milliseconds to execute before suspending and terminating- Returns:
- true if execution reached the "done" breakpoint
-
executeSingleStep
public boolean executeSingleStep(int stepLimit)
-