decompiler 1.0.0
Public Member Functions | Protected Attributes | List of all members
JumpValuesRange Class Reference

single entry switch variable that can take a range of values More...

#include <jumptable.hh>

Inheritance diagram for JumpValuesRange:
JumpValues JumpValuesRangeDefault

Public Member Functions

void setRange (const CircleRange &rng)
 Set the range of values explicitly.
 
void setStartVn (Varnode *vn)
 Set the normalized switch Varnode explicitly.
 
void setStartOp (PcodeOp *op)
 Set the starting PcodeOp explicitly.
 
virtual void truncate (int4 nm)
 
virtual uintb getSize (void) const
 Return the number of values the variables can take. More...
 
virtual bool contains (uintb val) const
 Return true if the given value is in the set of possible values. More...
 
virtual bool initializeForReading (void) const
 Initialize this for iterating over the set of possible values. More...
 
virtual bool next (void) const
 Advance the iterator, return true if there is another value. More...
 
virtual uintb getValue (void) const
 Get the current value. More...
 
virtual VarnodegetStartVarnode (void) const
 Get the Varnode associated with the current value. More...
 
virtual PcodeOpgetStartOp (void) const
 Get the PcodeOp associated with the current value. More...
 
virtual bool isReversible (void) const
 Return true if the current value can be reversed to get a label. More...
 
virtual JumpValuesclone (void) const
 Clone this iterator. More...
 
virtual void truncate (int4 nm)=0
 Truncate the number of values to the given number. More...
 
virtual uintb getSize (void) const =0
 Return the number of values the variables can take. More...
 
virtual bool contains (uintb val) const =0
 Return true if the given value is in the set of possible values. More...
 
virtual bool initializeForReading (void) const =0
 Initialize this for iterating over the set of possible values. More...
 
virtual bool next (void) const =0
 Advance the iterator, return true if there is another value. More...
 
virtual uintb getValue (void) const =0
 Get the current value. More...
 
virtual VarnodegetStartVarnode (void) const =0
 Get the Varnode associated with the current value. More...
 
virtual PcodeOpgetStartOp (void) const =0
 Get the PcodeOp associated with the current value. More...
 
virtual bool isReversible (void) const =0
 Return true if the current value can be reversed to get a label. More...
 
virtual JumpValuesclone (void) const =0
 Clone this iterator. More...
 

Protected Attributes

CircleRange range
 Acceptable range of values for the normalized switch variable.
 
Varnodenormqvn
 Varnode representing the normalized switch variable.
 
PcodeOpstartop
 First PcodeOp in the jump-table calculation.
 
uintb curval
 The current value pointed to be the iterator.
 

Detailed Description

single entry switch variable that can take a range of values

Member Function Documentation

◆ clone()

JumpValues * JumpValuesRange::clone ( void  ) const
virtual

Clone this iterator.

Implements JumpValues.

Reimplemented in JumpValuesRangeDefault.

References normqvn, range, and startop.

Referenced by JumpBasic::clone(), and JumpBasic2::clone().

◆ contains()

bool JumpValuesRange::contains ( uintb  val) const
virtual

Return true if the given value is in the set of possible values.

Implements JumpValues.

Reimplemented in JumpValuesRangeDefault.

References CircleRange::contains(), and range.

Referenced by JumpBasic::buildLabels().

◆ getSize()

uintb JumpValuesRange::getSize ( void  ) const
virtual

Return the number of values the variables can take.

Implements JumpValues.

Reimplemented in JumpValuesRangeDefault.

References CircleRange::getSize(), and range.

Referenced by JumpBasic::findNormalized(), JumpBasic::getTableSize(), JumpBasic::recoverModel(), and JumpBasic2::recoverModel().

◆ getStartOp()

PcodeOp * JumpValuesRange::getStartOp ( void  ) const
virtual

Get the PcodeOp associated with the current value.

Implements JumpValues.

Reimplemented in JumpValuesRangeDefault.

References startop.

Referenced by JumpBasic::buildAddresses().

◆ getStartVarnode()

Varnode * JumpValuesRange::getStartVarnode ( void  ) const
virtual

Get the Varnode associated with the current value.

Implements JumpValues.

Reimplemented in JumpValuesRangeDefault.

References normqvn.

Referenced by JumpBasic::buildAddresses().

◆ getValue()

uintb JumpValuesRange::getValue ( void  ) const
virtual

Get the current value.

Implements JumpValues.

References curval.

Referenced by JumpBasic::buildAddresses(), and JumpBasic::buildLabels().

◆ initializeForReading()

bool JumpValuesRange::initializeForReading ( void  ) const
virtual

Initialize this for iterating over the set of possible values.

Returns
true if there are any values to iterate over

Implements JumpValues.

Reimplemented in JumpValuesRangeDefault.

References curval, CircleRange::getMin(), CircleRange::getSize(), and range.

Referenced by JumpBasic::buildAddresses(), and JumpBasic::buildLabels().

◆ isReversible()

virtual bool JumpValuesRange::isReversible ( void  ) const
inlinevirtual

Return true if the current value can be reversed to get a label.

Implements JumpValues.

Reimplemented in JumpValuesRangeDefault.

Referenced by JumpBasic::buildLabels().

◆ next()

bool JumpValuesRange::next ( void  ) const
virtual

Advance the iterator, return true if there is another value.

Implements JumpValues.

Reimplemented in JumpValuesRangeDefault.

References curval, CircleRange::getNext(), and range.

Referenced by JumpBasic::buildAddresses(), and JumpBasic::buildLabels().

◆ truncate()

void JumpValuesRange::truncate ( int4  nm)
virtual

The starting value for the range and the step is preserved. The ending value is set so there are exactly the given number of elements in the range.

Parameters
nmis the given number

Implements JumpValues.

References count_leading_zeros(), CircleRange::getMask(), CircleRange::getMin(), CircleRange::getStep(), range, and CircleRange::setRange().

Referenced by JumpBasic::sanityCheck().


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