|
Ghidra 11.4.2
Ghidra internal decompiler documentation.
|
A data-type resolved from an associated TypeUnion or TypeStruct. More...
#include <unionresolve.hh>
Public Member Functions | |
| ResolvedUnion (Datatype *parent) | |
| Construct a data-type that resolves to itself. | |
| ResolvedUnion (Datatype *parent, int4 fldNum, TypeFactory &typegrp) | |
| Construct a reference to a field. | |
| 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 |
| Is this locked against overrides. | |
| 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. | |
| 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 * | parent | ) |
Construct a data-type that resolves to itself.
The original parent 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.
| parent | is the original parent data-type |
References baseType, fieldNum, ghidra::Datatype::getMetatype(), lock, resolve, and ghidra::TYPE_PTR.
| ghidra::ResolvedUnion::ResolvedUnion | ( | Datatype * | parent, |
| int4 | fldNum, | ||
| TypeFactory & | typegrp | ||
| ) |
Construct a reference to a field.
The original parent must be a union or structure.
| parent | is the original parent |
| fldNum | is the index of the particular field to resolve to (or -1 to resolve to parent) |
| typegrp | is a TypeFactory used to construct the resolved data-type of the field |
References baseType, fieldNum, ghidra::Datatype::getDepend(), ghidra::Datatype::getMetatype(), ghidra::TypePointer::getPtrTo(), ghidra::Datatype::getSize(), ghidra::TypeFactory::getTypePointer(), ghidra::TypePointer::getWordSize(), lock, resolve, ghidra::TYPE_PARTIALUNION, and ghidra::TYPE_PTR.