Package ghidra.pcode.emu
Class SleighInstructionDecoder
java.lang.Object
ghidra.pcode.emu.SleighInstructionDecoder
- All Implemented Interfaces:
InstructionDecoder
The default instruction decoder, based on Sleigh
This simply uses a Disassembler on the machine's memory state.
-
Field Summary
FieldsChangeModifier and TypeFieldDescriptionprotected final AddressFactoryprotected InstructionBlockprotected final Disassemblerprotected final Languageprotected Stringprotected intprotected final PcodeExecutorState<?> -
Constructor Summary
ConstructorsChangeConstructorDescriptionSleighInstructionDecoder(Language language, PcodeExecutorState<?> state) Construct a Sleigh instruction decoder -
Method Summary
ChangeModifier and TypeMethodDescriptionvoidInform the decoder that the emulator thread just branchedprotected intCompute the "length" of an instruction, including any delay-slotted instructions that followMODIFIEDdecodeInstruction(Address address, RegisterValue context) Decode the instruction starting at the given address using the given contextNEWGet the language for this decoderGet the last instruction decodedintGet the length of the last decoded instruction, including delay slotsNEWprotected voidparseNewBlock(Address address, RegisterValue context) NEWprotected booleanuseCachedInstruction(Address address, RegisterValue context)
-
Field Details
-
language
-
state
-
addrFactory
-
disassembler
-
lastMsg
-
block
-
lengthWithDelays
protected int lengthWithDelays
-
-
Constructor Details
-
SleighInstructionDecoder
Construct a Sleigh instruction decoder- Parameters:
language- the language to decoderstate- the state containing the target program, probably the shared state of the p-code machine. It must be possible to obtain concrete buffers on this state.- See Also:
-
-
Method Details
-
getLanguage NEW
Description copied from interface:InstructionDecoderGet the language for this decoder- Specified by:
getLanguagein interfaceInstructionDecoder- Returns:
- the language
-
useCachedInstruction NEW
-
parseNewBlock NEW
-
decodeInstruction MODIFIED
return type: Instruction → PseudoInstruction-ghidra.program.model.listing.Instruction decodeInstruction(ghidra.program.model.address.Address address, ghidra.program.model.lang.RegisterValue context)+ghidra.app.util.PseudoInstruction decodeInstruction(ghidra.program.model.address.Address address, ghidra.program.model.lang.RegisterValue context)Description copied from interface:InstructionDecoderDecode the instruction starting at the given address using the given contextThis method cannot return null. If a decode error occurs, it must throw an exception.
- Specified by:
decodeInstructionin interfaceInstructionDecoder- Parameters:
address- the address to start decodingcontext- the disassembler/decode context- Returns:
- the instruction
-
branched
Description copied from interface:InstructionDecoderInform the decoder that the emulator thread just branched- Specified by:
branchedin interfaceInstructionDecoder- Parameters:
address-
-
computeLength
protected int computeLength()Compute the "length" of an instruction, including any delay-slotted instructions that follow- Returns:
- the length
-
getLastLengthWithDelays
public int getLastLengthWithDelays()Description copied from interface:InstructionDecoderGet the length of the last decoded instruction, including delay slots- Specified by:
getLastLengthWithDelaysin interfaceInstructionDecoder- Returns:
- the length
-
getLastInstruction
Description copied from interface:InstructionDecoderGet the last instruction decoded- Specified by:
getLastInstructionin interfaceInstructionDecoder- Returns:
- the instruction
-