GTIRB  v2.2.0
GrammaTech Intermediate Representation for Binaries: C++ API
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
gtirb::ByteInterval Class Reference

A contiguous region of bytes in a binary. More...

#include <ByteInterval.hpp>

Inheritance diagram for gtirb::ByteInterval:
Inheritance graph
[legend]
Collaboration diagram for gtirb::ByteInterval:
Collaboration graph
[legend]

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>
SymbolicExpressionaddSymbolicExpression (uint64_t Off, Args... A)
 Adds a new SymbolicExpression to this interval. More...
 
SymbolicExpressionaddSymbolicExpression (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< AddrgetAddress () 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...
 
SectiongetSection ()
 Get the Section this byte interval belongs to. More...
 
const SectiongetSection () const
 Get the Section this byte interval belongs to. More...
 
uint64_t getSize () const
 Get the size of this interval in bytes. More...
 
SymbolicExpressiongetSymbolicExpression (uint64_t Off)
 Get the symbolic expression at the given offset, if present. More...
 
const SymbolicExpressiongetSymbolicExpression (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 UUIDgetUUID () const
 Get the Universally Unique ID (UUID) for this. More...
 
Nodeoperator= (const Node &)=delete
 Copying Nodes is explicilty disabled. More...
 
Nodeoperator= (Node &&)=delete
 Move-assigning Nodes is explicilty disabled. More...
 

Static Public Member Functions

static ByteIntervalCreate (Context &C)
 Create an unitialized ByteInterval object. More...
 
template<typename InputIterator >
static ByteIntervalCreate (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 ByteIntervalCreate (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 ByteIntervalCreate (Context &C, std::optional< Addr > Address, uint64_t Size=0, std::optional< uint64_t > InitSize=std::nullopt)
 Create a ByteInterval object. More...
 
static ByteIntervalCreate (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 NodeCreate (Context &C)
 Create a Node object in its default state. More...
 
static const NodegetByUUID (const Context &C, const UUID &Uuid)
 Retrieve a node by its UUID. More...
 
static NodegetByUUID (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
 

Detailed Description

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.

Member Typedef Documentation

◆ block_iterator

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.

◆ block_range

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.

◆ block_subrange

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.

◆ bytes_iterator

template<typename T >
using gtirb::ByteInterval::bytes_iterator = BytesBaseIterator<ByteInterval, T>

Iterator over bytes.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.

◆ bytes_range

template<typename T >
using gtirb::ByteInterval::bytes_range = boost::iterator_range<bytes_iterator<T> >

Range over bytes.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.

◆ code_block_iterator

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.

◆ code_block_range

Range of CodeBlock objects.

Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.

◆ code_block_subrange

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.

◆ const_block_iterator

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.

◆ const_block_range

Const range of Block objects.

Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.

◆ const_block_subrange

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.

◆ const_bytes_iterator

template<typename T >
using gtirb::ByteInterval::const_bytes_iterator = BytesBaseIterator<const ByteInterval, T>

Const iterator over bytes.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.

◆ const_bytes_range

template<typename T >
using gtirb::ByteInterval::const_bytes_range = boost::iterator_range<const_bytes_iterator<T> >

Const range over bytes.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.

◆ const_code_block_iterator

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.

◆ const_code_block_range

Const range of CodeBlock objects.

Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.

◆ const_code_block_subrange

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.

◆ const_data_block_iterator

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.

◆ const_data_block_range

Const range of DataBlock objects.

Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.

◆ const_data_block_subrange

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.

◆ const_symbolic_expression_iterator

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.

◆ const_symbolic_expression_range

Const range of SymbolicExpressionElement objects.

Results are yielded in offset order, ascending.

◆ ConstSymbolicExpressionElement

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.

◆ data_block_iterator

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.

◆ data_block_range

Range of DataBlock objects.

Blocks are yielded in offset order, ascending. For more details, see the documentation on iteration order.

◆ data_block_subrange

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.

◆ symbolic_expression_iterator

using gtirb::ByteInterval::symbolic_expression_iterator = boost::transform_iterator<SymExprPairToElement<SymbolicExpressionElement>, SymbolicExpressionMap::iterator>

Iterator over SymbolicExpressionElement objects.

Results are yielded in offset order, ascending.

◆ symbolic_expression_range

Range of SymbolicExpressionElement objects.

Results are yielded in offset order, ascending.

◆ SymbolicExpressionElement

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.

Member Function Documentation

◆ addBlock() [1/3]

template<typename BlockType , typename... Args>
BlockType* gtirb::ByteInterval::addBlock ( Context C,
uint64_t  O,
Args &&...  A 
)
inline

Creates a new Block of the given type at a given offset.

Template Parameters
BlockTypeEither CodeBlock or DataBlock.
ArgsThe arguments to construct a CodeBlock.
Parameters
CThe Context to use.
OThe offset to add the new CodeBlock at.
AThe arguments to construct a CodeBlock.
Returns
The newly created CodeBlock.

◆ addBlock() [2/3]

ChangeStatus gtirb::ByteInterval::addBlock ( uint64_t  Off,
CodeBlock N 
)

Move an existing CodeBlock to be a part of this interval.

Parameters
OffThe offset to move the block to.
NThe block to move.
Returns
a ChangeStatus indicating whether the insertion took place (Accepted), was unnecessary because this node already contained the CodeBlock (NoChange), or could not be completed (Rejected).

◆ addBlock() [3/3]

ChangeStatus gtirb::ByteInterval::addBlock ( uint64_t  Off,
DataBlock N 
)

Move an existing DataBlock to be a part of this interval.

Parameters
OffThe offset to move the block to.
NThe block to move.
Returns
a ChangeStatus indicating whether the insertion took place (Accepted), was unnecessary because this node already contained the DataBlock (NoChange), or could not be completed (Rejected).

◆ addSymbolicExpression() [1/2]

template<class ExprType , class... Args>
SymbolicExpression& gtirb::ByteInterval::addSymbolicExpression ( uint64_t  Off,
Args...  A 
)
inline

Adds a new SymbolicExpression to this interval.

Template Parameters
ExprTypeThe type of symbolic expression to create (SymAddrConst, SymAddrAddr, etc).
ArgsThe arguments to construct something of ExprType.
Parameters
OThe offset to add the new SymbolicExpression at.
AThe arguments to construct something of ExprType.
Returns
The newly created SymbolicExpression.

◆ addSymbolicExpression() [2/2]

SymbolicExpression& gtirb::ByteInterval::addSymbolicExpression ( uint64_t  Off,
const SymbolicExpression SymExpr 
)
inline

Adds a new SymbolicExpression to this interval.

Parameters
OffThe offset to add the new SymbolicExpression at.
SymExprAn existing SymbolicExpression to copy into this interval.
Returns
The newly created SymbolicExpression.

◆ blocks() [1/2]

block_range gtirb::ByteInterval::blocks ( )
inline

Return a range of the Block objects in this interval.

◆ blocks() [2/2]

const_block_range gtirb::ByteInterval::blocks ( ) const
inline

Return a const range of the Block objects in this interval.

◆ blocks_begin() [1/2]

block_iterator gtirb::ByteInterval::blocks_begin ( )
inline

Return an iterator to the first Block.

◆ blocks_begin() [2/2]

const_block_iterator gtirb::ByteInterval::blocks_begin ( ) const
inline

Return a const iterator to the first Block.

◆ blocks_end() [1/2]

block_iterator gtirb::ByteInterval::blocks_end ( )
inline

Return an iterator to the element following the last Block.

◆ blocks_end() [2/2]

const_block_iterator gtirb::ByteInterval::blocks_end ( ) const
inline

Return a const iterator to the element following the last Block.

◆ bytes() [1/4]

template<typename T >
bytes_range<T> gtirb::ByteInterval::bytes ( )
inline

Get a range of data in this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.

◆ bytes() [2/4]

template<typename T >
const_bytes_range<T> gtirb::ByteInterval::bytes ( ) const
inline

Get a range of data in this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.

◆ bytes() [3/4]

template<typename T >
bytes_range<T> gtirb::ByteInterval::bytes ( boost::endian::order  InputOrder,
boost::endian::order  OutputOrder = boost::endian::order::native 
)
inline

Get a range of data in this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
Parameters
InputOrderThe endianness of the data in the vector.
OutputOrderThe endianness you wish to read out from the vector.

◆ bytes() [4/4]

template<typename T >
const_bytes_range<T> gtirb::ByteInterval::bytes ( boost::endian::order  InputOrder,
boost::endian::order  OutputOrder = boost::endian::order::native 
) const
inline

Get a range of data in this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
Parameters
InputOrderThe endianness of the data in the vector.
OutputOrderThe endianness you wish to read out from the vector.

◆ bytes_begin() [1/4]

template<typename T >
bytes_iterator<T> gtirb::ByteInterval::bytes_begin ( )
inline

Get an iterator to the beginning of this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.

◆ bytes_begin() [2/4]

template<typename T >
const_bytes_iterator<T> gtirb::ByteInterval::bytes_begin ( ) const
inline

Get an iterator to the beginning of this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.

◆ bytes_begin() [3/4]

template<typename T >
bytes_iterator<T> gtirb::ByteInterval::bytes_begin ( boost::endian::order  InputOrder,
boost::endian::order  OutputOrder = boost::endian::order::native 
)
inline

Get an iterator to the beginning of this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
Parameters
InputOrderThe endianness of the data in the vector.
OutputOrderThe endianness you wish to read out from the vector.

◆ bytes_begin() [4/4]

template<typename T >
const_bytes_iterator<T> gtirb::ByteInterval::bytes_begin ( boost::endian::order  InputOrder,
boost::endian::order  OutputOrder = boost::endian::order::native 
) const
inline

Get an iterator to the beginning of this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
Parameters
InputOrderThe endianness of the data in the vector.
OutputOrderThe endianness you wish to read out from the vector.

◆ bytes_end() [1/4]

template<typename T >
bytes_iterator<T> gtirb::ByteInterval::bytes_end ( )
inline

Get an iterator past the end of this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.

◆ bytes_end() [2/4]

template<typename T >
const_bytes_iterator<T> gtirb::ByteInterval::bytes_end ( ) const
inline

Get an iterator past the end of this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.

◆ bytes_end() [3/4]

template<typename T >
bytes_iterator<T> gtirb::ByteInterval::bytes_end ( boost::endian::order  InputOrder,
boost::endian::order  OutputOrder = boost::endian::order::native 
)
inline

Get an iterator past the end of this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
Parameters
InputOrderThe endianness of the data in the vector.
OutputOrderThe endianness you wish to read out from the vector.

◆ bytes_end() [4/4]

template<typename T >
const_bytes_iterator<T> gtirb::ByteInterval::bytes_end ( boost::endian::order  InputOrder,
boost::endian::order  OutputOrder = boost::endian::order::native 
) const
inline

Get an iterator past the end of this byte vector.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
Parameters
InputOrderThe endianness of the data in the vector.
OutputOrderThe endianness you wish to read out from the vector.

◆ code_blocks() [1/2]

code_block_range gtirb::ByteInterval::code_blocks ( )
inline

Return a range of the CodeBlock objects in this interval.

◆ code_blocks() [2/2]

const_code_block_range gtirb::ByteInterval::code_blocks ( ) const
inline

Return a const range of the CodeBlock objects in this interval.

◆ code_blocks_begin() [1/2]

code_block_iterator gtirb::ByteInterval::code_blocks_begin ( )
inline

Return an iterator to the first CodeBlock.

◆ code_blocks_begin() [2/2]

const_code_block_iterator gtirb::ByteInterval::code_blocks_begin ( ) const
inline

Return a const iterator to the first CodeBlock.

◆ code_blocks_end() [1/2]

code_block_iterator gtirb::ByteInterval::code_blocks_end ( )
inline

Return an iterator to the element following the last CodeBlock.

◆ code_blocks_end() [2/2]

const_code_block_iterator gtirb::ByteInterval::code_blocks_end ( ) const
inline

Return a const iterator to the element following the last CodeBlock.

◆ Create() [1/5]

static ByteInterval* gtirb::ByteInterval::Create ( Context C)
inlinestatic

Create an unitialized ByteInterval object.

Parameters
CThe Context in which this ByteInterval will be held.
Returns
The newly created ByteInterval.

◆ Create() [2/5]

template<typename InputIterator >
static ByteInterval* gtirb::ByteInterval::Create ( Context C,
InputIterator  Begin,
InputIterator  End,
std::optional< uint64_t >  Size = std::nullopt,
std::optional< uint64_t >  InitSize = std::nullopt 
)
inlinestatic

Create a ByteInterval object.

Template Parameters
InputIteratorAn input iterator yielding bytes.
Parameters
CThe Context in which this interval will be held.
BytesBeginThe start of the range to copy to the byte vector.
BytesEndThe end of the range to copy to the byte vector.
SizeThe 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.
InitSizeThe 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.
Returns
The newly created ByteInterval.

◆ Create() [3/5]

template<typename InputIterator >
static ByteInterval* gtirb::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 
)
inlinestatic

Create a ByteInterval object.

Template Parameters
InputIteratorAn input iterator yielding bytes.
Parameters
CThe Context in which this interval will be held.
AddressAn (optional) fixed address for this interval.
BytesBeginThe start of the range to copy to the byte vector.
BytesEndThe end of the range to copy to the byte vector.
SizeThe 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.
InitSizeThe 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.
Returns
The newly created ByteInterval.

◆ Create() [4/5]

static ByteInterval* gtirb::ByteInterval::Create ( Context C,
std::optional< Addr Address,
uint64_t  Size = 0,
std::optional< uint64_t >  InitSize = std::nullopt 
)
inlinestatic

Create a ByteInterval object.

Parameters
CThe Context in which this interval will be held.
AddressAn (optional) fixed address for this interval.
SizeThe size of this interval in bytes.
InitSizeThe number of bytes with initialized values. Defaults to the value of Size.
Returns
The newly created ByteInterval.

◆ Create() [5/5]

static ByteInterval* gtirb::ByteInterval::Create ( Context C,
uint64_t  Size,
std::optional< uint64_t >  InitSize = std::nullopt 
)
inlinestatic

Create a ByteInterval object.

Parameters
CThe Context in which this interval will be held.
SizeThe size of this interval in bytes.
InitSizeThe number of bytes with initialized values. Defaults to the value of Size.
Returns
The newly created ByteInterval.

◆ data_blocks() [1/2]

data_block_range gtirb::ByteInterval::data_blocks ( )
inline

Return a range of the DataBlock objects in this interval.

◆ data_blocks() [2/2]

const_data_block_range gtirb::ByteInterval::data_blocks ( ) const
inline

Return a const range of the DataBlock objects in this interval.

◆ data_blocks_begin() [1/2]

data_block_iterator gtirb::ByteInterval::data_blocks_begin ( )
inline

Return an iterator to the first DataBlock.

◆ data_blocks_begin() [2/2]

const_data_block_iterator gtirb::ByteInterval::data_blocks_begin ( ) const
inline

Return a const iterator to the first DataBlock.

◆ data_blocks_end() [1/2]

data_block_iterator gtirb::ByteInterval::data_blocks_end ( )
inline

Return an iterator to the element following the last DataBlock.

◆ data_blocks_end() [2/2]

const_data_block_iterator gtirb::ByteInterval::data_blocks_end ( ) const
inline

Return a const iterator to the element following the last DataBlock.

◆ eraseBytes()

template<typename T >
const_bytes_iterator<T> gtirb::ByteInterval::eraseBytes ( const const_bytes_iterator< T >  Begin,
const const_bytes_iterator< T >  End 
)
inline

Erase data from this byte vector.

Template Parameters
TThe type of data you wish to erase.
Parameters
BeginThe start of the data to erase.
EndThe end of the data to erase.
Returns
An iterator pointing to the first element after those erased by this call.

◆ findBlocksAt() [1/4]

block_range gtirb::ByteInterval::findBlocksAt ( Addr  A)
inline

Find all the blocks that start at an address.

Parameters
AThe address to look up.
Returns
A range of Node objects, which are either DataBlock objects or CodeBlock objects, that are at the address A.

◆ findBlocksAt() [2/4]

const_block_range gtirb::ByteInterval::findBlocksAt ( Addr  A) const
inline

Find all the blocks that start at an address.

Parameters
AThe address to look up.
Returns
A range of Node objects, which are either DataBlock objects or CodeBlock objects, that are at the address A.

◆ findBlocksAt() [3/4]

block_range gtirb::ByteInterval::findBlocksAt ( Addr  Low,
Addr  High 
)
inline

Find all the blocks that start between a range of addresses.

Parameters
LowThe low address, inclusive.
HighThe high address, exclusive.
Returns
A range of Node objects, which are either DataBlock objects or CodeBlock objects, that are between the addresses.

◆ findBlocksAt() [4/4]

const_block_range gtirb::ByteInterval::findBlocksAt ( Addr  Low,
Addr  High 
) const
inline

Find all the blocks that start between a range of addresses.

Parameters
LowThe low address, inclusive.
HighThe high address, exclusive.
Returns
A range of Node objects, which are either DataBlock objects or CodeBlock objects, that are between the addresses.

◆ findBlocksAtOffset() [1/4]

block_range gtirb::ByteInterval::findBlocksAtOffset ( uint64_t  Low,
uint64_t  High 
)
inline

Find all the blocks that start between a range of offsets.

Parameters
LowThe low offset, inclusive.
HighThe high offset, exclusive.
Returns
A range of Node objects, which are either DataBlock objects or CodeBlock objects, that are between the offsets.

◆ findBlocksAtOffset() [2/4]

const_block_range gtirb::ByteInterval::findBlocksAtOffset ( uint64_t  Low,
uint64_t  High 
) const
inline

Find all the blocks that start between a range of offsets.

Parameters
LowThe low offset, inclusive.
HighThe high offset, exclusive.
Returns
A range of Node objects, which are either DataBlock objects or CodeBlock objects, that are between the offsets.

◆ findBlocksAtOffset() [3/4]

block_range gtirb::ByteInterval::findBlocksAtOffset ( uint64_t  Off)
inline

Find all the blocks that start at an offset.

Parameters
OffThe offset to look up.
Returns
A range of Node objects, which are either DataBlock objects or CodeBlock objects, that are at the offset Off.

◆ findBlocksAtOffset() [4/4]

const_block_range gtirb::ByteInterval::findBlocksAtOffset ( uint64_t  Off) const
inline

Find all the blocks that start at an offset.

Parameters
OffThe offset to look up.
Returns
A range of Node objects, which are either DataBlock objects or CodeBlock objects, that are at the offset Off.

◆ findBlocksOn() [1/2]

block_subrange gtirb::ByteInterval::findBlocksOn ( Addr  A)
inline

Find all the blocks that have bytes that lie within the address specified.

Parameters
AThe address to look up.
Returns
A range of Node objects, which are either DataBlock objects or CodeBlock objects, that intersect the address A.

◆ findBlocksOn() [2/2]

const_block_subrange gtirb::ByteInterval::findBlocksOn ( Addr  A) const
inline

Find all the blocks that have bytes that lie within the address specified.

Parameters
AThe address to look up.
Returns
A range of Node objects, which are either DataBlock objects or CodeBlock objects, that intersect the address A.

◆ findBlocksOnOffset() [1/2]

block_subrange gtirb::ByteInterval::findBlocksOnOffset ( uint64_t  Off)
inline

Find all the blocks that have a byte at the specified offset.

Parameters
OffThe offset to look up.
Returns
A range of Node objects, which are either DataBlock or CodeBlock objects, that contain the offset Off.

◆ findBlocksOnOffset() [2/2]

const_block_subrange gtirb::ByteInterval::findBlocksOnOffset ( uint64_t  Off) const
inline

Find all the blocks that have a byte at the specified offset.

Parameters
OffThe offset to look up.
Returns
A range of Node objects, which are either DataBlock or CodeBlock objects, that contain the offset Off.

◆ findCodeBlocksAt() [1/4]

code_block_range gtirb::ByteInterval::findCodeBlocksAt ( Addr  A)
inline

Find all the code blocks that start at an address.

Parameters
AThe address to look up.
Returns
A range of CodeBlock objects that are at the address A.

◆ findCodeBlocksAt() [2/4]

const_code_block_range gtirb::ByteInterval::findCodeBlocksAt ( Addr  A) const
inline

Find all the code blocks that start at an address.

Parameters
AThe address to look up.
Returns
A range of CodeBlock objects that are at the address A.

◆ findCodeBlocksAt() [3/4]

code_block_range gtirb::ByteInterval::findCodeBlocksAt ( Addr  Low,
Addr  High 
)
inline

Find all the code blocks that start between a range of addresses.

Parameters
LowThe low address, inclusive.
HighThe high address, exclusive.
Returns
A range of CodeBlock objects that are between the addresses.

◆ findCodeBlocksAt() [4/4]

const_code_block_range gtirb::ByteInterval::findCodeBlocksAt ( Addr  Low,
Addr  High 
) const
inline

Find all the code blocks that start between a range of addresses.

Parameters
LowThe low address, inclusive.
HighThe high address, exclusive.
Returns
A range of CodeBlock objects that are between the addresses.

◆ findCodeBlocksAtOffset() [1/4]

code_block_range gtirb::ByteInterval::findCodeBlocksAtOffset ( uint64_t  Low,
uint64_t  High 
)
inline

Find all the code blocks that start between a range of offsets.

Parameters
LowThe low offset, inclusive.
HighThe high offset, exclusive.
Returns
A range of CodeBlock objects that are between the offsets.

◆ findCodeBlocksAtOffset() [2/4]

const_code_block_range gtirb::ByteInterval::findCodeBlocksAtOffset ( uint64_t  Low,
uint64_t  High 
) const
inline

Find all the code blocks that start between a range of offsets.

Parameters
LowThe low offset, inclusive.
HighThe high offset, exclusive.
Returns
A range of CodeBlock objects that are between the offsets.

◆ findCodeBlocksAtOffset() [3/4]

code_block_range gtirb::ByteInterval::findCodeBlocksAtOffset ( uint64_t  Off)
inline

Find all the code blocks that start at an offset.

Parameters
OffThe offset to look up.
Returns
A range of CodeBlock objects that are at the offset Off.

◆ findCodeBlocksAtOffset() [4/4]

const_code_block_range gtirb::ByteInterval::findCodeBlocksAtOffset ( uint64_t  Off) const
inline

Find all the code blocks that start at an offset.

Parameters
OffThe offset to look up.
Returns
A range of CodeBlock objects that are at the offset Off.

◆ findCodeBlocksOn() [1/2]

code_block_subrange gtirb::ByteInterval::findCodeBlocksOn ( Addr  A)
inline

Find all the code blocks that have bytes that lie within the address specified.

Parameters
AThe address to look up.
Returns
A range of CodeBlock objects that intersect the address A.

◆ findCodeBlocksOn() [2/2]

const_code_block_subrange gtirb::ByteInterval::findCodeBlocksOn ( Addr  A) const
inline

Find all the code blocks that have bytes that lie within the address specified.

Parameters
AThe address to look up.
Returns
A range of CodeBlock objects that intersect the address A.

◆ findCodeBlocksOnOffset() [1/2]

code_block_subrange gtirb::ByteInterval::findCodeBlocksOnOffset ( uint64_t  Off)
inline

Find all the code blocks that have a byte at the specified offset.

Parameters
OffThe offset to look up.
Returns
A range of CodeBlock objects, that contain the offset Off.

◆ findCodeBlocksOnOffset() [2/2]

const_code_block_subrange gtirb::ByteInterval::findCodeBlocksOnOffset ( uint64_t  Off) const
inline

Find all the code blocks that have a byte at the specified offset.

Parameters
OffThe offset to look up.
Returns
A range of CodeBlock objects, that contain the addres Off.

◆ findDataBlocksAt() [1/4]

data_block_range gtirb::ByteInterval::findDataBlocksAt ( Addr  A)
inline

Find all the data blocks that start at an address.

Parameters
AThe address to look up.
Returns
A range of DataBlock objects that are at the address A.

◆ findDataBlocksAt() [2/4]

const_data_block_range gtirb::ByteInterval::findDataBlocksAt ( Addr  A) const
inline

Find all the data blocks that start at an address.

Parameters
AThe address to look up.
Returns
A range of DataBlock objects that are at the address A.

◆ findDataBlocksAt() [3/4]

data_block_range gtirb::ByteInterval::findDataBlocksAt ( Addr  Low,
Addr  High 
)
inline

Find all the data blocks that start between a range of addresses.

Parameters
LowThe low address, inclusive.
HighThe high address, exclusive.
Returns
A range of DataBlock objects that are between the addresses.

◆ findDataBlocksAt() [4/4]

const_data_block_range gtirb::ByteInterval::findDataBlocksAt ( Addr  Low,
Addr  High 
) const
inline

Find all the data blocks that start between a range of addresses.

Parameters
LowThe low address, inclusive.
HighThe high address, exclusive.
Returns
A range of DataBlock objects that are between the addresses.

◆ findDataBlocksAtOffset() [1/4]

data_block_range gtirb::ByteInterval::findDataBlocksAtOffset ( uint64_t  Low,
uint64_t  High 
)
inline

Find all the data blocks that start between a range of offsets.

Parameters
LowThe low offset, inclusive.
HighThe high offset, exclusive.
Returns
A range of DataBlock objects that are between the offsets.

◆ findDataBlocksAtOffset() [2/4]

const_data_block_range gtirb::ByteInterval::findDataBlocksAtOffset ( uint64_t  Low,
uint64_t  High 
) const
inline

Find all the data blocks that start between a range of offsets.

Parameters
LowThe low offset, inclusive.
HighThe high offset, exclusive.
Returns
A range of DataBlock objects that are between the offsets.

◆ findDataBlocksAtOffset() [3/4]

data_block_range gtirb::ByteInterval::findDataBlocksAtOffset ( uint64_t  Off)
inline

Find all the data blocks that start at an offset.

Parameters
OffThe offset to look up.
Returns
A range of DataBlock objects that are at the offset Off.

◆ findDataBlocksAtOffset() [4/4]

const_data_block_range gtirb::ByteInterval::findDataBlocksAtOffset ( uint64_t  Off) const
inline

Find all the data blocks that start at an offset.

Parameters
OffThe offset to look up.
Returns
A range of DataBlock objects that are at the offset Off.

◆ findDataBlocksOn() [1/2]

data_block_subrange gtirb::ByteInterval::findDataBlocksOn ( Addr  A)
inline

Find all the data blocks that have bytes that lie within the address specified.

Parameters
AThe address to look up.
Returns
A range of DataBlock objects that intersect the address A.

◆ findDataBlocksOn() [2/2]

const_data_block_subrange gtirb::ByteInterval::findDataBlocksOn ( Addr  A) const
inline

Find all the data blocks that have bytes that lie within the address specified.

Parameters
AThe address to look up.
Returns
A range of DataBlock objects that intersect the address A.

◆ findDataBlocksOnOffset() [1/2]

data_block_subrange gtirb::ByteInterval::findDataBlocksOnOffset ( uint64_t  Off)
inline

Find all the data blocks that have a byte at the specified offset.

Parameters
OffThe offset to look up.
Returns
A range of DataBlock objects, that contain the offset Off.

◆ findDataBlocksOnOffset() [2/2]

const_data_block_subrange gtirb::ByteInterval::findDataBlocksOnOffset ( uint64_t  Off) const
inline

Find all the data blocks that have a byte at the specified offset.

Parameters
OffThe offset to look up.
Returns
A range of DataBlock objects, that contain the addres Off.

◆ findSymbolicExpressionsAt() [1/4]

symbolic_expression_range gtirb::ByteInterval::findSymbolicExpressionsAt ( Addr  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.

Parameters
AThe address to look up.
Returns
A range of SymbolicExpression objects that are at the address A.

◆ findSymbolicExpressionsAt() [2/4]

const_symbolic_expression_range gtirb::ByteInterval::findSymbolicExpressionsAt ( Addr  A) const
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.

Parameters
AThe address to look up.
Returns
A range of SymbolicExpression objects that are at the address A.

◆ findSymbolicExpressionsAt() [3/4]

symbolic_expression_range gtirb::ByteInterval::findSymbolicExpressionsAt ( Addr  Low,
Addr  High 
)
inline

Find all the symbolic expressions that start between a range of addresses.

Parameters
LowThe low address, inclusive.
HighThe high address, exclusive.
Returns
A range of SymbolicExpression objects that are between the addresses.

◆ findSymbolicExpressionsAt() [4/4]

const_symbolic_expression_range gtirb::ByteInterval::findSymbolicExpressionsAt ( Addr  Low,
Addr  High 
) const
inline

Find all the symbolic expressions that start between a range of addresses.

Parameters
LowThe low address, inclusive.
HighThe high address, exclusive.
Returns
A range of SymbolicExpression objects that are between the addresses.

◆ findSymbolicExpressionsAtOffset() [1/4]

symbolic_expression_range gtirb::ByteInterval::findSymbolicExpressionsAtOffset ( uint64_t  Low,
uint64_t  High 
)
inline

Find all the symbolic expressions that start between a range of offsets.

Parameters
LowThe low offset, inclusive.
HighThe high offset, exclusive.
Returns
A range of SymbolicExpression objects that are between the offsets.

◆ findSymbolicExpressionsAtOffset() [2/4]

const_symbolic_expression_range gtirb::ByteInterval::findSymbolicExpressionsAtOffset ( uint64_t  Low,
uint64_t  High 
) const
inline

Find all the symbolic expressions that start between a range of offsets.

Parameters
LowThe low offset, inclusive.
HighThe high offset, exclusive.
Returns
A range of SymbolicExpression objects that are between the offsets.

◆ findSymbolicExpressionsAtOffset() [3/4]

symbolic_expression_range gtirb::ByteInterval::findSymbolicExpressionsAtOffset ( uint64_t  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.

Parameters
OffThe offset to look up.
Returns
A range of SymbolicExpression objects that are at the offset Off.

◆ findSymbolicExpressionsAtOffset() [4/4]

const_symbolic_expression_range gtirb::ByteInterval::findSymbolicExpressionsAtOffset ( uint64_t  Off) const
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.

Parameters
OffThe offset to look up.
Returns
A range of SymbolicExpression objects that are at the offset Off.

◆ getAddress()

std::optional<Addr> gtirb::ByteInterval::getAddress ( ) const
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.

◆ getBoostEndianOrder()

boost::endian::order gtirb::ByteInterval::getBoostEndianOrder ( ) const

Get the boost::endian::order of this module, suitable for passing to the bytes iterator.

◆ getInitializedSize()

uint64_t gtirb::ByteInterval::getInitializedSize ( ) const
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.

◆ getSection() [1/2]

Section* gtirb::ByteInterval::getSection ( )
inline

Get the Section this byte interval belongs to.

◆ getSection() [2/2]

const Section* gtirb::ByteInterval::getSection ( ) const
inline

Get the Section this byte interval belongs to.

◆ getSize()

uint64_t gtirb::ByteInterval::getSize ( ) const
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.

◆ getSymbolicExpression() [1/2]

SymbolicExpression* gtirb::ByteInterval::getSymbolicExpression ( uint64_t  Off)
inline

Get the symbolic expression at the given offset, if present.

Parameters
OffThe offset of the SymbolicExpression to return.
Returns
The SymbolicExpression at that offset, or nullptr if there is no SymbolicExpression at that offset.

◆ getSymbolicExpression() [2/2]

const SymbolicExpression* gtirb::ByteInterval::getSymbolicExpression ( uint64_t  Off) const
inline

Get the symbolic expression at the given offset, if present.

Parameters
OffThe offset of the SymbolicExpression to return.
Returns
The SymbolicExpression at that offset, or nullptr if there is no SymbolicExpression at that offset.

◆ insertBytes() [1/8]

template<typename T >
bytes_iterator<T> gtirb::ByteInterval::insertBytes ( bytes_iterator< T >  Pos,
const T &  X 
)
inline

Insert a single datum into this byte vector.

Template Parameters
TThe type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
Parameters
PosThe position in the byte vector to insert data at.
XThe data tprivato insert.
Returns
An iterator pointing to the element inserted by this call.

◆ insertBytes() [2/8]

template<typename T >
bytes_iterator<T> gtirb::ByteInterval::insertBytes ( bytes_iterator< T >  Pos,
const T &  X,
boost::endian::order  VectorOrder,
boost::endian::order  ElementOrder = boost::endian::order::native 
)
inline

Insert a single datum into this byte vector.

Template Parameters
TThe type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
Parameters
PosThe position in the byte vector to insert data at.
XThe data to insert.
VectorOrderThe endianness of the data in the byte vector.
ElementOrderThe endianness of the data to be inserted.
Returns
An iterator pointing to the element inserted by this call.

◆ insertBytes() [3/8]

template<typename T , typename InputIterator >
bytes_iterator<T> gtirb::ByteInterval::insertBytes ( bytes_iterator< T >  Pos,
InputIterator  Begin,
InputIterator  End 
)
inline

Insert data into this byte vector.

Template Parameters
TThe type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
InputIteratorThe type of an iterator yielding T.
Parameters
PosThe position in the byte vector to insert data at.
BeginThe start of the data to insert.
EndThe end of the data to insert.
Returns
An iterator pointing to the first element inserted by this call.

◆ insertBytes() [4/8]

template<typename T , typename InputIterator >
bytes_iterator<T> gtirb::ByteInterval::insertBytes ( bytes_iterator< T >  Pos,
InputIterator  Begin,
InputIterator  End,
boost::endian::order  VectorOrder,
boost::endian::order  ElementsOrder = boost::endian::order::native 
)
inline

Insert data into this byte vector.

Template Parameters
TThe type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
InputIteratorThe type of an iterator yielding T.
Parameters
PosThe position in the byte vector to insert data at.
BeginThe start of the data to insert.
EndThe end of the data to insert.
VectorOrderThe endianness of the data in the byte vector.
ElementsOrderThe endianness of the data to be inserted.
Returns
An iterator pointing to the first element inserted by this call.

◆ insertBytes() [5/8]

template<typename T >
const_bytes_iterator<T> gtirb::ByteInterval::insertBytes ( const const_bytes_iterator< T >  Pos,
const T &  X 
)
inline

Insert a single datum into this byte vector.

Template Parameters
TThe type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
Parameters
PosThe position in the byte vector to insert data at.
XThe data to insert.
Returns
An iterator pointing to the element inserted by this call.

◆ insertBytes() [6/8]

template<typename T >
const_bytes_iterator<T> gtirb::ByteInterval::insertBytes ( const const_bytes_iterator< T >  Pos,
const T &  X,
boost::endian::order  VectorOrder,
boost::endian::order  ElementOrder = boost::endian::order::native 
)
inline

Insert a single datum into this byte vector.

Template Parameters
TThe type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
Parameters
PosThe position in the byte vector to insert data at.
XThe data to insert.
VectorOrderThe endianness of the data in the byte vector.
ElementOrderThe endianness of the data to be inserted.
Returns
An iterator pointing to the element inserted by this call.

◆ insertBytes() [7/8]

template<typename T , typename InputIterator >
const_bytes_iterator<T> gtirb::ByteInterval::insertBytes ( const const_bytes_iterator< T >  Pos,
InputIterator  Begin,
InputIterator  End 
)
inline

Insert data into this byte vector.

Template Parameters
TThe type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
InputIteratorThe type of an iterator yielding T.
Parameters
PosThe position in the byte vector to insert data at.
BeginThe start of the data to insert.
EndThe end of the data to insert.
Returns
An iterator pointing to the first element inserted by this call.

◆ insertBytes() [8/8]

template<typename T , typename InputIterator >
const_bytes_iterator<T> gtirb::ByteInterval::insertBytes ( const const_bytes_iterator< T >  Pos,
InputIterator  Begin,
InputIterator  End,
boost::endian::order  VectorOrder,
boost::endian::order  ElementsOrder = boost::endian::order::native 
)
inline

Insert data into this byte vector.

Template Parameters
TThe type of data you wish to insert into the byte vector. Must be a POD type that satisfies Boost's EndianReversible concept.
InputIteratorThe type of an iterator yielding T.
Parameters
PosThe position in the byte vector to insert data at.
BeginThe start of the data to insert.
EndThe end of the data to insert.
VectorOrderThe endianness of the data in the byte vector.
ElementsOrderThe endianness of the data to be inserted.
Returns
An iterator pointing to the first element inserted by this call.

◆ rawBytes() [1/2]

template<typename T >
T* gtirb::ByteInterval::rawBytes ( )
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.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type.

◆ rawBytes() [2/2]

template<typename T >
const T* gtirb::ByteInterval::rawBytes ( ) const
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.

Template Parameters
TThe type of data stored in this byte vector. Must be a POD type.

◆ removeBlock() [1/2]

ChangeStatus gtirb::ByteInterval::removeBlock ( CodeBlock B)

Remove a block from this interval.

Parameters
BThe block to remove.
Returns
Whether or not the operation succeeded. This operation can fail if the node to remove is not actually part of this node to begin with.

◆ removeBlock() [2/2]

ChangeStatus gtirb::ByteInterval::removeBlock ( DataBlock B)

Remove a block from this interval.

Parameters
BThe block to remove.
Returns
Whether or not the operation succeeded. This operation can fail if the node to remove is not actually part of this node to begin with.

◆ removeSymbolicExpression()

bool gtirb::ByteInterval::removeSymbolicExpression ( uint64_t  Off)
inline

Removes a SymbolicExpression at the given offset, if present.

Parameters
OffThe offset of the SymbolicExpression to remove.
Returns
Whether or not the operation succeeded. This operation can fail if the node to remove is not actually part of this node to begin with.

◆ setAddress()

void gtirb::ByteInterval::setAddress ( std::optional< Addr A)

Set or clear the address of this interval.

Parameters
AEither the new address, or an empty std::optional if you wish to remove the address.

◆ setInitializedSize()

void gtirb::ByteInterval::setInitializedSize ( uint64_t  S)
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.

◆ setSize()

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.

Parameters
SThe new size.

◆ symbolic_expressions() [1/2]

symbolic_expression_range gtirb::ByteInterval::symbolic_expressions ( )
inline

Return a range of the SymbolicExpression objects in this interval.

◆ symbolic_expressions() [2/2]

const_symbolic_expression_range gtirb::ByteInterval::symbolic_expressions ( ) const
inline

Return a const range of the SymbolicExpression objects in this interval.

◆ symbolic_expressions_begin() [1/2]

symbolic_expression_iterator gtirb::ByteInterval::symbolic_expressions_begin ( )
inline

Return an iterator to the first SymbolicExpression.

◆ symbolic_expressions_begin() [2/2]

const_symbolic_expression_iterator gtirb::ByteInterval::symbolic_expressions_begin ( ) const
inline

Return a const iterator to the first SymbolicExpression.

◆ symbolic_expressions_end() [1/2]

symbolic_expression_iterator gtirb::ByteInterval::symbolic_expressions_end ( )
inline

Return an iterator to the element following the last SymbolicExpression.

◆ symbolic_expressions_end() [2/2]

const_symbolic_expression_iterator gtirb::ByteInterval::symbolic_expressions_end ( ) const
inline

Return a const iterator to the element following the last SymbolicExpression.

Friends And Related Function Documentation

◆ BlockOffsetLess

friend struct BlockOffsetLess
friend

◆ CodeBlock

friend class CodeBlock
friend

◆ Context

friend class Context
friend

◆ DataBlock

friend class DataBlock
friend

◆ Module

friend class Module
friend

◆ Section

friend class Section
friend

◆ SerializationTestHarness

friend class SerializationTestHarness
friend

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