Package ghidra.program.model.pcode
Class PcodeDataTypeManager
- java.lang.Object
-
- ghidra.program.model.pcode.PcodeDataTypeManager
-
public class PcodeDataTypeManager extends java.lang.Object
Class for making Ghidra DataTypes suitable for use with pcode
-
-
Constructor Summary
Constructors Constructor Description PcodeDataTypeManager(Program prog)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
buildCoreTypes()
Build the coretypes xml elementjava.lang.StringBuilder
buildStructTypeZeroSizeOveride(DataType type)
Build an XML document string representing the Structure that has its size reported as zero.void
buildType(java.lang.StringBuilder resBuf, DataType type, int size)
Build an XML document string representing the type information for a data typevoid
buildTypeRef(java.lang.StringBuilder resBuf, DataType type, int size)
Generate an XML tag describing the given data-type.DataType
findBaseType(java.lang.String nm, java.lang.String idstr)
Find a base/built-in data-type with the given name and/or id.DataType
findUndefined(int size)
Program
getProgram()
DataType
readXMLDataType(XmlPullParser parser)
Get the data type that corresponds to the given XML element.
-
-
-
Constructor Detail
-
PcodeDataTypeManager
public PcodeDataTypeManager(Program prog)
-
-
Method Detail
-
getProgram
public Program getProgram()
-
findUndefined
public DataType findUndefined(int size)
-
findBaseType
public DataType findBaseType(java.lang.String nm, java.lang.String idstr)
Find a base/built-in data-type with the given name and/or id. If an id is provided and a corresponding data-type exists, this data-type is returned. Otherwise the first built-in data-type with a matching name is returned- Parameters:
nm
- name of data-typeidstr
- is an optional string containing a data-type id number- Returns:
- the data-type object or null if no matching data-type exists
-
readXMLDataType
public DataType readXMLDataType(XmlPullParser parser) throws PcodeXMLException
Get the data type that corresponds to the given XML element.- Parameters:
parser
- the xml parser- Returns:
- the read data type
- Throws:
PcodeXMLException
- if the data type could be resolved from the element
-
buildTypeRef
public void buildTypeRef(java.lang.StringBuilder resBuf, DataType type, int size)
Generate an XML tag describing the given data-type. Most data-types produce a<type>
tag, fully describing the data-type. Where possible a<typeref>
tag is produced, which just gives the name of the data-type, deferring a full description of the data-type. For certain simple or nameless data-types, a<type>
tag is emitted giving a full description.- Parameters:
resBuf
- is the stream to append the tag totype
- is the data-type to be convertedsize
- is the size in bytes of the specific instance of the data-type
-
buildType
public void buildType(java.lang.StringBuilder resBuf, DataType type, int size)
Build an XML document string representing the type information for a data type- Parameters:
resBuf
- is the stream to append the document totype
- data type to build XML forsize
- size of the data type
-
buildStructTypeZeroSizeOveride
public java.lang.StringBuilder buildStructTypeZeroSizeOveride(DataType type)
Build an XML document string representing the Structure that has its size reported as zero.- Parameters:
type
- data type to build XML for- Returns:
- XML string document
-
buildCoreTypes
public java.lang.String buildCoreTypes()
Build the coretypes xml element- Returns:
- coretypes xml element
-
-