Package ghidra.test.processors.support
Class EmulatorTestRunner
- java.lang.Object
-
- ghidra.test.processors.support.EmulatorTestRunner
-
public class EmulatorTestRunner extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EmulatorTestRunner.DumpFormat
-
Constructor Summary
Constructors Constructor Description EmulatorTestRunner(Program program, PCodeTestGroup testGroup, ExecutionListener executionListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDumpPoint(Address breakAddr, Address dumpAddr, int dumpSize, int elementSize, EmulatorTestRunner.DumpFormat elementFormat, java.lang.String comment)
Add memory dump pointvoid
addDumpPoint(Address breakAddr, Register dumpAddrReg, int relativeOffset, AddressSpace dumpAddrSpace, int dumpSize, int elementSize, EmulatorTestRunner.DumpFormat elementFormat, java.lang.String comment)
Add memory dump pointvoid
dispose()
boolean
execute(int timeLimitMS, TaskMonitor monitor)
Execute test group without instruction stepping/tracingboolean
executeSingleStep(int stepLimit)
int
getCallOtherErrors()
Get number of CALLOTHER errors detected when a test pass was registered.Address
getCurrentAddress()
Instruction
getCurrentInstruction()
java.lang.String
getEmuError()
EmulatorHelper
getEmulatorHelper()
Program
getProgram()
RegisterValue
getRegisterValue(Register reg)
java.lang.String
getRegisterValueString(Register reg)
PCodeTestGroup
getTestGroup()
void
setContextRegister(RegisterValue ctxRegValue)
void
setRegister(java.lang.String regName, long value)
void
setRegister(java.lang.String regName, java.math.BigInteger value)
-
-
-
Constructor Detail
-
EmulatorTestRunner
public EmulatorTestRunner(Program program, PCodeTestGroup testGroup, ExecutionListener executionListener)
-
-
Method Detail
-
dispose
public void dispose()
-
getTestGroup
public PCodeTestGroup getTestGroup()
-
getProgram
public Program getProgram()
-
getEmulatorHelper
public EmulatorHelper getEmulatorHelper()
-
setContextRegister
public void setContextRegister(RegisterValue ctxRegValue)
-
getCurrentAddress
public Address getCurrentAddress()
-
getCurrentInstruction
public Instruction getCurrentInstruction()
-
getRegisterValue
public RegisterValue getRegisterValue(Register reg)
-
getRegisterValueString
public java.lang.String getRegisterValueString(Register reg)
-
setRegister
public void setRegister(java.lang.String regName, long value)
-
setRegister
public void setRegister(java.lang.String regName, java.math.BigInteger value)
-
addDumpPoint
public void addDumpPoint(Address breakAddr, Address dumpAddr, int dumpSize, int elementSize, EmulatorTestRunner.DumpFormat elementFormat, java.lang.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, java.lang.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
public java.lang.String 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
-
execute
public boolean execute(int timeLimitMS, TaskMonitor monitor) throws CancelledException
Execute test group without instruction stepping/tracing- Parameters:
timeLimitMS
-monitor
-- Returns:
- Throws:
CancelledException
-
executeSingleStep
public boolean executeSingleStep(int stepLimit)
-
-