Class AssignAction
java.lang.Object
ghidra.program.model.lang.protorules.AssignAction
- Direct Known Subclasses:
ConsumeAs
,ConsumeExtra
,ConvertToPointer
,GotoStack
,HiddenReturnAssign
,MultiMemberAssign
,MultiSlotAssign
,MultiSlotDualAssign
An action that assigns an Address to a function prototype parameter
A request for the address of either return storage or an input parameter is made
through the assignAddress() method, which is given full information about the function prototype.
Details about how the action performs is configured through the restoreXml() method.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
protected ParamListStandard
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract int
assignAddress
(DataType dt, PrototypePieces proto, int pos, DataTypeManager dtManager, int[] status, ParameterPieces res) Assign an address and other meta-data for a specific parameter or for return storage in context The Address is assigned based on the data-type of the parameter, available register resources, and other details of the function prototype.abstract AssignAction
clone
(ParamListStandard newResource) Make a copy of this actionabstract void
Save this action and its configuration to a streamabstract boolean
Test if the given action is configured and performs identically to thisstatic AssignAction
restoreActionXml
(XmlPullParser parser, ParamListStandard res) Read the next action element from the stream and return the new configured AssignAction object.static AssignAction
restoreSideeffectXml
(XmlPullParser parser, ParamListStandard res) Read the next sideeffect element from the stream and return the new configured AssignAction object.abstract void
restoreXml
(XmlPullParser parser) Configure any details of how this action should behave from the stream
-
Field Details
-
SUCCESS
public static final int SUCCESS- See Also:
-
FAIL
public static final int FAIL- See Also:
-
NO_ASSIGNMENT
public static final int NO_ASSIGNMENT- See Also:
-
HIDDENRET_PTRPARAM
public static final int HIDDENRET_PTRPARAM- See Also:
-
HIDDENRET_SPECIALREG
public static final int HIDDENRET_SPECIALREG- See Also:
-
HIDDENRET_SPECIALREG_VOID
public static final int HIDDENRET_SPECIALREG_VOID- See Also:
-
resource
-
-
Constructor Details
-
AssignAction
-
-
Method Details
-
clone
Make a copy of this action- Parameters:
newResource
- is the new resource object that will own the clone- Returns:
- the newly allocated copy
- Throws:
InvalidInputException
- if required configuration is not present in new resource object
-
isEquivalent
Test if the given action is configured and performs identically to this- Parameters:
op
- is the given action- Returns:
- true if the two actions are equivalent
-
assignAddress
public abstract int assignAddress(DataType dt, PrototypePieces proto, int pos, DataTypeManager dtManager, int[] status, ParameterPieces res) Assign an address and other meta-data for a specific parameter or for return storage in context The Address is assigned based on the data-type of the parameter, available register resources, and other details of the function prototype. Consumed resources are marked. This method returns a response code: - SUCCESS - indicating the Address was successfully assigned - FAIL - if the Address could not be assigned - HIDDENRET_PTRPARAM - if an additional hidden return parameter is required- Parameters:
dt
- is the data-type of the parameter or return valueproto
- is the high-level description of the function prototypepos
- is the position of the parameter (pos>=0) or return storage (pos=-1)dtManager
- is a data-type manager for (possibly) transforming the data-typestatus
- is the resource consumption arrayres
- will hold the resulting description of the parameter- Returns:
- the response code
-
encode
Save this action and its configuration to a stream- Parameters:
encoder
- is the stream encoder- Throws:
IOException
- for problems writing to the stream
-
restoreXml
Configure any details of how this action should behave from the stream- Parameters:
parser
- is the given stream decoder- Throws:
XmlParseException
- is there are problems decoding the stream
-
restoreActionXml
public static AssignAction restoreActionXml(XmlPullParser parser, ParamListStandard res) throws XmlParseException Read the next action element from the stream and return the new configured AssignAction object. If the next element is not an action, throw an exception.- Parameters:
parser
- is the stream parserres
- is the resource set for the new action- Returns:
- the new action
- Throws:
XmlParseException
- for problems parsing the stream
-
restoreSideeffectXml
public static AssignAction restoreSideeffectXml(XmlPullParser parser, ParamListStandard res) throws XmlParseException Read the next sideeffect element from the stream and return the new configured AssignAction object. If the next element is not a sideeffect, throw an exception.- Parameters:
parser
- is the stream parserres
- is the resource set for the new sideeffect- Returns:
- the new sideeffect
- Throws:
XmlParseException
- for problems parsing the stream
-