Interface Emulator
- All Known Implementing Classes:
- AdaptedEmulator,- DefaultEmulator
 This interface may soon be deprecated. It was extracted from what has now been renamed
 DefaultEmulator. Please consider using PcodeEmulator instead.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdd a filter on memory accessvoiddispose()Clean up resources used by the emulatorvoidexecuteInstruction(boolean stopAtBreakpoint, TaskMonitor monitor) Execute instruction at current addressGet the breakpoint tableReturns the current context register value.Get the low-level execution stateGet current execution address (or the address of the next instruction to be executed)ghidra.app.emulator.FilteredMemoryStateGet the memory state, modified by all installed access filtersbooleangetHalt()Check if the emulator has been haltedGet the address of the last instruction executed (or the instructed currently being executed)Get the memory statelonggetPC()Get the value of the program counterGet the name of the program counter registerbooleanbooleanvoidsetContextRegisterValue(RegisterValue regValue) Sets the context register value at the current execute address.voidsetExecuteAddress(long addressableWordOffset) Set the value of the program countervoidsetHalt(boolean halt) Halt or un-halt the emulator
- 
Method Details- 
getPCRegisterNameString getPCRegisterName()Get the name of the program counter register- Returns:
- the name
 
- 
setExecuteAddressvoid setExecuteAddress(long addressableWordOffset) Set the value of the program counter- Parameters:
- addressableWordOffset- the word offset of the instruction to execute next.
 
- 
getExecuteAddressAddress getExecuteAddress()Get current execution address (or the address of the next instruction to be executed)- Returns:
- current execution address
 
- 
getLastExecuteAddressAddress getLastExecuteAddress()Get the address of the last instruction executed (or the instructed currently being executed)- Returns:
- the address
 
- 
getPClong getPC()Get the value of the program counter- Returns:
- the value, i.e., offset in code space
 
- 
executeInstructionvoid executeInstruction(boolean stopAtBreakpoint, TaskMonitor monitor) throws CancelledException, LowlevelError, InstructionDecodeException Execute instruction at current address- Parameters:
- stopAtBreakpoint- if true and breakpoint hits at current execution address execution will halt without executing instruction.
- Throws:
- CancelledException- if execution was cancelled
- LowlevelError
- InstructionDecodeException
 
- 
isExecutingboolean isExecuting()- Returns:
- true if emulator is busy executing an instruction
 
- 
getEmulateExecutionStateEmulateExecutionState getEmulateExecutionState()Get the low-level execution stateThis can be useful within a memory fault handler to determine if a memory read was associated with instruction parsing (i.e., EmulateExecutionState.INSTRUCTION_DECODE) or an actual emulated read (i.e.,EmulateExecutionState.EXECUTE).- Returns:
- emulator execution state.
 
- 
getMemStateMemoryState getMemState()Get the memory state- Returns:
- the state
 
- 
addMemoryAccessFilterAdd a filter on memory access- Parameters:
- filter- the filter
 
- 
getFilteredMemStateghidra.app.emulator.FilteredMemoryState getFilteredMemState()Get the memory state, modified by all installed access filters- Returns:
- the state
 
- 
setContextRegisterValueSets the context register value at the current execute address.The Emulator should not be running when this method is invoked. Only flowing context bits should be set, as non-flowing bits will be cleared prior to parsing on instruction. In addition, any future context state set by the pcode emitter will take precedence over context set using this method. This method is primarily intended to be used to establish the initial context state. - Parameters:
- regValue- is the value to set context to
 
- 
getContextRegisterValueRegisterValue getContextRegisterValue()Returns the current context register value.The context value returned reflects its state when the previously executed instruction was parsed/executed. The context value returned will feed into the next instruction to be parsed with its non-flowing bits cleared and any future context state merged in. - Returns:
- context as a RegisterValue object
 
- 
getBreakTableBreakTableCallBack getBreakTable()Get the breakpoint table- Returns:
- the breakpoint table
 
- 
isAtBreakpointboolean isAtBreakpoint()- Returns:
- true if halted at a breakpoint
 
- 
setHaltvoid setHalt(boolean halt) Halt or un-halt the emulator- Parameters:
- halt- true to halt
 
- 
getHaltboolean getHalt()Check if the emulator has been halted- Returns:
- true if halted
 
- 
disposevoid dispose()Clean up resources used by the emulator
 
-