Class ConstructTpl
- java.lang.Object
-
- ghidra.app.plugin.processors.sleigh.template.ConstructTpl
-
public class ConstructTpl extends java.lang.Object
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
Constructors Constructor Description ConstructTpl()
Constructor for use with restoreXMLConstructTpl(OpTpl[] opvec)
Manually build a constructor template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNumLabels()
OpTpl[]
getOpVec()
HandleTpl
getResult()
int
restoreXml(XmlPullParser parser, AddressFactory factory)
Restore this template from a \tag in an XML stream.
-
-
-
Constructor Detail
-
ConstructTpl
public ConstructTpl()
Constructor for use with restoreXML
-
ConstructTpl
public ConstructTpl(OpTpl[] opvec)
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
-
-
Method Detail
-
getNumLabels
public int getNumLabels()
- Returns:
- the number of labels needing resolution in this template
-
getOpVec
public OpTpl[] getOpVec()
- Returns:
- the list of p-code op templates making up this constructor template
-
getResult
public HandleTpl 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
-
-