decompiler
1.0.0
|
Manager/container for description objects (UserPcodeOp) of user defined p-code ops. More...
#include <userop.hh>
Public Member Functions | |
UserOpManage (void) | |
Construct an empty manager. | |
~UserOpManage (void) | |
Destructor. | |
void | initialize (Architecture *glb) |
Initialize description objects for all user defined ops. More... | |
void | setDefaults (Architecture *glb) |
Create any required operations if they weren't explicitly defined. More... | |
int4 | numSegmentOps (void) const |
Number of segment operations supported. | |
UserPcodeOp * | getOp (int4 i) const |
UserPcodeOp * | getOp (const string &nm) const |
Retrieve description by name. More... | |
SegmentOp * | getSegmentOp (int4 i) const |
VolatileReadOp * | getVolatileRead (void) const |
Get (the) volatile read description. | |
VolatileWriteOp * | getVolatileWrite (void) const |
Get (the) volatile write description. | |
void | parseSegmentOp (const Element *el, Architecture *glb) |
Parse a <segmentop> XML tag. More... | |
void | parseVolatile (const Element *el, Architecture *glb) |
Parse a <volatile> XML tag. More... | |
void | parseCallOtherFixup (const Element *el, Architecture *glb) |
Parse a <callotherfixup> XML tag. More... | |
void | parseJumpAssist (const Element *el, Architecture *glb) |
Parse a <jumpassist> XML tag. More... | |
void | manualCallOtherFixup (const string &useropname, const string &outname, const vector< string > &inname, const string &snippet, Architecture *glb) |
Manually install an InjectedUserOp given just names of the user defined op and the p-code snippet. More... | |
Private Member Functions | |
void | registerOp (UserPcodeOp *op) |
Insert a new UserPcodeOp description object in the map(s) More... | |
Private Attributes | |
vector< UserPcodeOp * > | useroplist |
Description objects indexed by CALLOTHER constant id. | |
map< string, UserPcodeOp * > | useropmap |
A map from the name of the user defined operation to a description object. | |
vector< SegmentOp * > | segmentop |
Segment operations supported by this Architecture. | |
VolatileReadOp * | vol_read |
(Single) volatile read operation | |
VolatileWriteOp * | vol_write |
(Single) volatile write operation | |
Manager/container for description objects (UserPcodeOp) of user defined p-code ops.
The description objects are referenced by the CALLOTHER constant id, (or by name during initialization). During initialize(), every user defined p-code op presented by the Architecture is assigned a default UnspecializedPcodeOp description. Further processing of the .cspec or .pspec may reassign a more specialized description object by parsing specific tags using on of this class's parse* methods.
|
inline |
Retrieve a user-op description object by index
i | is the index |
Referenced by TypeOpCallother::getOperatorName(), FlowInfo::injectUserOp(), JumpAssisted::recoverModel(), InjectedUserOp::restoreXml(), SegmentOp::restoreXml(), JumpAssistOp::restoreXml(), and FlowInfo::xrefControlFlow().
UserPcodeOp * UserOpManage::getOp | ( | const string & | nm | ) | const |
Retrieve description by name.
nm | is the low-level operation name |
|
inline |
Retrieve a segment-op description object by index
i | is the index |
Referenced by ActionSegmentize::apply(), RuleSegment::applyOp(), Funcdata::createStackRef(), and EmulatePcodeOp::executeSegmentOp().
void UserOpManage::initialize | ( | Architecture * | glb | ) |
Initialize description objects for all user defined ops.
Every user defined p-code op is initially assigned an UnspecializedPcodeOp description, which may get overridden later.
glb | is the Architecture from which to draw user defined operations |
References Translate::getUserOpNames(), and Architecture::translate.
void UserOpManage::manualCallOtherFixup | ( | const string & | useropname, |
const string & | outname, | ||
const vector< string > & | inname, | ||
const string & | snippet, | ||
Architecture * | glb | ||
) |
Manually install an InjectedUserOp given just names of the user defined op and the p-code snippet.
An alternate way to attach a call-fixup to user defined p-code ops, without using XML. The p-code to inject is presented as a raw string to be handed to the p-code parser.
useropname | is the name of the user defined op |
outname | is the name of the output variable in the snippet |
inname | is the list of input variable names in the snippet |
snippet | is the raw p-code source snippet |
glb | is the owning Architecture |
References UserPcodeOp::getIndex(), PcodeInjectLibrary::manualCallOtherFixup(), and Architecture::pcodeinjectlib.
void UserOpManage::parseCallOtherFixup | ( | const Element * | el, |
Architecture * | glb | ||
) |
Parse a <callotherfixup> XML tag.
Create an InjectedUserOp description object based on the XML description and register it with this manager.
el | is the root <callotherfixup> element |
glb | is the owning Architecture |
References InjectedUserOp::restoreXml().
void UserOpManage::parseJumpAssist | ( | const Element * | el, |
Architecture * | glb | ||
) |
Parse a <jumpassist> XML tag.
Create a JumpAssistOp description object based on the XML description and register it with this manager.
el | is the root <jumpassist> element |
glb | is the owning Architecture |
References JumpAssistOp::JumpAssistOp(), and JumpAssistOp::restoreXml().
void UserOpManage::parseSegmentOp | ( | const Element * | el, |
Architecture * | glb | ||
) |
Parse a <segmentop> XML tag.
Create a SegmentOp description object based on the tag details and register it with this manager.
el | is the root <segmentop> element |
glb | is the owning Architecture |
References SegmentOp::restoreXml().
void UserOpManage::parseVolatile | ( | const Element * | el, |
Architecture * | glb | ||
) |
Parse a <volatile> XML tag.
Create either a VolatileReadOp or VolatileWriteOp description object based on the XML details and register it with this manager.
el | is the root <volatile> element |
glb | is the owning Architecture |
References Element::getAttributeName(), Element::getNumAttributes(), VolatileReadOp::restoreXml(), and VolatileWriteOp::restoreXml().
|
private |
Insert a new UserPcodeOp description object in the map(s)
Add the description to the mapping by index and the mapping by name. Make same basic sanity checks for conflicting values and duplicate operations and throw an exception if there's a problem.
op | is the new description object |
References UserPcodeOp::getIndex(), AddrSpace::getIndex(), UserPcodeOp::getName(), and SegmentOp::getSpace().
void UserOpManage::setDefaults | ( | Architecture * | glb | ) |
Create any required operations if they weren't explicitly defined.
Establish defaults for necessary operators not already defined. Currently this forces volatile read/write operations to exist.
glb | is the owning Architecture |