decompiler
1.0.0
|
An implementation of the TypeFactory interface, query a Ghidra client for data-type information. More...
#include <typegrp_ghidra.hh>
Public Member Functions | |
TypeFactoryGhidra (ArchitectureGhidra *g) | |
Constructor. | |
Public Member Functions inherited from TypeFactory | |
TypeFactory (Architecture *g) | |
Construct a factory. More... | |
void | setupSizes (void) |
Derive some size information from Architecture. More... | |
void | clear (void) |
Clear out all types. More... | |
void | clearNoncore (void) |
Clear out non-core types. More... | |
virtual | ~TypeFactory (void) |
Destructor. | |
void | setStructAlign (int4 al) |
Set the default structure alignment. | |
int4 | getStructAlign (void) const |
Get the default structure alignment. | |
int4 | getSizeOfInt (void) const |
Get the size of the default "int". | |
Architecture * | getArch (void) const |
Get the Architecture object. | |
Datatype * | findByName (const string &n) |
Return type of given name. More... | |
Datatype * | setName (Datatype *ct, const string &n) |
Set the given types name. More... | |
bool | setFields (vector< TypeField > &fd, TypeStruct *ot, int4 fixedsize) |
Set fields on a TypeStruct. More... | |
bool | setEnumValues (const vector< string > &namelist, const vector< uintb > &vallist, const vector< bool > &assignlist, TypeEnum *te) |
Set named values for an enumeration. More... | |
Datatype * | restoreXmlType (const Element *el) |
Restore Datatype from XML. More... | |
Datatype * | restoreXmlTypeWithCodeFlags (const Element *el, bool hasThisPtr, bool isConstructor, bool isDestructor) |
Restore data-type from XML with extra "code" flags. More... | |
TypeVoid * | getTypeVoid (void) |
Get the "void" data-type. More... | |
Datatype * | getBaseNoChar (int4 s, type_metatype m) |
Get atomic type excluding "char". More... | |
Datatype * | getBase (int4 s, type_metatype m) |
Get atomic type. More... | |
Datatype * | getBase (int4 s, type_metatype m, const string &n) |
Get named atomic type. More... | |
TypeCode * | getTypeCode (void) |
Get an "anonymous" function data-type. More... | |
TypePointer * | getTypePointer (int4 s, Datatype *pt, uint4 ws) |
Construct a pointer data-type. More... | |
TypePointer * | getTypePointerAbsolute (int4 s, Datatype *pt, uint4 ws) |
Construct an absolute pointer data-type. More... | |
TypePointer * | getTypePointerNoDepth (int4 s, Datatype *pt, uint4 ws) |
Construct a depth limited pointer data-type. More... | |
TypeArray * | getTypeArray (int4 as, Datatype *ao) |
Construct an array data-type. More... | |
TypeStruct * | getTypeStruct (const string &n) |
Create an (empty) structure. More... | |
TypeEnum * | getTypeEnum (const string &n) |
Create an (empty) enumeration. More... | |
TypeSpacebase * | getTypeSpacebase (AddrSpace *id, const Address &addr) |
Create a "spacebase" type. More... | |
TypeCode * | getTypeCode (ProtoModel *model, Datatype *outtype, const vector< Datatype * > &intypes, bool dotdotdot) |
Create a "function" datatype. More... | |
void | destroyType (Datatype *ct) |
Remove a data-type from this. More... | |
Datatype * | downChain (Datatype *ptrtype, uintb &off) |
Find a sub-type matching a pointer and offset. More... | |
void | dependentOrder (vector< Datatype * > &deporder) const |
Place all data-types in dependency order. More... | |
void | saveXml (ostream &s) const |
Save this container to stream. More... | |
void | saveXmlCoreTypes (ostream &s) const |
Save core types to stream. More... | |
void | restoreXml (const Element *el) |
Restore this container from a stream. More... | |
void | restoreXmlCoreTypes (const Element *el) |
Initialize basic type names. More... | |
void | parseDataOrganization (const Element *el) |
Parse the <data_organization> tag. More... | |
void | parseEnumConfig (const Element *el) |
Parse the <enum> tag. More... | |
void | setCoreType (const string &name, int4 size, type_metatype meta, bool chartp) |
Create a core data-type. More... | |
void | cacheCoreTypes (void) |
Cache common types. More... | |
Protected Member Functions | |
virtual Datatype * | findById (const string &n, uint8 id) |
Search by name and id. More... | |
Protected Member Functions inherited from TypeFactory | |
Datatype * | findByIdLocal (const string &nm, uint8 id) const |
Search locally by name and id. More... | |
Additional Inherited Members | |
Protected Attributes inherited from TypeFactory | |
Architecture * | glb |
The Architecture object that owns this TypeFactory. | |
An implementation of the TypeFactory interface, query a Ghidra client for data-type information.
Requests for a specific data-type name and id are marshaled to the Ghidra client, which sends back a description of the data-type. The description is parsed and converted into a Datatype object and cached in this object.
|
protectedvirtual |
Search by name and id.
Search for a Datatype by name and/or id. Derived classes may search outside this container.
n | is the name of the data-type |
id | is the type id of the data-type |
Reimplemented from TypeFactory.
References TypeFactory::findById(), TypeFactory::glb, and TypeFactory::restoreXmlType().