Ghidra Decompiler Analysis Engine
Public Member Functions | Protected Attributes | List of all members
UserPcodeOp Class Referenceabstract

The base class for a detailed definition of a user-defined p-code operation. More...

#include <userop.hh>

Inheritance diagram for UserPcodeOp:
Inheritance graph
[legend]
Collaboration diagram for UserPcodeOp:
Collaboration graph
[legend]

Public Member Functions

virtual string getOperatorName (const PcodeOp *op) const
 Get the symbol representing this operation in decompiled code. More...
 
virtual void restoreXml (const Element *el)=0
 Restore the detailed description from an XML stream. More...
 

Protected Attributes

string name
 Low-level name of p-code operator.
 
int4 useropindex
 Index passed in the CALLOTHER op.
 
Architectureglb
 Architecture owning the user defined op.
 

Detailed Description

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 restoreXml().

Member Function Documentation

◆ getOperatorName()

virtual string UserPcodeOp::getOperatorName ( const PcodeOp op) const
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

Parameters
opis the operation (in context) where a symbol is needed
Returns
the symbol as a string

Reimplemented in VolatileWriteOp, and VolatileReadOp.

◆ restoreXml()

virtual void UserPcodeOp::restoreXml ( const Element el)
pure virtual

Restore the detailed description from an XML stream.

The details of how a user defined operation behaves can be dynamically configured from an XML tag.

Parameters
elis the root XML element describing the op

Implemented in JumpAssistOp, SegmentOp, VolatileWriteOp, VolatileReadOp, InjectedUserOp, and UnspecializedPcodeOp.


The documentation for this class was generated from the following file: