Ghidra 11.3.2
Ghidra internal decompiler documentation.
|
A rule controlling how parameters are assigned addresses. More...
#include <modelrules.hh>
Public Member Functions | |
ModelRule (void) | |
Constructor for use with decode. | |
ModelRule (const ModelRule &op2, const ParamListStandard *res) | |
Copy constructor. | |
ModelRule (const DatatypeFilter &typeFilter, const AssignAction &action, const ParamListStandard *res) | |
Construct from components. | |
~ModelRule (void) | |
Destructor. | |
uint4 | assignAddress (Datatype *dt, const PrototypePieces &proto, int4 pos, TypeFactory &tlist, vector< int4 > &status, ParameterPieces &res) const |
Assign an address and other details for a specific parameter or for return storage in context. | |
bool | fillinOutputMap (ParamActive *active) const |
Test and mark the trial(s) that can be valid return value. | |
bool | canAffectFillinOutput (void) const |
Return true if fillinOutputMap is active for this rule. | |
void | decode (Decoder &decoder, const ParamListStandard *res) |
Decode this rule from stream. | |
Private Attributes | |
DatatypeFilter * | filter |
Which data-types this rule applies to. | |
QualifierFilter * | qualifier |
Additional qualifiers for when the rule should apply (if non-null) | |
AssignAction * | assign |
How the Address should be assigned. | |
vector< AssignAction * > | sideeffects |
Extra actions that happen on success. | |
A rule controlling how parameters are assigned addresses.
Rules are applied to a parameter in the context of a full function prototype. A rule applies only for a specific class of data-type associated with the parameter, as determined by its DatatypeFilter, and may have other criteria limiting when it applies (via QualifierFilter).
ghidra::ModelRule::ModelRule | ( | const DatatypeFilter & | typeFilter, |
const AssignAction & | action, | ||
const ParamListStandard * | res | ||
) |
Construct from components.
The provided components are cloned into the new object.
typeFilter | is the data-type filter the rule applies before performing the action |
action | is the action that will be applied |
res | is the resource list to which this rule will be applied |
References assign, ghidra::AssignAction::clone(), ghidra::DatatypeFilter::clone(), filter, and qualifier.
uint4 ghidra::ModelRule::assignAddress | ( | Datatype * | dt, |
const PrototypePieces & | proto, | ||
int4 | pos, | ||
TypeFactory & | tlist, | ||
vector< int4 > & | status, | ||
ParameterPieces & | res | ||
) | const |
Assign an address and other details for a specific parameter or for return storage in context.
The Address is only assigned if the data-type filter and the optional qualifier filter pass, otherwise a fail response is returned. If the filters pass, the Address is assigned based on the AssignAction specific to this rule, and the action's response code is returned.
dt | is the data-type of the parameter or return value |
proto | is the high-level description of the function prototype |
pos | is the position of the parameter (pos>=0) or return storage (pos=-1) |
tlist | is a data-type factory for (possibly) transforming the data-type |
status | is the resource consumption array |
res | will hold the resulting description of the parameter |
References assign, ghidra::AssignAction::assignAddress(), ghidra::AssignAction::fail, ghidra::QualifierFilter::filter(), ghidra::DatatypeFilter::filter(), filter, qualifier, and sideeffects.
|
inline |
Return true if fillinOutputMap is active for this rule.
References assign, and ghidra::AssignAction::canAffectFillinOutput().
void ghidra::ModelRule::decode | ( | Decoder & | decoder, |
const ParamListStandard * | res | ||
) |
Decode this rule from stream.
decoder | is the stream decoder |
res | is the parameter resource list owning this rule |
References assign, ghidra::Decoder::closeElement(), ghidra::AssignAction::decodeAction(), ghidra::DatatypeFilter::decodeFilter(), ghidra::QualifierFilter::decodeFilter(), ghidra::AssignAction::decodeSideeffect(), filter, ghidra::Decoder::openElement(), ghidra::Decoder::peekElement(), qualifier, and sideeffects.
|
inline |
Test and mark the trial(s) that can be valid return value.
If the assign action could produce the trials as return value storage, return true
active | is the set of trials |
References assign, and ghidra::AssignAction::fillinOutputMap().