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

A jump-table starting range with two possible execution paths. More...

#include <jumptable.hh>

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

Public Member Functions

void setExtraValue (uintb val)
 Set the extra value explicitly.
 
void setDefaultVn (Varnode *vn)
 Set the associated start Varnode.
 
void setDefaultOp (PcodeOp *op)
 Set the associated start PcodeOp.
 
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 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.
 
- Public Member Functions inherited from ghidra::JumpValuesRange
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 getValue (void) const
 Get the current value.
 

Private Attributes

uintb extravalue
 The extra value.
 
Varnodeextravn
 The starting Varnode associated with the extra value.
 
PcodeOpextraop
 The starting PcodeOp associated with the extra value.
 
bool lastvalue
 true if the extra value has been visited by 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.
 
- Protected Attributes inherited from ghidra::JumpValuesRange
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

A jump-table starting range with two possible execution paths.

This extends the basic JumpValuesRange having a single entry switch variable and adds a second entry point that takes only a single value. This value comes last in the iteration.

Member Function Documentation

◆ clone()

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

◆ contains()

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

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

Reimplemented from ghidra::JumpValuesRange.

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

◆ getSize()

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

Return the number of values the variables can take.

Reimplemented from ghidra::JumpValuesRange.

References ghidra::CircleRange::getSize(), and ghidra::JumpValuesRange::range.

◆ getStartOp()

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

Get the PcodeOp associated with the current value.

Reimplemented from ghidra::JumpValuesRange.

References extraop, lastvalue, and ghidra::JumpValuesRange::startop.

◆ getStartVarnode()

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

Get the Varnode associated with the current value.

Reimplemented from ghidra::JumpValuesRange.

References extravn, lastvalue, and ghidra::JumpValuesRange::normqvn.

◆ initializeForReading()

bool ghidra::JumpValuesRangeDefault::initializeForReading ( void  ) const
virtual

Initialize this for iterating over the set of possible values.

Returns
true if there are any values to iterate over

Reimplemented from ghidra::JumpValuesRange.

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

◆ isReversible()

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

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

Reimplemented from ghidra::JumpValuesRange.

References lastvalue.

◆ next()

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

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

Reimplemented from ghidra::JumpValuesRange.

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


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