decompiler
1.0.0
|
The base class for a detailed definition of a user-defined p-code operation. More...
#include <userop.hh>
Public Types | |
enum | userop_flags { annotation_assignment = 1, no_operator = 2 } |
Enumeration of different boolean properties that can be assigned to a CALLOTHER. More... | |
Public Member Functions | |
UserPcodeOp (Architecture *g, const string &nm, int4 ind) | |
Construct from name and index. | |
const string & | getName (void) const |
Get the low-level name of the p-code op. | |
int4 | getIndex (void) const |
Get the constant id of the op. | |
uint4 | getDisplay (void) const |
Get display type (0=functional) | |
virtual | ~UserPcodeOp (void) |
Destructor. | |
virtual string | getOperatorName (const PcodeOp *op) const |
Get the symbol representing this operation in decompiled code. More... | |
virtual int4 | extractAnnotationSize (const Varnode *vn, const PcodeOp *op) |
Assign a size to an annotation input to this userop. More... | |
virtual void | decode (Decoder &decoder)=0 |
Restore the detailed description from a stream element. More... | |
Protected Attributes | |
string | name |
Low-level name of p-code operator. | |
int4 | useropindex |
Index passed in the CALLOTHER op. | |
Architecture * | glb |
Architecture owning the user defined op. | |
uint4 | flags |
Boolean attributes of the CALLOTHER. | |
The base class for a detailed definition of a user-defined p-code operation.
Within the raw p-code framework, the CALLOTHER opcode represents a user defined operation. At this level, the operation is just a placeholder for inputs and outputs to same black-box procedure. The first input parameter (index 0) must be a constant id associated with the particular procedure. Classes derived off of this base class provide a more specialized definition of an operation/procedure. The specialized classes are managed via UserOpManage and are associated with CALLOTHER ops via the constant id.
The derived classes can in principle implement any functionality, tailored to the architecture or program. At this base level, the only commonality is a formal name of the operator and its CALLOTHER index. A facility for reading in implementation details is provided via decode().
|
pure virtual |
Restore the detailed description from a stream element.
The details of how a user defined operation behaves are parsed from the element.
decoder | is the stream decoder |
Implemented in ghidra::JumpAssistOp, ghidra::SegmentOp, ghidra::VolatileOp, ghidra::InjectedUserOp, and ghidra::UnspecializedPcodeOp.
Referenced by ghidra::JumpAssistOp::getCalcSize(), ghidra::InjectedUserOp::getInjectId(), ghidra::SegmentOp::getNumVariableTerms(), and getOperatorName().
Assign a size to an annotation input to this userop.
Assuming an annotation refers to a special symbol accessed by this operation, retrieve the size (in bytes) of the symbol, which isn't ordinarily stored as part of the annotation.
Reimplemented in ghidra::VolatileWriteOp, and ghidra::VolatileReadOp.
References name.
Referenced by getOperatorName(), ghidra::PrintC::pushAnnotation(), ghidra::VolatileReadOp::VolatileReadOp(), and ghidra::VolatileWriteOp::VolatileWriteOp().
|
inlinevirtual |
Get the symbol representing this operation in decompiled code.
This will return the symbol formally displayed in source code, which can be tailored more than the low-level name
op | is the operation (in context) where a symbol is needed |
Reimplemented in ghidra::VolatileWriteOp, and ghidra::VolatileReadOp.
References decode(), extractAnnotationSize(), and name.
Referenced by ghidra::TypeOpCallother::getOperatorName(), ghidra::VolatileReadOp::VolatileReadOp(), and ghidra::VolatileWriteOp::VolatileWriteOp().