Package ghidra.app.emulator
Class Emulator
- java.lang.Object
- 
- ghidra.app.emulator.Emulator
 
- 
 public class Emulator extends java.lang.Object
- 
- 
Constructor SummaryConstructors Constructor Description Emulator(EmulatorConfiguration cfg)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMemoryAccessFilter(MemoryAccessFilter filter)voidaddProvider(MemoryLoadImage provider, AddressSetView view)Add memory load image providerMemoryStatecloneMemory()java.util.List<java.lang.String>disassemble(java.lang.Integer count)Disassemble from the current execute addressvoiddispose()voidexecuteInstruction(boolean stopAtBreakpoint, TaskMonitor monitor)AddressgenAddress(java.lang.String addr)BreakTableCallBackgetBreakTable()RegisterValuegetContextRegisterValue()Returns the current context register value.java.util.Set<java.lang.String>getDefaultContext()EmulateExecutionStategetEmulateExecutionState()AddressgetExecuteAddress()ghidra.app.emulator.FilteredMemoryStategetFilteredMemState()booleangetHalt()SleighLanguagegetLanguage()AddressgetLastExecuteAddress()FilteredMemoryPageOverlaygetMemoryBank(AddressSpace space, int ps)MemoryStategetMemState()longgetPC()java.lang.StringgetPCRegisterName()intgetTickCount()booleanisAtBreakpoint()booleanisExecuting()voidsetContextRegisterValue(RegisterValue regValue)Sets the context register value at the current execute address.voidsetExecuteAddress(long addressableWordOffset)voidsetHalt(boolean halt)
 
- 
- 
- 
Constructor Detail- 
Emulatorpublic Emulator(EmulatorConfiguration cfg) 
 
- 
 - 
Method Detail- 
cloneMemorypublic MemoryState cloneMemory() 
 - 
getMemoryBankpublic FilteredMemoryPageOverlay getMemoryBank(AddressSpace space, int ps) 
 - 
disposepublic void dispose() 
 - 
genAddresspublic Address genAddress(java.lang.String addr) 
 - 
getPCpublic long getPC() 
 - 
getPCRegisterNamepublic java.lang.String getPCRegisterName() 
 - 
getMemStatepublic MemoryState getMemState() 
 - 
getFilteredMemStatepublic ghidra.app.emulator.FilteredMemoryState getFilteredMemState() 
 - 
addMemoryAccessFilterpublic void addMemoryAccessFilter(MemoryAccessFilter filter) 
 - 
getBreakTablepublic BreakTableCallBack getBreakTable() 
 - 
setExecuteAddresspublic void setExecuteAddress(long addressableWordOffset) 
 - 
getExecuteAddresspublic Address getExecuteAddress() 
 - 
getLastExecuteAddresspublic Address getLastExecuteAddress() 
 - 
getDefaultContextpublic java.util.Set<java.lang.String> getDefaultContext() 
 - 
setHaltpublic void setHalt(boolean halt) 
 - 
getHaltpublic boolean getHalt() 
 - 
executeInstructionpublic void executeInstruction(boolean stopAtBreakpoint, TaskMonitor monitor) throws CancelledException, LowlevelError, InstructionDecodeException
 - 
isAtBreakpointpublic boolean isAtBreakpoint() - Returns:
- true if halted at a breakpoint
 
 - 
getEmulateExecutionStatepublic EmulateExecutionState getEmulateExecutionState() - Returns:
- emulator execution state. This can be useful within a memory fault handler to determine if a memory read was associated with instruction parsing (i.e., PCODE_EMIT) or normal an actual emulated read (i.e., EXECUTE).
 
 - 
isExecutingpublic boolean isExecuting() - Returns:
- true if emulator is busy executing an instruction
 
 - 
getLanguagepublic SleighLanguage getLanguage() 
 - 
disassemblepublic java.util.List<java.lang.String> disassemble(java.lang.Integer count) Disassemble from the current execute address- Parameters:
- count- number of contiguous instructions to disassemble
- Returns:
- list of instructions
 
 - 
getTickCountpublic int getTickCount() 
 - 
getContextRegisterValuepublic RegisterValue 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
 
 - 
setContextRegisterValuepublic void setContextRegisterValue(RegisterValue regValue) Sets 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
 
 - 
addProviderpublic void addProvider(MemoryLoadImage provider, AddressSetView view) Add memory load image provider- Parameters:
- provider- memory load image provider
- view- memory region which corresponds to provider
 
 
- 
 
-