decompiler  1.0.0
Public Member Functions | Static Protected Member Functions | List of all members
ghidra::VolatileOp Class Reference

A base class for operations that access volatile memory. More...

#include <userop.hh>

Inheritance diagram for ghidra::VolatileOp:
ghidra::UserPcodeOp ghidra::VolatileReadOp ghidra::VolatileWriteOp

Public Member Functions

 VolatileOp (Architecture *g, const string &nm, int4 ind)
 Constructor.
 
virtual void decode (Decoder &decoder)
 Currently volatile ops only need their name.
 
- Public Member Functions inherited from ghidra::UserPcodeOp
 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...
 

Static Protected Member Functions

static string appendSize (const string &base, int4 size)
 Append a suffix to a string encoding a specific size. More...
 

Additional Inherited Members

- Public Types inherited from ghidra::UserPcodeOp
enum  userop_flags { annotation_assignment = 1, no_operator = 2 }
 Enumeration of different boolean properties that can be assigned to a CALLOTHER. More...
 
- Protected Attributes inherited from ghidra::UserPcodeOp
string name
 Low-level name of p-code operator.
 
int4 useropindex
 Index passed in the CALLOTHER op.
 
Architectureglb
 Architecture owning the user defined op.
 
uint4 flags
 Boolean attributes of the CALLOTHER.
 

Detailed Description

A base class for operations that access volatile memory.

The decompiler models volatile memory by converting any direct read or write of the memory to a function that accesses the memory. This class and its derived classes model such functions. Within the p-code control-flow, dedicated user defined ops serve as a placeholder for the (possibly unknown) effects of modifying/accessing the memory and prevent accidental constant propagation.

Member Function Documentation

◆ appendSize()

string ghidra::VolatileOp::appendSize ( const string &  base,
int4  size 
)
staticprotected

Append a suffix to a string encoding a specific size.

This allows a single user defined operator to have multiple symbol names based on the size of its operands in context.

Parameters
baseis the string to append the suffix to
sizeis the size to encode expressed as the number of bytes
Returns
the appended string

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