Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::JumpValuesRange Class Reference

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

#include <jumptable.hh>

Inheritance diagram for ghidra::JumpValuesRange:
[legend]
Collaboration diagram for ghidra::JumpValuesRange:
[legend]

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.
 
virtual bool contains (uintb val) const
 Return true if the given value is in the set of possible values.
 
virtual bool initializeForReading (void) const
 Initialize this for iterating over the set of possible values.
 
virtual bool next (void) const
 Advance the iterator, return true if there is another value.
 
virtual uintb getValue (void) const
 Get the current value.
 
virtual VarnodegetStartVarnode (void) const
 Get the Varnode associated with the current value.
 
virtual PcodeOpgetStartOp (void) const
 Get the PcodeOp associated with the current value.
 
virtual bool isReversible (void) const
 Return true if the current value can be reversed to get a label.
 
virtual JumpValuesclone (void) const
 Clone this iterator.
 

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.
 

Additional Inherited Members

- Static Public Attributes inherited from ghidra::JumpValues
static const uint8 NO_LABEL = 0xBAD1ABE1BAD1ABE1
 Jump-table label reserved to indicate no label.
 

Detailed Description

single entry switch variable that can take a range of values

Member Function Documentation

◆ clone()

JumpValues * ghidra::JumpValuesRange::clone ( void  ) const
virtual

Clone this iterator.

Implements ghidra::JumpValues.

Reimplemented in ghidra::JumpValuesRangeDefault.

References normqvn, range, and startop.

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

◆ contains()

bool ghidra::JumpValuesRange::contains ( uintb  val) const
virtual

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

Implements ghidra::JumpValues.

Reimplemented in ghidra::JumpValuesRangeDefault.

References ghidra::CircleRange::contains(), and range.

Referenced by ghidra::JumpBasic::buildLabels().

◆ getSize()

uintb ghidra::JumpValuesRange::getSize ( void  ) const
virtual

◆ getStartOp()

PcodeOp * ghidra::JumpValuesRange::getStartOp ( void  ) const
virtual

Get the PcodeOp associated with the current value.

Implements ghidra::JumpValues.

Reimplemented in ghidra::JumpValuesRangeDefault.

References startop.

Referenced by ghidra::JumpBasic::buildAddresses().

◆ getStartVarnode()

Varnode * ghidra::JumpValuesRange::getStartVarnode ( void  ) const
virtual

Get the Varnode associated with the current value.

Implements ghidra::JumpValues.

Reimplemented in ghidra::JumpValuesRangeDefault.

References normqvn.

Referenced by ghidra::JumpBasic::buildAddresses().

◆ getValue()

uintb ghidra::JumpValuesRange::getValue ( void  ) const
virtual

Get the current value.

Implements ghidra::JumpValues.

References curval.

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

◆ initializeForReading()

bool ghidra::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 ghidra::JumpValues.

Reimplemented in ghidra::JumpValuesRangeDefault.

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

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

◆ isReversible()

virtual bool ghidra::JumpValuesRange::isReversible ( void  ) const
inlinevirtual

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

Implements ghidra::JumpValues.

Reimplemented in ghidra::JumpValuesRangeDefault.

Referenced by ghidra::JumpBasic::buildLabels().

◆ next()

bool ghidra::JumpValuesRange::next ( void  ) const
virtual

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

Implements ghidra::JumpValues.

Reimplemented in ghidra::JumpValuesRangeDefault.

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

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

◆ truncate()

void ghidra::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 ghidra::JumpValues.

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

Referenced by ghidra::JumpBasic::sanityCheck().


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