GTIRB
v2.2.0
GrammaTech Intermediate Representation for Binaries: C++ API
|
A contiguous region of bytes in a binary. More...
#include <ByteInterval.hpp>
Public Types | |
using | block_iterator = boost::transform_iterator< BlockToNode< Node >, BlockSet::index< by_offset >::type::iterator > |
Iterator over Block objects. More... | |
using | block_range = boost::iterator_range< block_iterator > |
Range of Block objects. More... | |
using | block_subrange = boost::iterator_range< boost::transform_iterator< BlockToNode< Node >, BlockIntMap::codomain_type::iterator > > |
Sub-range of blocks overlapping an address or range of addreses. More... | |
template<typename T > | |
using | bytes_iterator = BytesBaseIterator< ByteInterval, T > |
Iterator over bytes. More... | |
template<typename T > | |
using | bytes_range = boost::iterator_range< bytes_iterator< T > > |
Range over bytes. More... | |
using | code_block_iterator = boost::transform_iterator< BlockToNode< CodeBlock >, boost::filter_iterator< BlockKindEquals< Node::Kind::CodeBlock >, BlockSet::index< by_offset >::type::iterator > > |
Iterator over CodeBlock objects. More... | |
using | code_block_range = boost::iterator_range< code_block_iterator > |
Range of CodeBlock objects. More... | |
using | code_block_subrange = boost::iterator_range< boost::transform_iterator< BlockToNode< CodeBlock >, boost::filter_iterator< BlockKindEquals< Node::Kind::CodeBlock >, boost::indirect_iterator< BlockIntMap::codomain_type::iterator > >> > |
Sub-range of code blocks overlapping an address or range of addreses. More... | |
using | const_block_iterator = boost::transform_iterator< BlockToNode< const Node >, BlockSet::index< by_offset >::type::const_iterator > |
Const iterator over Block objects. More... | |
using | const_block_range = boost::iterator_range< const_block_iterator > |
Const range of Block objects. More... | |
using | const_block_subrange = boost::iterator_range< boost::transform_iterator< BlockToNode< const Node >, BlockIntMap::codomain_type::const_iterator > > |
Const sub-range of blocks overlapping an address or range of addreses. More... | |
template<typename T > | |
using | const_bytes_iterator = BytesBaseIterator< const ByteInterval, T > |
Const iterator over bytes. More... | |
template<typename T > | |
using | const_bytes_range = boost::iterator_range< const_bytes_iterator< T > > |
Const range over bytes. More... | |
using | const_code_block_iterator = boost::transform_iterator< BlockToNode< const CodeBlock >, boost::filter_iterator< BlockKindEquals< Node::Kind::CodeBlock >, BlockSet::index< by_offset >::type::const_iterator > > |
Const iterator over CodeBlock objects. More... | |
using | const_code_block_range = boost::iterator_range< const_code_block_iterator > |
Const range of CodeBlock objects. More... | |
using | const_code_block_subrange = boost::iterator_range< boost::transform_iterator< BlockToNode< const CodeBlock >, boost::filter_iterator< BlockKindEquals< Node::Kind::CodeBlock >, boost::indirect_iterator< BlockIntMap::codomain_type::const_iterator > >> > |
Const sub-range of code blocks overlapping an address or range of addreses. More... | |
using | const_data_block_iterator = boost::transform_iterator< BlockToNode< const DataBlock >, boost::filter_iterator< BlockKindEquals< Node::Kind::DataBlock >, BlockSet::index< by_offset >::type::const_iterator > > |
Const iterator over DataBlock objects. More... | |
using | const_data_block_range = boost::iterator_range< const_data_block_iterator > |
Const range of DataBlock objects. More... | |
using | const_data_block_subrange = boost::iterator_range< boost::transform_iterator< BlockToNode< const DataBlock >, boost::filter_iterator< BlockKindEquals< Node::Kind::DataBlock >, boost::indirect_iterator< BlockIntMap::codomain_type::const_iterator > >> > |
Const sub-range of data blocks overlapping an address or range of addreses. More... | |
using | const_symbolic_expression_iterator = boost::transform_iterator< SymExprPairToElement< ConstSymbolicExpressionElement >, SymbolicExpressionMap::const_iterator > |
Const iterator over SymbolicExpressionElement objects. More... | |
using | const_symbolic_expression_range = boost::iterator_range< const_symbolic_expression_iterator > |
Const range of SymbolicExpressionElement objects. More... | |
using | ConstSymbolicExpressionElement = SymbolicExpressionElementBase< const ByteInterval > |
A symbolic expression paired with the information needed to look up or alter the symbolic expression after the fact. More... | |
using | data_block_iterator = boost::transform_iterator< BlockToNode< DataBlock >, boost::filter_iterator< BlockKindEquals< Node::Kind::DataBlock >, BlockSet::index< by_offset >::type::iterator > > |
Iterator over DataBlock objects. More... | |
using | data_block_range = boost::iterator_range< data_block_iterator > |
Range of DataBlock objects. More... | |
using | data_block_subrange = boost::iterator_range< boost::transform_iterator< BlockToNode< DataBlock >, boost::filter_iterator< BlockKindEquals< Node::Kind::DataBlock >, boost::indirect_iterator< BlockIntMap::codomain_type::iterator > >> > |
Sub-range of data blocks overlapping an address or range of addreses. More... | |
using | symbolic_expression_iterator = boost::transform_iterator< SymExprPairToElement< SymbolicExpressionElement >, SymbolicExpressionMap::iterator > |
Iterator over SymbolicExpressionElement objects. More... | |
using | symbolic_expression_range = boost::iterator_range< symbolic_expression_iterator > |
Range of SymbolicExpressionElement objects. More... | |
using | SymbolicExpressionElement = SymbolicExpressionElementBase< ByteInterval > |
A symbolic expression paired with the information needed to look up or alter the symbolic expression after the fact. More... | |
Public Member Functions | |
template<typename BlockType , typename... Args> | |
BlockType * | addBlock (Context &C, uint64_t O, Args &&... A) |
Creates a new Block of the given type at a given offset. More... | |
ChangeStatus | addBlock (uint64_t Off, CodeBlock *N) |
Move an existing CodeBlock to be a part of this interval. More... | |
ChangeStatus | addBlock (uint64_t Off, DataBlock *N) |
Move an existing DataBlock to be a part of this interval. More... | |
template<class ExprType , class... Args> | |
SymbolicExpression & | addSymbolicExpression (uint64_t Off, Args... A) |
Adds a new SymbolicExpression to this interval. More... | |
SymbolicExpression & | addSymbolicExpression (uint64_t Off, const SymbolicExpression &SymExpr) |
Adds a new SymbolicExpression to this interval. More... | |
block_range | blocks () |
Return a range of the Block objects in this interval. More... | |
const_block_range | blocks () const |
Return a const range of the Block objects in this interval. More... | |
block_iterator | blocks_begin () |
Return an iterator to the first Block. More... | |
const_block_iterator | blocks_begin () const |
Return a const iterator to the first Block. More... | |
block_iterator | blocks_end () |
Return an iterator to the element following the last Block. More... | |
const_block_iterator | blocks_end () const |
Return a const iterator to the element following the last Block. More... | |
template<typename T > | |
bytes_range< T > | bytes () |
Get a range of data in this byte vector. More... | |
template<typename T > | |
const_bytes_range< T > | bytes () const |
Get a range of data in this byte vector. More... | |
template<typename T > | |
bytes_range< T > | bytes (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) |
Get a range of data in this byte vector. More... | |
template<typename T > | |
const_bytes_range< T > | bytes (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) const |
Get a range of data in this byte vector. More... | |
template<typename T > | |
bytes_iterator< T > | bytes_begin () |
Get an iterator to the beginning of this byte vector. More... | |
template<typename T > | |
const_bytes_iterator< T > | bytes_begin () const |
Get an iterator to the beginning of this byte vector. More... | |
template<typename T > | |
bytes_iterator< T > | bytes_begin (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) |
Get an iterator to the beginning of this byte vector. More... | |
template<typename T > | |
const_bytes_iterator< T > | bytes_begin (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) const |
Get an iterator to the beginning of this byte vector. More... | |
template<typename T > | |
bytes_iterator< T > | bytes_end () |
Get an iterator past the end of this byte vector. More... | |
template<typename T > | |
const_bytes_iterator< T > | bytes_end () const |
Get an iterator past the end of this byte vector. More... | |
template<typename T > | |
bytes_iterator< T > | bytes_end (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) |
Get an iterator past the end of this byte vector. More... | |
template<typename T > | |
const_bytes_iterator< T > | bytes_end (boost::endian::order InputOrder, boost::endian::order OutputOrder=boost::endian::order::native) const |
Get an iterator past the end of this byte vector. More... | |
code_block_range | code_blocks () |
Return a range of the CodeBlock objects in this interval. More... | |
const_code_block_range | code_blocks () const |
Return a const range of the CodeBlock objects in this interval. More... | |
code_block_iterator | code_blocks_begin () |
Return an iterator to the first CodeBlock. More... | |
const_code_block_iterator | code_blocks_begin () const |
Return a const iterator to the first CodeBlock. More... | |
code_block_iterator | code_blocks_end () |
Return an iterator to the element following the last CodeBlock. More... | |
const_code_block_iterator | code_blocks_end () const |
Return a const iterator to the element following the last CodeBlock. More... | |
data_block_range | data_blocks () |
Return a range of the DataBlock objects in this interval. More... | |
const_data_block_range | data_blocks () const |
Return a const range of the DataBlock objects in this interval. More... | |
data_block_iterator | data_blocks_begin () |
Return an iterator to the first DataBlock. More... | |
const_data_block_iterator | data_blocks_begin () const |
Return a const iterator to the first DataBlock. More... | |
data_block_iterator | data_blocks_end () |
Return an iterator to the element following the last DataBlock. More... | |
const_data_block_iterator | data_blocks_end () const |
Return a const iterator to the element following the last DataBlock. More... | |
template<typename T > | |
const_bytes_iterator< T > | eraseBytes (const const_bytes_iterator< T > Begin, const const_bytes_iterator< T > End) |
Erase data from this byte vector. More... | |
block_range | findBlocksAt (Addr A) |
Find all the blocks that start at an address. More... | |
const_block_range | findBlocksAt (Addr A) const |
Find all the blocks that start at an address. More... | |
block_range | findBlocksAt (Addr Low, Addr High) |
Find all the blocks that start between a range of addresses. More... | |
const_block_range | findBlocksAt (Addr Low, Addr High) const |
Find all the blocks that start between a range of addresses. More... | |
block_range | findBlocksAtOffset (uint64_t Low, uint64_t High) |
Find all the blocks that start between a range of offsets. More... | |
const_block_range | findBlocksAtOffset (uint64_t Low, uint64_t High) const |
Find all the blocks that start between a range of offsets. More... | |
block_range | findBlocksAtOffset (uint64_t Off) |
Find all the blocks that start at an offset. More... | |
const_block_range | findBlocksAtOffset (uint64_t Off) const |
Find all the blocks that start at an offset. More... | |
block_subrange | findBlocksOn (Addr A) |
Find all the blocks that have bytes that lie within the address specified. More... | |
const_block_subrange | findBlocksOn (Addr A) const |
Find all the blocks that have bytes that lie within the address specified. More... | |
block_subrange | findBlocksOnOffset (uint64_t Off) |
Find all the blocks that have a byte at the specified offset. More... | |
const_block_subrange | findBlocksOnOffset (uint64_t Off) const |
Find all the blocks that have a byte at the specified offset. More... | |
code_block_range | findCodeBlocksAt (Addr A) |
Find all the code blocks that start at an address. More... | |
const_code_block_range | findCodeBlocksAt (Addr A) const |
Find all the code blocks that start at an address. More... | |
code_block_range | findCodeBlocksAt (Addr Low, Addr High) |
Find all the code blocks that start between a range of addresses. More... | |
const_code_block_range | findCodeBlocksAt (Addr Low, Addr High) const |
Find all the code blocks that start between a range of addresses. More... | |
code_block_range | findCodeBlocksAtOffset (uint64_t Low, uint64_t High) |
Find all the code blocks that start between a range of offsets. More... | |
const_code_block_range | findCodeBlocksAtOffset (uint64_t Low, uint64_t High) const |
Find all the code blocks that start between a range of offsets. More... | |
code_block_range | findCodeBlocksAtOffset (uint64_t Off) |
Find all the code blocks that start at an offset. More... | |
const_code_block_range | findCodeBlocksAtOffset (uint64_t Off) const |
Find all the code blocks that start at an offset. More... | |
code_block_subrange | findCodeBlocksOn (Addr A) |
Find all the code blocks that have bytes that lie within the address specified. More... | |
const_code_block_subrange | findCodeBlocksOn (Addr A) const |
Find all the code blocks that have bytes that lie within the address specified. More... | |
code_block_subrange | findCodeBlocksOnOffset (uint64_t Off) |
Find all the code blocks that have a byte at the specified offset. More... | |
const_code_block_subrange | findCodeBlocksOnOffset (uint64_t Off) const |
Find all the code blocks that have a byte at the specified offset. More... | |
data_block_range | findDataBlocksAt (Addr A) |
Find all the data blocks that start at an address. More... | |
const_data_block_range | findDataBlocksAt (Addr A) const |
Find all the data blocks that start at an address. More... | |
data_block_range | findDataBlocksAt (Addr Low, Addr High) |
Find all the data blocks that start between a range of addresses. More... | |
const_data_block_range | findDataBlocksAt (Addr Low, Addr High) const |
Find all the data blocks that start between a range of addresses. More... | |
data_block_range | findDataBlocksAtOffset (uint64_t Low, uint64_t High) |
Find all the data blocks that start between a range of offsets. More... | |
const_data_block_range | findDataBlocksAtOffset (uint64_t Low, uint64_t High) const |
Find all the data blocks that start between a range of offsets. More... | |
data_block_range | findDataBlocksAtOffset (uint64_t Off) |
Find all the data blocks that start at an offset. More... | |
const_data_block_range | findDataBlocksAtOffset (uint64_t Off) const |
Find all the data blocks that start at an offset. More... | |
data_block_subrange | findDataBlocksOn (Addr A) |
Find all the data blocks that have bytes that lie within the address specified. More... | |
const_data_block_subrange | findDataBlocksOn (Addr A) const |
Find all the data blocks that have bytes that lie within the address specified. More... | |
data_block_subrange | findDataBlocksOnOffset (uint64_t Off) |
Find all the data blocks that have a byte at the specified offset. More... | |
const_data_block_subrange | findDataBlocksOnOffset (uint64_t Off) const |
Find all the data blocks that have a byte at the specified offset. More... | |
symbolic_expression_range | findSymbolicExpressionsAt (Addr A) |
Find all the symbolic expressions that start at an address. More... | |
const_symbolic_expression_range | findSymbolicExpressionsAt (Addr A) const |
Find all the symbolic expressions that start at an address. More... | |
symbolic_expression_range | findSymbolicExpressionsAt (Addr Low, Addr High) |
Find all the symbolic expressions that start between a range of addresses. More... | |
const_symbolic_expression_range | findSymbolicExpressionsAt (Addr Low, Addr High) const |
Find all the symbolic expressions that start between a range of addresses. More... | |
symbolic_expression_range | findSymbolicExpressionsAtOffset (uint64_t Low, uint64_t High) |
Find all the symbolic expressions that start between a range of offsets. More... | |
const_symbolic_expression_range | findSymbolicExpressionsAtOffset (uint64_t Low, uint64_t High) const |
Find all the symbolic expressions that start between a range of offsets. More... | |
symbolic_expression_range | findSymbolicExpressionsAtOffset (uint64_t Off) |
Find all the symbolic expressions that start at an offset. More... | |
const_symbolic_expression_range | findSymbolicExpressionsAtOffset (uint64_t Off) const |
Find all the symbolic expressions that start at an offset. More... | |
std::optional< Addr > | getAddress () const |
Get the fixed address of this interval, if present. More... | |
boost::endian::order | getBoostEndianOrder () const |
Get the boost::endian::order of this module, suitable for passing to the bytes iterator. More... | |
uint64_t | getInitializedSize () const |
Get the number of initialized bytes in this interval. More... | |
Section * | getSection () |
Get the Section this byte interval belongs to. More... | |
const Section * | getSection () const |
Get the Section this byte interval belongs to. More... | |
uint64_t | getSize () const |
Get the size of this interval in bytes. More... | |
SymbolicExpression * | getSymbolicExpression (uint64_t Off) |
Get the symbolic expression at the given offset, if present. More... | |
const SymbolicExpression * | getSymbolicExpression (uint64_t Off) const |
Get the symbolic expression at the given offset, if present. More... | |
template<typename T > | |
bytes_iterator< T > | insertBytes (bytes_iterator< T > Pos, const T &X) |
Insert a single datum into this byte vector. More... | |
template<typename T > | |
bytes_iterator< T > | insertBytes (bytes_iterator< T > Pos, const T &X, boost::endian::order VectorOrder, boost::endian::order ElementOrder=boost::endian::order::native) |
Insert a single datum into this byte vector. More... | |
template<typename T , typename InputIterator > | |
bytes_iterator< T > | insertBytes (bytes_iterator< T > Pos, InputIterator Begin, InputIterator End) |
Insert data into this byte vector. More... | |
template<typename T , typename InputIterator > | |
bytes_iterator< T > | insertBytes (bytes_iterator< T > Pos, InputIterator Begin, InputIterator End, boost::endian::order VectorOrder, boost::endian::order ElementsOrder=boost::endian::order::native) |
Insert data into this byte vector. More... | |
template<typename T > | |
const_bytes_iterator< T > | insertBytes (const const_bytes_iterator< T > Pos, const T &X) |
Insert a single datum into this byte vector. More... | |
template<typename T > | |
const_bytes_iterator< T > | insertBytes (const const_bytes_iterator< T > Pos, const T &X, boost::endian::order VectorOrder, boost::endian::order ElementOrder=boost::endian::order::native) |
Insert a single datum into this byte vector. More... | |
template<typename T , typename InputIterator > | |
const_bytes_iterator< T > | insertBytes (const const_bytes_iterator< T > Pos, InputIterator Begin, InputIterator End) |
Insert data into this byte vector. More... | |
template<typename T , typename InputIterator > | |
const_bytes_iterator< T > | insertBytes (const const_bytes_iterator< T > Pos, InputIterator Begin, InputIterator End, boost::endian::order VectorOrder, boost::endian::order ElementsOrder=boost::endian::order::native) |
Insert data into this byte vector. More... | |
template<typename T > | |
T * | rawBytes () |
Return the raw data underlying this byte vector. More... | |
template<typename T > | |
const T * | rawBytes () const |
Return the raw data underlying this byte vector. More... | |
ChangeStatus | removeBlock (CodeBlock *B) |
Remove a block from this interval. More... | |
ChangeStatus | removeBlock (DataBlock *B) |
Remove a block from this interval. More... | |
bool | removeSymbolicExpression (uint64_t Off) |
Removes a SymbolicExpression at the given offset, if present. More... | |
void | setAddress (std::optional< Addr > A) |
Set or clear the address of this interval. More... | |
void | setInitializedSize (uint64_t S) |
Set the number of initialized bytes in this interval. More... | |
void | setSize (uint64_t S) |
Set the size of this interval. More... | |
symbolic_expression_range | symbolic_expressions () |
Return a range of the SymbolicExpression objects in this interval. More... | |
const_symbolic_expression_range | symbolic_expressions () const |
Return a const range of the SymbolicExpression objects in this interval. More... | |
symbolic_expression_iterator | symbolic_expressions_begin () |
Return an iterator to the first SymbolicExpression. More... | |
const_symbolic_expression_iterator | symbolic_expressions_begin () const |
Return a const iterator to the first SymbolicExpression. More... | |
symbolic_expression_iterator | symbolic_expressions_end () |
Return an iterator to the element following the last SymbolicExpression. More... | |
const_symbolic_expression_iterator | symbolic_expressions_end () const |
Return a const iterator to the element following the last SymbolicExpression. More... | |
Public Member Functions inherited from gtirb::Node | |
Node (const Node &)=delete | |
Copying Nodes is explicitly disabled. More... | |
Node (Node &&)=delete | |
Move-constructing Nodes is explicitly disabled. More... | |
~Node () noexcept | |
Cleans up resources no longer needed by the Node object. More... | |
const UUID & | getUUID () const |
Get the Universally Unique ID (UUID) for this . More... | |
Node & | operator= (const Node &)=delete |
Copying Nodes is explicilty disabled. More... | |
Node & | operator= (Node &&)=delete |
Move-assigning Nodes is explicilty disabled. More... | |
Static Public Member Functions | |
static ByteInterval * | Create (Context &C) |
Create an unitialized ByteInterval object. More... | |
template<typename InputIterator > | |
static ByteInterval * | Create (Context &C, InputIterator Begin, InputIterator End, std::optional< uint64_t > Size=std::nullopt, std::optional< uint64_t > InitSize=std::nullopt) |
Create a ByteInterval object. More... | |
template<typename InputIterator > | |
static ByteInterval * | Create (Context &C, std::optional< Addr > Address, InputIterator Begin, InputIterator End, std::optional< uint64_t > Size=std::nullopt, std::optional< uint64_t > InitSize=std::nullopt) |
Create a ByteInterval object. More... | |
static ByteInterval * | Create (Context &C, std::optional< Addr > Address, uint64_t Size=0, std::optional< uint64_t > InitSize=std::nullopt) |
Create a ByteInterval object. More... | |
static ByteInterval * | Create (Context &C, uint64_t Size, std::optional< uint64_t > InitSize=std::nullopt) |
Create a ByteInterval object. More... | |
Static Public Member Functions inherited from gtirb::Node | |
static Node * | Create (Context &C) |
Create a Node object in its default state. More... | |
static const Node * | getByUUID (const Context &C, const UUID &Uuid) |
Retrieve a node by its UUID. More... | |
static Node * | getByUUID (Context &C, const UUID &Uuid) |
Retrieve a node by its UUID. More... | |
Friends | |
struct | BlockOffsetLess |
class | CodeBlock |
class | Context |
class | DataBlock |
class | Module |
class | Section |
class | SerializationTestHarness |
A contiguous region of bytes in a binary.
A ByteInterval defines a relative ordering for a group of Block objects, optionally at a fixed address in memory. It also stores the bytes associated with these blocks.
If two blocks are in two different ByteIntervals, then it should be considered safe (that is, preserving of program semantics) to move one block relative to the other in memory. If two blocks are in the same ByteInterval, then it should be considered unknown if moving the two blocks relative to one another in memory is a safe operation.
using gtirb::ByteInterval::block_iterator = boost::transform_iterator<BlockToNode<Node>, BlockSet::index<by_offset>::type::iterator> |
Iterator over Block objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::block_range = boost::iterator_range<block_iterator> |
Range of Block objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::block_subrange = boost::iterator_range<boost::transform_iterator< BlockToNode<Node>, BlockIntMap::codomain_type::iterator> > |
Sub-range of blocks overlapping an address or range of addreses.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::bytes_iterator = BytesBaseIterator<ByteInterval, T> |
Iterator over bytes.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
using gtirb::ByteInterval::bytes_range = boost::iterator_range<bytes_iterator<T> > |
Range over bytes.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
using gtirb::ByteInterval::code_block_iterator = boost::transform_iterator< BlockToNode<CodeBlock>, boost::filter_iterator<BlockKindEquals<Node::Kind::CodeBlock>, BlockSet::index<by_offset>::type::iterator> > |
Iterator over CodeBlock objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::code_block_range = boost::iterator_range<code_block_iterator> |
Range of CodeBlock objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::code_block_subrange = boost::iterator_range<boost::transform_iterator< BlockToNode<CodeBlock>, boost::filter_iterator< BlockKindEquals<Node::Kind::CodeBlock>, boost::indirect_iterator<BlockIntMap::codomain_type::iterator> >> > |
Sub-range of code blocks overlapping an address or range of addreses.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::const_block_iterator = boost::transform_iterator< BlockToNode<const Node>, BlockSet::index<by_offset>::type::const_iterator> |
Const iterator over Block objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::const_block_range = boost::iterator_range<const_block_iterator> |
Const range of Block objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::const_block_subrange = boost::iterator_range<boost::transform_iterator< BlockToNode<const Node>, BlockIntMap::codomain_type::const_iterator> > |
Const sub-range of blocks overlapping an address or range of addreses.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::const_bytes_iterator = BytesBaseIterator<const ByteInterval, T> |
Const iterator over bytes.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
using gtirb::ByteInterval::const_bytes_range = boost::iterator_range<const_bytes_iterator<T> > |
Const range over bytes.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
using gtirb::ByteInterval::const_code_block_iterator = boost::transform_iterator< BlockToNode<const CodeBlock>, boost::filter_iterator<BlockKindEquals<Node::Kind::CodeBlock>, BlockSet::index<by_offset>::type::const_iterator> > |
Const iterator over CodeBlock objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::const_code_block_range = boost::iterator_range<const_code_block_iterator> |
Const range of CodeBlock objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::const_code_block_subrange = boost::iterator_range<boost::transform_iterator< BlockToNode<const CodeBlock>, boost::filter_iterator< BlockKindEquals<Node::Kind::CodeBlock>, boost::indirect_iterator< BlockIntMap::codomain_type::const_iterator> >> > |
Const sub-range of code blocks overlapping an address or range of addreses.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::const_data_block_iterator = boost::transform_iterator< BlockToNode<const DataBlock>, boost::filter_iterator<BlockKindEquals<Node::Kind::DataBlock>, BlockSet::index<by_offset>::type::const_iterator> > |
Const iterator over DataBlock objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::const_data_block_range = boost::iterator_range<const_data_block_iterator> |
Const range of DataBlock objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::const_data_block_subrange = boost::iterator_range<boost::transform_iterator< BlockToNode<const DataBlock>, boost::filter_iterator< BlockKindEquals<Node::Kind::DataBlock>, boost::indirect_iterator< BlockIntMap::codomain_type::const_iterator> >> > |
Const sub-range of data blocks overlapping an address or range of addreses.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::const_symbolic_expression_iterator = boost::transform_iterator< SymExprPairToElement<ConstSymbolicExpressionElement>, SymbolicExpressionMap::const_iterator> |
Const iterator over SymbolicExpressionElement objects.
Results are yielded in offset order, ascending.
using gtirb::ByteInterval::const_symbolic_expression_range = boost::iterator_range<const_symbolic_expression_iterator> |
Const range of SymbolicExpressionElement objects.
Results are yielded in offset order, ascending.
using gtirb::ByteInterval::ConstSymbolicExpressionElement = SymbolicExpressionElementBase<const ByteInterval> |
A symbolic expression paired with the information needed to look up or alter the symbolic expression after the fact.
using gtirb::ByteInterval::data_block_iterator = boost::transform_iterator< BlockToNode<DataBlock>, boost::filter_iterator<BlockKindEquals<Node::Kind::DataBlock>, BlockSet::index<by_offset>::type::iterator> > |
Iterator over DataBlock objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::data_block_range = boost::iterator_range<data_block_iterator> |
Range of DataBlock objects.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::data_block_subrange = boost::iterator_range<boost::transform_iterator< BlockToNode<DataBlock>, boost::filter_iterator< BlockKindEquals<Node::Kind::DataBlock>, boost::indirect_iterator<BlockIntMap::codomain_type::iterator> >> > |
Sub-range of data blocks overlapping an address or range of addreses.
Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.
using gtirb::ByteInterval::symbolic_expression_iterator = boost::transform_iterator<SymExprPairToElement<SymbolicExpressionElement>, SymbolicExpressionMap::iterator> |
Iterator over SymbolicExpressionElement objects.
Results are yielded in offset order, ascending.
using gtirb::ByteInterval::symbolic_expression_range = boost::iterator_range<symbolic_expression_iterator> |
Range of SymbolicExpressionElement objects.
Results are yielded in offset order, ascending.
using gtirb::ByteInterval::SymbolicExpressionElement = SymbolicExpressionElementBase<ByteInterval> |
A symbolic expression paired with the information needed to look up or alter the symbolic expression after the fact.
|
inline |
Creates a new Block of the given type at a given offset.
BlockType | Either CodeBlock or DataBlock. |
Args | The arguments to construct a CodeBlock. |
C | The Context to use. |
O | The offset to add the new CodeBlock at. |
A | The arguments to construct a CodeBlock. |
ChangeStatus gtirb::ByteInterval::addBlock | ( | uint64_t | Off, |
CodeBlock * | N | ||
) |
Move an existing CodeBlock to be a part of this interval.
Off | The offset to move the block to. |
N | The block to move. |
Accepted
), was unnecessary because this node already contained the CodeBlock (NoChange
), or could not be completed (Rejected
). ChangeStatus gtirb::ByteInterval::addBlock | ( | uint64_t | Off, |
DataBlock * | N | ||
) |
Move an existing DataBlock to be a part of this interval.
Off | The offset to move the block to. |
N | The block to move. |
Accepted
), was unnecessary because this node already contained the DataBlock (NoChange
), or could not be completed (Rejected
).
|
inline |
Adds a new SymbolicExpression to this interval.
ExprType | The type of symbolic expression to create (SymAddrConst, SymAddrAddr, etc). |
Args | The arguments to construct something of ExprType. |
O | The offset to add the new SymbolicExpression at. |
A | The arguments to construct something of ExprType. |
|
inline |
Adds a new SymbolicExpression to this interval.
Off | The offset to add the new SymbolicExpression at. |
SymExpr | An existing SymbolicExpression to copy into this interval. |
|
inline |
Return a range of the Block objects in this interval.
|
inline |
Return a const range of the Block objects in this interval.
|
inline |
Return an iterator to the first Block.
|
inline |
Return a const iterator to the first Block.
|
inline |
Return an iterator to the element following the last Block.
|
inline |
Return a const iterator to the element following the last Block.
|
inline |
Get a range of data in this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get a range of data in this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get a range of data in this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the vector. |
OutputOrder | The endianness you wish to read out from the vector. |
|
inline |
Get a range of data in this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the vector. |
OutputOrder | The endianness you wish to read out from the vector. |
|
inline |
Get an iterator to the beginning of this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get an iterator to the beginning of this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get an iterator to the beginning of this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the vector. |
OutputOrder | The endianness you wish to read out from the vector. |
|
inline |
Get an iterator to the beginning of this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the vector. |
OutputOrder | The endianness you wish to read out from the vector. |
|
inline |
Get an iterator past the end of this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get an iterator past the end of this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
|
inline |
Get an iterator past the end of this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the vector. |
OutputOrder | The endianness you wish to read out from the vector. |
|
inline |
Get an iterator past the end of this byte vector.
T | The type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputOrder | The endianness of the data in the vector. |
OutputOrder | The endianness you wish to read out from the vector. |
|
inline |
Return a range of the CodeBlock objects in this interval.
|
inline |
Return a const range of the CodeBlock objects in this interval.
|
inline |
Return an iterator to the first CodeBlock.
|
inline |
Return a const iterator to the first CodeBlock.
|
inline |
Return an iterator to the element following the last CodeBlock.
|
inline |
Return a const iterator to the element following the last CodeBlock.
|
inlinestatic |
Create an unitialized ByteInterval object.
C | The Context in which this ByteInterval will be held. |
|
inlinestatic |
Create a ByteInterval object.
InputIterator | An input iterator yielding bytes. |
C | The Context in which this interval will be held. |
BytesBegin | The start of the range to copy to the byte vector. |
BytesEnd | The end of the range to copy to the byte vector. |
Size | The size of this interval in bytes. Defaults to the size of the range of bytes. If specified, either trucates the range of bytes given or pads it at the end with zeroes. |
InitSize | The number of bytes with initialized values. Defaults to the size of the range of bytes. If specified, does NOT zero out values from the range past this number. |
|
inlinestatic |
Create a ByteInterval object.
InputIterator | An input iterator yielding bytes. |
C | The Context in which this interval will be held. |
Address | An (optional) fixed address for this interval. |
BytesBegin | The start of the range to copy to the byte vector. |
BytesEnd | The end of the range to copy to the byte vector. |
Size | The size of this interval in bytes. Defaults to the size of the range of bytes. If specified, either trucates the range of bytes given or pads it at the end with zeroes. |
InitSize | The number of bytes with initialized values. Defaults to the size of the range of bytes. If specified, does NOT zero out values from the range past this number. |
|
inlinestatic |
Create a ByteInterval object.
C | The Context in which this interval will be held. |
Address | An (optional) fixed address for this interval. |
Size | The size of this interval in bytes. |
InitSize | The number of bytes with initialized values. Defaults to the value of Size. |
|
inlinestatic |
Create a ByteInterval object.
C | The Context in which this interval will be held. |
Size | The size of this interval in bytes. |
InitSize | The number of bytes with initialized values. Defaults to the value of Size. |
|
inline |
Return a range of the DataBlock objects in this interval.
|
inline |
Return a const range of the DataBlock objects in this interval.
|
inline |
Return an iterator to the first DataBlock.
|
inline |
Return a const iterator to the first DataBlock.
|
inline |
Return an iterator to the element following the last DataBlock.
|
inline |
Return a const iterator to the element following the last DataBlock.
|
inline |
Erase data from this byte vector.
T | The type of data you wish to erase. |
Begin | The start of the data to erase. |
End | The end of the data to erase. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Find all the code blocks that start at an address.
A | The address to look up. |
A
.
|
inline |
Find all the code blocks that start at an address.
A | The address to look up. |
A
.
|
inline |
Find all the code blocks that start between a range of addresses.
Low | The low address, inclusive. |
High | The high address, exclusive. |
|
inline |
Find all the code blocks that start between a range of addresses.
Low | The low address, inclusive. |
High | The high address, exclusive. |
|
inline |
Find all the code blocks that start between a range of offsets.
Low | The low offset, inclusive. |
High | The high offset, exclusive. |
|
inline |
Find all the code blocks that start between a range of offsets.
Low | The low offset, inclusive. |
High | The high offset, exclusive. |
|
inline |
Find all the code blocks that start at an offset.
Off | The offset to look up. |
Off
.
|
inline |
Find all the code blocks that start at an offset.
Off | The offset to look up. |
Off
.
|
inline |
Find all the code blocks that have bytes that lie within the address specified.
A | The address to look up. |
A
.
|
inline |
Find all the code blocks that have bytes that lie within the address specified.
A | The address to look up. |
A
.
|
inline |
Find all the code blocks that have a byte at the specified offset.
Off | The offset to look up. |
Off
.
|
inline |
Find all the code blocks that have a byte at the specified offset.
Off | The offset to look up. |
Off
.
|
inline |
Find all the data blocks that start at an address.
A | The address to look up. |
A
.
|
inline |
Find all the data blocks that start at an address.
A | The address to look up. |
A
.
|
inline |
Find all the data blocks that start between a range of addresses.
Low | The low address, inclusive. |
High | The high address, exclusive. |
|
inline |
Find all the data blocks that start between a range of addresses.
Low | The low address, inclusive. |
High | The high address, exclusive. |
|
inline |
Find all the data blocks that start between a range of offsets.
Low | The low offset, inclusive. |
High | The high offset, exclusive. |
|
inline |
Find all the data blocks that start between a range of offsets.
Low | The low offset, inclusive. |
High | The high offset, exclusive. |
|
inline |
Find all the data blocks that start at an offset.
Off | The offset to look up. |
Off
.
|
inline |
Find all the data blocks that start at an offset.
Off | The offset to look up. |
Off
.
|
inline |
Find all the data blocks that have bytes that lie within the address specified.
A | The address to look up. |
A
.
|
inline |
Find all the data blocks that have bytes that lie within the address specified.
A | The address to look up. |
A
.
|
inline |
Find all the data blocks that have a byte at the specified offset.
Off | The offset to look up. |
Off
.
|
inline |
Find all the data blocks that have a byte at the specified offset.
Off | The offset to look up. |
Off
.
|
inline |
Find all the symbolic expressions that start at an address.
Note that only one symbolic expression can be at any given offset, so this iterator will only ever return 0 or 1 elements. This function is provided for consistency with other Node objects; prefer getSymbolicExpression instead.
A | The address to look up. |
A
.
|
inline |
Find all the symbolic expressions that start at an address.
Note that only one symbolic expression can be at any given offset, so this iterator will only ever return 0 or 1 elements. This function is provided for consistency with other Node objects; prefer getSymbolicExpression instead.
A | The address to look up. |
A
.
|
inline |
Find all the symbolic expressions that start between a range of addresses.
Low | The low address, inclusive. |
High | The high address, exclusive. |
|
inline |
Find all the symbolic expressions that start between a range of addresses.
Low | The low address, inclusive. |
High | The high address, exclusive. |
|
inline |
Find all the symbolic expressions that start between a range of offsets.
Low | The low offset, inclusive. |
High | The high offset, exclusive. |
|
inline |
Find all the symbolic expressions that start between a range of offsets.
Low | The low offset, inclusive. |
High | The high offset, exclusive. |
|
inline |
Find all the symbolic expressions that start at an offset.
Note that only one symbolic expression can be at any given offset, so this iterator will only ever return 0 or 1 elements. This function is provided for consistency with other Node objects; prefer getSymbolicExpression instead.
Off | The offset to look up. |
Off
.
|
inline |
Find all the symbolic expressions that start at an offset.
Note that only one symbolic expression can be at any given offset, so this iterator will only ever return 0 or 1 elements. This function is provided for consistency with other Node objects; prefer getSymbolicExpression instead.
Off | The offset to look up. |
Off
.
|
inline |
Get the fixed address of this interval, if present.
If this field is present, it may indicate the original address at which this interval was located at in memory, or it may indicate that this block's address is fixed and must not be changed. If this field is not present, it indicates that the interval is free to be moved around in memory while preserving program semantics.
boost::endian::order gtirb::ByteInterval::getBoostEndianOrder | ( | ) | const |
Get the boost::endian::order
of this module, suitable for passing to the bytes
iterator.
|
inline |
Get the number of initialized bytes in this interval.
Not all bytes in this interval may correspond to bytes physically stored in the underlying file format. This can occur, for example, in BSS sections, which are zero-initialized at loadtime, but these zeroes are not stored in the file itself. If this number is smaller than the value returned by getSize, this indicates that any bytes past this number are unitialized bytes with values determined at loadtime. As such, all bytes past this number in this interval's byte vector are truncated when saving to file.
This number will never be larger than the value returned by getSize.
|
inline |
Get the Section this byte interval belongs to.
|
inline |
Get the size of this interval in bytes.
If this number is greater than the value returned by getInitializedSize, this indicates that the high addresses taken up by this interval consist of uninitialized bytes. This often occurs in BSS sections, where data is zero-initialized rather than stored as zeroes in the binary.
|
inline |
Get the symbolic expression at the given offset, if present.
Off | The offset of the SymbolicExpression to return. |
|
inline |
Get the symbolic expression at the given offset, if present.
Off | The offset of the SymbolicExpression to return. |
|
inline |
Insert a single datum into this byte vector.
T | The type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
Pos | The position in the byte vector to insert data at. |
X | The data tprivato insert. |
|
inline |
Insert a single datum into this byte vector.
T | The type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
Pos | The position in the byte vector to insert data at. |
X | The data to insert. |
VectorOrder | The endianness of the data in the byte vector. |
ElementOrder | The endianness of the data to be inserted. |
|
inline |
Insert data into this byte vector.
T | The type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputIterator | The type of an iterator yielding T. |
Pos | The position in the byte vector to insert data at. |
Begin | The start of the data to insert. |
End | The end of the data to insert. |
|
inline |
Insert data into this byte vector.
T | The type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputIterator | The type of an iterator yielding T. |
Pos | The position in the byte vector to insert data at. |
Begin | The start of the data to insert. |
End | The end of the data to insert. |
VectorOrder | The endianness of the data in the byte vector. |
ElementsOrder | The endianness of the data to be inserted. |
|
inline |
Insert a single datum into this byte vector.
T | The type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
Pos | The position in the byte vector to insert data at. |
X | The data to insert. |
|
inline |
Insert a single datum into this byte vector.
T | The type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
Pos | The position in the byte vector to insert data at. |
X | The data to insert. |
VectorOrder | The endianness of the data in the byte vector. |
ElementOrder | The endianness of the data to be inserted. |
|
inline |
Insert data into this byte vector.
T | The type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputIterator | The type of an iterator yielding T. |
Pos | The position in the byte vector to insert data at. |
Begin | The start of the data to insert. |
End | The end of the data to insert. |
|
inline |
Insert data into this byte vector.
T | The type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept. |
InputIterator | The type of an iterator yielding T. |
Pos | The position in the byte vector to insert data at. |
Begin | The start of the data to insert. |
End | The end of the data to insert. |
VectorOrder | The endianness of the data in the byte vector. |
ElementsOrder | The endianness of the data to be inserted. |
|
inline |
Return the raw data underlying this byte vector.
Much like std::vector::data, this function is low-level and potentially unsafe. This pointer refers to valid memory only where an iterator would be valid to point to. Modifying the size of the byte vector may invalidate this pointer. Any endian conversions will not be performed.
T | The type of data stored in this byte vector. Must be a POD type. |
|
inline |
Return the raw data underlying this byte vector.
Much like std::vector::data, this function is low-level and potentially unsafe. This pointer refers to valid memory only where an iterator would be valid to point to. Modifying the size of the byte vector may invalidate this pointer. Any endian conversions will not be performed.
T | The type of data stored in this byte vector. Must be a POD type. |
ChangeStatus gtirb::ByteInterval::removeBlock | ( | CodeBlock * | B | ) |
Remove a block from this interval.
B | The block to remove. |
ChangeStatus gtirb::ByteInterval::removeBlock | ( | DataBlock * | B | ) |
Remove a block from this interval.
B | The block to remove. |
|
inline |
Removes a SymbolicExpression at the given offset, if present.
Off | The offset of the SymbolicExpression to remove. |
void gtirb::ByteInterval::setAddress | ( | std::optional< Addr > | A | ) |
Set or clear the address of this interval.
A | Either the new address, or an empty std::optional if you wish to remove the address. |
|
inline |
Set the number of initialized bytes in this interval.
Not all bytes in this interval may correspond to bytes physically stored in the underlying file format. This can occur, for example, in BSS sections, which are zero-initialized at loadtime, but these zeroes are not stored in the file itself. If this number is smaller than the value returned by getSize, this indicates that any bytes past this number are unitialized bytes with values determined at loadtime. As such, all bytes past this number in this interval's byte vector are truncated when saving to file.
If the number specified is larger than getSize, then the byte vector is expanded with zeroes to be equal to the new allocated size.
void gtirb::ByteInterval::setSize | ( | uint64_t | S | ) |
Set the size of this interval.
This will also adjust getInitializedSize if the size given is less than the initialized size.
S | The new size. |
|
inline |
Return a range of the SymbolicExpression objects in this interval.
|
inline |
Return a const range of the SymbolicExpression objects in this interval.
|
inline |
Return an iterator to the first SymbolicExpression.
|
inline |
Return a const iterator to the first SymbolicExpression.
|
inline |
Return an iterator to the element following the last SymbolicExpression.
|
inline |
Return a const iterator to the element following the last SymbolicExpression.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |