decompiler
1.0.0
|
Description of a context variable within the disassembly context blob. More...
#include <globalcontext.hh>
Public Member Functions | |
ContextBitRange (void) | |
Constructor for use with restoreXml() | |
ContextBitRange (int4 sbit, int4 ebit) | |
Construct a context value given an absolute bit range. More... | |
int4 | getShift (void) const |
Return the shift-amount for this value. | |
uintm | getMask (void) const |
Return the mask for this value. | |
int4 | getWord (void) const |
Return the word index for this value. | |
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... | |
Private Attributes | |
int4 | word |
Index of word containing this context value. | |
int4 | startbit |
Starting bit of the value within its word (0=most significant bit 1=least significant) | |
int4 | endbit |
Ending bit of the value within its word. | |
int4 | shift |
Right-shift amount to apply when unpacking this value from its word. | |
uintm | mask |
Mask to apply (after shifting) when unpacking this value from its word. | |
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.
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.
sbit | is the starting (most significant) bit of the new value |
ebit | is the ending (least significant) bit of the new value |
|
inline |
Retrieve this value from a given context blob.
vec | is the given context blob (as an array of uintm words) |
References mask, shift, and word.
Referenced by ContextDatabase::getDefaultValue(), and ContextDatabase::getVariable().
|
inline |
Set this value within a given context blob.
vec | is the given context blob to alter (as an array of uintm words) |
val | is the integer value to set |
References mask, shift, and word.
Referenced by ContextInternal::restoreContext(), ContextDatabase::setVariable(), ContextDatabase::setVariableDefault(), and ContextDatabase::setVariableRegion().