decompiler  1.0.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ghidra::ValueSetRead Class Reference

A special form of ValueSet associated with the read point of a Varnode. More...

#include <rangeutil.hh>

Public Member Functions

int4 getTypeCode (void) const
 Return '0' for normal constant, '1' for spacebase relative.
 
const CircleRangegetRange (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 compute (void)
 Compute this value set. More...
 
void printRaw (ostream &s) const
 Write a text description of to the given stream. More...
 

Private Member Functions

void setPcodeOp (PcodeOp *o, int4 slt)
 Establish read this value set corresponds to. More...
 
void addEquation (int4 slt, int4 type, const CircleRange &constraint)
 Insert an equation restricting this value set. More...
 

Private Attributes

int4 typeCode
 0=pure constant 1=stack relative
 
int4 slot
 The slot being read.
 
PcodeOpop
 The PcodeOp at the point of the value set read.
 
CircleRange range
 Range of values or offsets in this set.
 
CircleRange equationConstraint
 Constraint associated with the equation.
 
int4 equationTypeCode
 Type code of the associated equation.
 
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)
 

Friends

class ValueSetSolver
 

Detailed Description

A special form of ValueSet associated with the read point of a Varnode.

When a Varnode is read, it may have a more restricted range at the point of the read compared to the full scope. This class officially stores the value set at the point of the read (specified by PcodeOp and slot). It is computed as a final step after the main iteration has completed.

Member Function Documentation

◆ addEquation()

void ghidra::ValueSetRead::addEquation ( int4  slt,
int4  type,
const CircleRange constraint 
)
private

Insert an equation restricting this value set.

Parameters
sltis the given slot
typeis the constraint characteristic
constraintis the given range

◆ compute()

void ghidra::ValueSetRead::compute ( void  )

Compute this value set.

This value set will be the same as the ValueSet of the Varnode being read but may be modified due to additional control-flow constraints

References ghidra::ValueSet::getRange(), ghidra::ValueSet::getTypeCode(), ghidra::Varnode::getValueSet(), ghidra::ValueSet::isLeftStable(), and ghidra::ValueSet::isRightStable().

◆ printRaw()

void ghidra::ValueSetRead::printRaw ( ostream &  s) const

Write a text description of to the given stream.

Parameters
sis the stream to print to

◆ setPcodeOp()

void ghidra::ValueSetRead::setPcodeOp ( PcodeOp o,
int4  slt 
)
private

Establish read this value set corresponds to.

Parameters
ois the PcodeOp reading the value set
sltis the input slot the values are coming in from

The documentation for this class was generated from the following files: