Package ghidra.pcode.exec
Class PcodeProgram
java.lang.Object
ghidra.pcode.exec.PcodeProgram
- Direct Known Subclasses:
JitControlFlowModel.JitBlock,JitPassage,PcodeExpression
A p-code program to be executed by a
PcodeExecutor
This is a list of p-code operations together with a map of expected userops.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static class -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPcodeProgram(SleighLanguage language, List<PcodeOp> code, Map<Integer, ghidra.pcodeCPort.slghsymbol.UserOpSymbol> useropSymbols) Construct a p-code program with the given bindingsPcodeProgram(PcodeProgram program, List<PcodeOp> code) Construct a p-code program from a derivative of the given one -
Method Summary
Modifier and TypeMethodDescription<T> voidexecute(PcodeExecutor<T> executor, PcodeUseropLibrary<T> library) Execute this program using the given executor and libraryformat()format(boolean numberOps) static PcodeProgramfromInject(Program program, String name, int type) Generate a p-code program from a given program's inject librarystatic PcodeProgramfromInstruction(Instruction instruction) Generate a p-code program from the given instruction, without overridesstatic PcodeProgramfromInstruction(Instruction instruction, boolean includeOverrides) Generate a p-code program from the given instructiongetCode()protected StringgetHead()For display purposes, get the header above the frame, usually the class nameGet the language generating this programgetUseropName(int opNo) toString()
-
Field Details
-
language
-
code
-
useropNames
-
-
Constructor Details
-
PcodeProgram
protected PcodeProgram(SleighLanguage language, List<PcodeOp> code, Map<Integer, ghidra.pcodeCPort.slghsymbol.UserOpSymbol> useropSymbols) Construct a p-code program with the given bindings- Parameters:
language- the language that generated the p-codecode- the list of p-code opsuseropSymbols- a map of expected userop symbols
-
PcodeProgram
Construct a p-code program from a derivative of the given one- Parameters:
program- the original programcode- the code portion for this program
-
-
Method Details
-
fromInstruction
Generate a p-code program from the given instruction, without overrides- Parameters:
instruction- the instruction- Returns:
- the p-code program
-
fromInstruction
Generate a p-code program from the given instruction- Parameters:
instruction- the instructionincludeOverrides- as inInstruction.getPcode(boolean)- Returns:
- the p-code program
-
fromInject
public static PcodeProgram fromInject(Program program, String name, int type) throws MemoryAccessException, UnknownInstructionException, NotFoundException, IOException Generate a p-code program from a given program's inject library- Parameters:
program- the programname- the name of the snippettype- the type of the snippet- Returns:
- the p-code program
- Throws:
MemoryAccessException- for problems establishing the injection contextIOException- for problems while emitting the injection p-codeUnknownInstructionException- if there is no underlying instruction being injectedNotFoundException- if an expected aspect of the injection is not present in context
-
getLanguage
Get the language generating this program- Returns:
- the language
-
getCode
-
execute
Execute this program using the given executor and library- Type Parameters:
T- the type of values to be operated on- Parameters:
executor- the executorlibrary- the library
-
getHead
For display purposes, get the header above the frame, usually the class name- Returns:
- the frame's display header
-
toString
-
format
-
format
-
getUseropName
-