Ghidra Decompiler Analysis Engine
Public Member Functions | List of all members
ContextBitRange Class Reference

Description of a context variable within the disassembly context blob. More...

#include <globalcontext.hh>

Public Member Functions

 ContextBitRange (int4 sbit, int4 ebit)
 Construct a context value given an absolute bit range. More...
 
void setValue (uintm *vec, uintm val) const
 Set this value within a given context blob. More...
 
uintm getValue (const uintm *vec) const
 Retrieve this value from a given context blob. More...
 

Detailed Description

Description of a context variable within the disassembly context blob.

Disassembly context is stored as individual (integer) values packed into a sequence of words. This class represents the info for encoding or decoding a single value within this sequence. A value is a contiguous range of bits within one context word. Size can range from 1 bit up to the size of a word.

Constructor & Destructor Documentation

◆ ContextBitRange()

ContextBitRange::ContextBitRange ( int4  sbit,
int4  ebit 
)

Construct a context value given an absolute bit range.

Bits within the whole context blob are labeled starting with 0 as the most significant bit in the first word in the sequence. The new context value must be contained within a single word.

Parameters
sbitis the starting (most significant) bit of the new value
ebitis the ending (least significant) bit of the new value

Member Function Documentation

◆ getValue()

uintm ContextBitRange::getValue ( const uintm *  vec) const
inline

Retrieve this value from a given context blob.

Parameters
vecis the given context blob (as an array of uintm words)
Returns
the recovered integer value

◆ setValue()

void ContextBitRange::setValue ( uintm *  vec,
uintm  val 
) const
inline

Set this value within a given context blob.

Parameters
vecis the given context blob to alter (as an array of uintm words)
valis the integer value to set

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