Package ghidra.program.model.lang
Interface InstructionContext
-
- All Known Implementing Classes:
InstructionDB
,PseudoInstruction
public interface InstructionContext
InstructionContext
is utilized by a shared instruction prototype to access all relevant instruction data and context-register storage needed during instruction parse and semantic pcode generation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Address
getAddress()
Get the instruction address that this context corresponds to.MemBuffer
getMemBuffer()
Get the read-only memory buffer containing the instruction bytes.ParserContext
getParserContext()
Get the instruction parser context for the instruction which corresponds to this context object.ParserContext
getParserContext(Address instructionAddress)
Get the instruction parser context which corresponds to the specified instruction address.ProcessorContextView
getProcessorContext()
Get the read-only processor context containing the context-register state state at the corresponding instruction.
-
-
-
Method Detail
-
getAddress
Address getAddress()
Get the instruction address that this context corresponds to.- Returns:
- instruction address
-
getProcessorContext
ProcessorContextView getProcessorContext()
Get the read-only processor context containing the context-register state state at the corresponding instruction. This is primarily used during the parse phase to provide the initial context-register state.
-
getMemBuffer
MemBuffer getMemBuffer()
Get the read-only memory buffer containing the instruction bytes. Its position will correspond to the instruction address.- Returns:
- instruction memory buffer
-
getParserContext
ParserContext getParserContext() throws MemoryAccessException
Get the instruction parser context for the instruction which corresponds to this context object.- Returns:
- the instruction parser context for the instruction which corresponds to this context object.
- Throws:
MemoryAccessException
- if memory error occurred while resolving instruction details.
-
getParserContext
ParserContext getParserContext(Address instructionAddress) throws UnknownContextException, MemoryAccessException
Get the instruction parser context which corresponds to the specified instruction address. This may be obtained via either caching or by parsing the instruction at the specified address. The returned ParserContext may be cast to the prototype's implementation without checking. This method will throw an UnknownContextException if a compatible ParserContext is not found at the specified address.- Returns:
- the instruction parser context at the specified instruction address
- Throws:
UnknownContextException
- if the instruction at the specified address was not previously parsed or attempting to instantiate context resulted in an exception.MemoryAccessException
- if memory error occurred while resolving instruction details.
-
-