decompiler
1.0.0
|
Information about how a HighVariable fits into a larger group or Symbol. More...
#include <variable.hh>
Public Member Functions | |
VariablePiece (HighVariable *h, int4 offset, HighVariable *grp=(HighVariable *) 0) | |
~VariablePiece (void) | |
Destructor. | |
HighVariable * | getHigh (void) const |
Get the HighVariable associate with this piece. | |
VariableGroup * | getGroup (void) const |
Get the central group. | |
int4 | getOffset (void) const |
Get the offset of this within its group. | |
int4 | getSize (void) const |
Return the number of bytes in this piece. | |
const Cover & | getCover (void) const |
Get the cover associated with this piece. | |
int4 | numIntersection (void) const |
Get number of pieces this intersects with. | |
const VariablePiece * | getIntersection (int4 i) const |
Get i-th piece this intersects with. | |
void | markIntersectionDirty (void) const |
Mark all pieces as needing intersection recalculation. | |
void | markExtendCoverDirty (void) const |
Mark all intersecting pieces as having a dirty extended cover. | |
void | updateIntersections (void) const |
Calculate intersections with other pieces in the group. More... | |
void | updateCover (void) const |
Calculate extended cover based on intersections. More... | |
void | transferGroup (VariableGroup *newGroup) |
Transfer this piece to another VariableGroup. More... | |
void | setHigh (HighVariable *newHigh) |
Move ownership of this to another HighVariable. | |
void | mergeGroups (VariablePiece *op2, vector< HighVariable *> &mergePairs) |
Combine two VariableGroups. More... | |
Private Attributes | |
VariableGroup * | group |
Group to which this piece belongs. | |
HighVariable * | high |
HighVariable owning this piece. | |
int4 | groupOffset |
Byte offset of this piece within the group. | |
int4 | size |
Number of bytes in this piece. | |
vector< const VariablePiece * > | intersection |
List of VariablePieces this piece intersects with. | |
Cover | cover |
Extended cover for the piece, taking into account intersections. | |
Friends | |
class | VariableGroup |
Information about how a HighVariable fits into a larger group or Symbol.
This is an extension to a HighVariable object that is assigned if the HighVariable is part of a group of mutually overlapping HighVariables. It describes the overlaps and how they affect the HighVariable Cover.
ghidra::VariablePiece::VariablePiece | ( | HighVariable * | h, |
int4 | offset, | ||
HighVariable * | grp = (HighVariable *)0 |
||
) |
Construct piece given a HighVariable and its position within the whole. If this is the first piece in the group, allocate a new VariableGroup object.
h | is the given HighVariable to treat as a piece |
offset | is the byte offset of the piece within the whole |
grp | is another HighVariable in the whole, or null if this is the first piece |
References getGroup(), ghidra::HighVariable::getInstance(), ghidra::Varnode::getSize(), ghidra::HighVariable::piece, and ghidra::VariableGroup::size.
void ghidra::VariablePiece::mergeGroups | ( | VariablePiece * | op2, |
vector< HighVariable *> & | mergePairs | ||
) |
Combine two VariableGroups.
Combine the VariableGroup associated this and the given other VariablePiece into one group. Offsets are adjusted so that this and the other VariablePiece have the same offset. Combining in this way requires pieces of the same size and offset to be merged. This method does not do the merging but passes back a list of HighVariable pairs that need to be merged. The first element in the pair will have its VariablePiece in the new group, and the second element will have its VariablePiece freed in preparation for the merge.
op2 | is the given other VariablePiece |
mergePairs | passes back the collection of HighVariable pairs that must be merged |
References ghidra::VariableGroup::adjustOffsets(), group, groupOffset, high, ghidra::HighVariable::piece, ghidra::VariableGroup::pieceSet, and transferGroup().
void ghidra::VariablePiece::transferGroup | ( | VariableGroup * | newGroup | ) |
Transfer this piece to another VariableGroup.
If there are no remaining references to the old VariableGroup it is deleted.
newGroup | is the new VariableGroup to transfer this to |
References ghidra::VariableGroup::addPiece().
Referenced by ghidra::VariableGroup::combineGroups(), and mergeGroups().
void ghidra::VariablePiece::updateCover | ( | void | ) | const |
Calculate extended cover based on intersections.
Union internal covers of all pieces intersecting with this.
References ghidra::HighVariable::coverdirty, ghidra::HighVariable::extendcoverdirty, ghidra::HighVariable::internalCover, and ghidra::HighVariable::updateInternalCover().
void ghidra::VariablePiece::updateIntersections | ( | void | ) | const |
Calculate intersections with other pieces in the group.
Compute list of exactly the HighVariable pieces that intersect with this.
References groupOffset, ghidra::HighVariable::intersectdirty, ghidra::VariableGroup::size, and size.
Referenced by ghidra::Merge::inflateTest().