Class ConstructTpl
java.lang.Object
ghidra.app.plugin.processors.sleigh.template.ConstructTpl
A constructor template, representing the semantic action of a SLEIGH constructor, without
its final context. The constructor template is made up of a list of p-code op templates,
which are in turn made up of varnode templates.
This is one step removed from the final array of PcodeOp objects, but:
- Constants may still need to incorporate context dependent address resolution and relative offsets.
- Certain p-code operations may still need expansion to include a dynamic LOAD or STORE operation.
- The list may hold "build" directives for sub-constructor templates.
- The list may still hold "label" information for the final resolution of relative jump offsets.
The final PcodeOps are produced by handing this to the build() method of PcodeEmit which has
the InstructionContext necessary for final resolution.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for use with restoreXMLConstructTpl
(OpTpl[] opvec) Manually build a constructor template.ConstructTpl
(OpTpl[] opvec, HandleTpl res, int nmLabels) Manually build a constructor template from pieces. -
Method Summary
Modifier and TypeMethodDescriptionint
OpTpl[]
getOpVec()
int
restoreXml
(XmlPullParser parser, AddressFactory factory) Restore this template from a \tag in an XML stream.
-
Constructor Details
-
ConstructTpl
public ConstructTpl()Constructor for use with restoreXML -
ConstructTpl
Manually build a constructor template. This is useful for building constructor templates outside of the normal SLEIGH pipeline, as for an internally created InjectPayload.- Parameters:
opvec
- is the list of p-code op templates making up the constructor
-
ConstructTpl
Manually build a constructor template from pieces. This is used to translate from the internal SLEIGH compiler pcodeCPort.semantics.ConstructTpl- Parameters:
opvec
- is the list of p-code op templates making up the constructorres
- is the result handle template for the constructornmLabels
- is the number of labels int the template
-
-
Method Details
-
getNumLabels
public int getNumLabels()- Returns:
- the number of labels needing resolution in this template
-
getOpVec
- Returns:
- the list of p-code op templates making up this constructor template
-
getResult
- Returns:
- the (possibly dynamic) location of the final semantic value produced by this constructor
-
restoreXml
public int restoreXml(XmlPullParser parser, AddressFactory factory) throws UnknownInstructionException Restore this template from a \tag in an XML stream. - Parameters:
parser
- is the XML streamfactory
- is for manufacturing Address objects- Returns:
- the constructor section id described by the tag
- Throws:
UnknownInstructionException
- if the p-code templates contain unknown op-codes
-