decompiler
1.0.0
|
A range of values attached to a Varnode within a data-flow subsystem. More...
#include <rangeutil.hh>
Classes | |
class | Equation |
An external that can be applied to a ValueSet. More... | |
Public Member Functions | |
int4 | getCount (void) const |
Get the current iteration count. | |
const CircleRange * | getLandMark (void) const |
Get any landmark range. More... | |
int4 | getTypeCode (void) const |
Return '0' for normal constant, '1' for spacebase relative. | |
Varnode * | getVarnode (void) const |
Get the Varnode attached to this ValueSet. | |
const CircleRange & | getRange (void) const |
Get the actual range of values. | |
bool | isLeftStable (void) const |
Return true if the left boundary hasn't been changing. | |
bool | isRightStable (void) const |
Return true if the right boundary hasn't been changing. | |
void | printRaw (ostream &s) const |
Write a text description of to the given stream. More... | |
Static Public Attributes | |
static const int4 | MAX_STEP = 32 |
Private Member Functions | |
bool | doesEquationApply (int4 num, int4 slot) const |
Does the indicated equation apply for the given input slot. More... | |
void | setFull (void) |
Mark value set as possibly containing any value. | |
void | setVarnode (Varnode *v, int4 tCode) |
Attach this to given Varnode and set initial values. More... | |
void | addEquation (int4 slot, int4 type, const CircleRange &constraint) |
Insert an equation restricting this value set. More... | |
void | addLandmark (int4 type, const CircleRange &constraint) |
Add a widening landmark. | |
bool | computeTypeCode (void) |
Figure out if this value set is absolute or relative. More... | |
bool | iterate (Widener &widener) |
Regenerate this value set from operator inputs. More... | |
Private Attributes | |
int4 | typeCode |
0=pure constant 1=stack relative | |
int4 | numParams |
Number of input parameters to defining operation. | |
int4 | count |
Depth first numbering / widening count. | |
OpCode | opCode |
Op-code defining Varnode. | |
bool | leftIsStable |
Set to true if left boundary of range didn't change (last iteration) | |
bool | rightIsStable |
Set to true if right boundary of range didn't change (last iteration) | |
Varnode * | vn |
Varnode whose set this represents. | |
CircleRange | range |
Range of values or offsets in this set. | |
vector< Equation > | equations |
Any equations associated with this value set. | |
Partition * | partHead |
If Varnode is a component head, pointer to corresponding Partition. | |
ValueSet * | next |
Next ValueSet to iterate. | |
Friends | |
class | ValueSetSolver |
A range of values attached to a Varnode within a data-flow subsystem.
This class acts as both the set of values for the Varnode and as a node in a sub-graph overlaying the full data-flow of the function containing the Varnode. The values are stored in the CircleRange field and can be interpreted either as absolute values (if typeCode is 0) or as values relative to a stack pointer or some other register (if typeCode is non-zero).
|
private |
Insert an equation restricting this value set.
Equations are stored as an array of (slot,range) pairs, ordered on slot.
slot | is the given slot |
type | is the constraint characteristic |
constraint | is the given range |
Referenced by ValueSetSolver::generateFalseEquation(), and ValueSetSolver::generateTrueEquation().
|
private |
Figure out if this value set is absolute or relative.
Examine the input value sets that determine this set and decide if it is relative. In general, this will be relative if any of its inputs are. Certain combinations are indeterminate, which this method flags by returning true. The Varnode attached to this must have a defining op.
References CPUI_CAST, CPUI_COPY, CPUI_INDIRECT, CPUI_INT_ADD, CPUI_INT_SUB, CPUI_MULTIEQUAL, CPUI_PTRADD, CPUI_PTRSUB, PcodeOp::getIn(), Varnode::getValueSet(), and typeCode.
|
inlineprivate |
const CircleRange * ValueSet::getLandMark | ( | void | ) | const |
Get any landmark range.
If a landmark was associated with this value set, return its range, otherwise return null.
Referenced by WidenerFull::doWidening().
|
private |
Regenerate this value set from operator inputs.
Recalculate this value set by grabbing the value sets of the inputs to the operator defining the Varnode attached to this value set and pushing them forward through the operator.
References Widener::checkFreeze(), CircleRange::circleUnion(), CPUI_MULTIEQUAL, Widener::doWidening(), CircleRange::getEnd(), PcodeOp::getIn(), CircleRange::getMin(), Varnode::getSize(), Varnode::getValueSet(), CircleRange::intersect(), CircleRange::isEmpty(), leftIsStable, CircleRange::minimalContainer(), CircleRange::pushForwardBinary(), CircleRange::pushForwardTrinary(), CircleRange::pushForwardUnary(), range, rightIsStable, CircleRange::setFull(), and vn.
Referenced by ValueSetSolver::solve().
void ValueSet::printRaw | ( | ostream & | s | ) | const |
Write a text description of to the given stream.
s | is the stream to print to |
References CPUI_MAX, and get_opname().
Referenced by ValueSetSolver::solve().
|
private |
Attach this to given Varnode and set initial values.
The initial values in this are set based on the type of Varnode:
v | is the given Varnode to attach to |
tCode | indicates whether to treat values as constants are relative offsets |
References PcodeOp::code(), CPUI_COPY, CPUI_INDIRECT, CPUI_MAX, PcodeOp::numInput(), and Varnode::setValueSet().
|
static |
Maximum step inferred for a value set
Referenced by CircleRange::printRaw().