|
decompiler 1.0.0
|
A data-type resolved from an associated TypeUnion or TypeStruct. More...
#include <unionresolve.hh>
Public Member Functions | |
| ResolvedUnion (Datatype *unresType) | |
| Construct a data-type that resolves to itself. More... | |
| ResolvedUnion (Datatype *unresType, int4 fldNum, TypeFactory &typegrp) | |
| Construct a resolution with a specific field number. More... | |
| ResolvedUnion (const ResolvedUnion &op, Datatype *res) | |
| Copy constructor with updated resolve data-type. | |
| Datatype * | getDatatype (void) const |
| Get the resolved data-type. | |
| Datatype * | getBase (void) const |
| Get the union or structure being referenced. | |
| int4 | getFieldNum (void) const |
| Get the index of the resolved field or -1. | |
| bool | isLocked (void) const |
| Return true if the field resolution is locked. | |
| bool | update (const ResolvedUnion &op) |
| Update a resolution with a new data-type. More... | |
| void | setResolve (Datatype *res) |
| Update the resolution data-type (without changing field resolution) | |
| void | setLock (bool val) |
| Set whether this resolution is locked against overrides. | |
Private Attributes | |
| Datatype * | resolve |
| The resolved data-type. | |
| Datatype * | baseType |
| Union or Structure being resolved (pointers and partials stripped) | |
| int4 | fieldNum |
| Index of field referenced by resolve. | |
| bool | lock |
| If true, resolution cannot be overridden. | |
Friends | |
| class | ScoreUnionFields |
A data-type resolved from an associated TypeUnion or TypeStruct.
A parent refers to either: 1) A union 2) A structure that is an effective union (1 field filling the entire structure) OR 3) A pointer to a union/structure
This object represents a data-type that is resolved via analysis from the parent data-type. The resolved data-type can be either: 1) A specific field of the parent (if the parent is not a pointer) 2) A pointer to a specific field of the underlying union/structure (if the parent is a pointer) 3) The parent data-type itself (either a pointer or not) The fieldNum (if non-negative) selects a particular field of the underlying union/structure. If the parent is a pointer, the resolution is a pointer to the field. If the parent is not a pointer, the resolution is the field itself. A fieldNum of -1 indicates that the parent data-type itself is the resolution.
| ghidra::ResolvedUnion::ResolvedUnion | ( | Datatype * | unresType | ) |
Construct a data-type that resolves to itself.
The original data-type must either be a union, a partial union, a structure with a single field, an array with a single element, or a pointer to one of these data-types. The object is set up initially to resolve to the parent.
| unresType | is the original unresolved data-type |
References baseType, fieldNum, ghidra::Datatype::getMetatype(), lock, resolve, ghidra::TYPE_PARTIALUNION, and ghidra::TYPE_PTR.
| ghidra::ResolvedUnion::ResolvedUnion | ( | Datatype * | unresType, |
| int4 | fldNum, | ||
| TypeFactory & | typegrp | ||
| ) |
Construct a resolution with a specific field number.
| unresType | is the data-type that needs resolution |
| fldNum | is the index of the particular field to resolve to (or -1 to resolve to unresType) |
| typegrp | is a TypeFactory used to construct the resolved data-type of the field |
References baseType, fieldNum, ghidra::Datatype::getDepend(), ghidra::TypeFactory::getExactPiece(), ghidra::TypeUnion::getField(), ghidra::Datatype::getMetatype(), ghidra::TypePartialUnion::getOffset(), ghidra::TypePartialUnion::getParentUnion(), ghidra::TypePointer::getPtrTo(), ghidra::Datatype::getSize(), ghidra::Datatype::getStripped(), ghidra::TypePartialUnion::getStripped(), ghidra::TypeFactory::getTypePointerStripArray(), ghidra::TypePointer::getWordSize(), lock, resolve, ghidra::TypeField::type, ghidra::TYPE_PARTIALUNION, and ghidra::TYPE_PTR.
| bool ghidra::ResolvedUnion::update | ( | const ResolvedUnion & | op | ) |