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

Represents a named section of the binary. More...

#include <Section.hpp>

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

Public Types

using block_iterator = MergeSortedIterator< ByteInterval::block_iterator, BlockAddressLess >
 Iterator over blocks. More...
 
using block_range = boost::iterator_range< block_iterator >
 Range of blocks. More...
 
using block_subrange = boost::iterator_range< MergeSortedIterator< ByteInterval::block_subrange::iterator, BlockAddressLess > >
 Sub-range of blocks overlapping an address or range of addreses. More...
 
using byte_interval_iterator = boost::indirect_iterator< ByteIntervalSet::iterator >
 Iterator over ByteInterval objects. More...
 
using byte_interval_range = boost::iterator_range< byte_interval_iterator >
 Range of ByteInterval objects. More...
 
using byte_interval_subrange = boost::iterator_range< boost::indirect_iterator< ByteIntervalIntMap::codomain_type::iterator > >
 Sub-range of ByteInterval objects overlapping addresses. More...
 
using code_block_iterator = MergeSortedIterator< ByteInterval::code_block_iterator, AddressLess >
 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< MergeSortedIterator< ByteInterval::code_block_subrange::iterator, AddressLess > >
 Sub-range of CodeBlock objects overlapping an address or range of addreses. More...
 
using const_block_iterator = MergeSortedIterator< ByteInterval::const_block_iterator, BlockAddressLess >
 Const iterator over blocks. More...
 
using const_block_range = boost::iterator_range< const_block_iterator >
 Const range of blocks. More...
 
using const_block_subrange = boost::iterator_range< MergeSortedIterator< ByteInterval::const_block_subrange::iterator, BlockAddressLess > >
 Const sub-range of blocks overlapping an address or range of addreses. More...
 
using const_byte_interval_iterator = boost::indirect_iterator< ByteIntervalSet::const_iterator, const ByteInterval >
 Const iterator over ByteInterval objects. More...
 
using const_byte_interval_range = boost::iterator_range< const_byte_interval_iterator >
 Const range of ByteInterval objects. More...
 
using const_byte_interval_subrange = boost::iterator_range< boost::indirect_iterator< ByteIntervalIntMap::codomain_type::const_iterator > >
 Const sub-range of ByteInterval objects overlapping addresses. More...
 
using const_code_block_iterator = MergeSortedIterator< ByteInterval::const_code_block_iterator, AddressLess >
 Iterator over CodeBlock objects. More...
 
using const_code_block_range = boost::iterator_range< const_code_block_iterator >
 Range of CodeBlock objects. More...
 
using const_code_block_subrange = boost::iterator_range< MergeSortedIterator< ByteInterval::const_code_block_subrange::iterator, AddressLess > >
 Sub-range of CodeBlock objects overlapping an address or range of addreses. More...
 
using const_data_block_iterator = MergeSortedIterator< ByteInterval::const_data_block_iterator, AddressLess >
 Iterator over DataBlock objects. More...
 
using const_data_block_range = boost::iterator_range< const_data_block_iterator >
 Range of DataBlock objects. More...
 
using const_data_block_subrange = boost::iterator_range< MergeSortedIterator< ByteInterval::const_data_block_subrange::iterator, AddressLess > >
 Sub-range of DataBlock objects overlapping an address or range of addreses. More...
 
using const_section_flag_iterator = std::set< SectionFlag >::const_iterator
 Iterator over SectionFlag flags. More...
 
using const_section_flag_range = boost::iterator_range< const_section_flag_iterator >
 Range of SectionFlag flags. More...
 
using const_symbolic_expression_iterator = MergeSortedIterator< ByteInterval::const_symbolic_expression_iterator, ByteInterval::ConstSymbolicExpressionElement::AddressLess >
 Iterator over SymbolicExpressionElement objects. More...
 
using const_symbolic_expression_range = boost::iterator_range< const_symbolic_expression_iterator >
 Range of SymbolicExpressionElement objects. More...
 
using data_block_iterator = MergeSortedIterator< ByteInterval::data_block_iterator, AddressLess >
 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< MergeSortedIterator< ByteInterval::data_block_subrange::iterator, AddressLess > >
 Sub-range of DataBlock objects overlapping an address or range of addreses. More...
 
using symbolic_expression_iterator = MergeSortedIterator< ByteInterval::symbolic_expression_iterator, ByteInterval::SymbolicExpressionElement::AddressLess >
 Iterator over SymbolicExpressionElement objects. More...
 
using symbolic_expression_range = boost::iterator_range< symbolic_expression_iterator >
 Range of SymbolicExpressionElement objects. More...
 

Public Member Functions

ChangeStatus addByteInterval (ByteInterval *BI)
 Move an existing ByteInterval to be a part of this section. More...
 
template<typename... Args>
ByteIntervaladdByteInterval (Context &C, Args &&... A)
 Creates a new ByteInterval in this section. More...
 
void addFlag (SectionFlag F)
 Adds the flag to the Section. More...
 
template<typename... Fs>
void addFlags (Fs... F)
 Adds all of the flags to the Section. More...
 
block_range blocks ()
 Return a range of all the blocks. More...
 
const_block_range blocks () const
 Return a range of all the blocks. More...
 
block_iterator blocks_begin ()
 Return an iterator to the first block. More...
 
const_block_iterator blocks_begin () const
 Return an 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 an iterator to the element following the last block. More...
 
byte_interval_range byte_intervals ()
 Return a range of the ByteInterval objects in this section. More...
 
const_byte_interval_range byte_intervals () const
 Return a const range of the ByteInterval objects in this section. More...
 
byte_interval_iterator byte_intervals_begin ()
 Return an iterator to the first ByteInterval. More...
 
const_byte_interval_iterator byte_intervals_begin () const
 Return a const iterator to the first ByteInterval. More...
 
byte_interval_iterator byte_intervals_end ()
 Return an iterator to the element following the last ByteInterval. More...
 
const_byte_interval_iterator byte_intervals_end () const
 Return a const iterator to the element following the last ByteInterval. More...
 
code_block_range code_blocks ()
 Return a range of all the CodeBlock objects. More...
 
const_code_block_range code_blocks () const
 Return a range of all the CodeBlock objects. More...
 
code_block_iterator code_blocks_begin ()
 Return an iterator to the first CodeBlock. More...
 
const_code_block_iterator code_blocks_begin () const
 Return an 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 an iterator to the element following the last CodeBlock. More...
 
data_block_range data_blocks ()
 Return a range of all the DataBlock objects. More...
 
const_data_block_range data_blocks () const
 Return a range of all the DataBlock objects. More...
 
data_block_iterator data_blocks_begin ()
 Return an iterator to the first DataBlock. More...
 
const_data_block_iterator data_blocks_begin () const
 Return an 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 an iterator to the element following the last DataBlock. 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_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...
 
byte_interval_range findByteIntervalsAt (Addr A)
 Find all the intervals that start at an address. More...
 
const_byte_interval_range findByteIntervalsAt (Addr A) const
 Find all the intervals that start at an address. More...
 
byte_interval_range findByteIntervalsAt (Addr Low, Addr High)
 Find all the intervals that start between a range of addresses. More...
 
const_byte_interval_range findByteIntervalsAt (Addr Low, Addr High) const
 Find all the intervals that start between a range of addresses. More...
 
byte_interval_subrange findByteIntervalsOn (Addr A)
 Find all the intervals that have bytes that lie within the address specified. More...
 
const_byte_interval_subrange findByteIntervalsOn (Addr A) const
 Find all the intervals that have bytes that lie within the address specified. 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_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...
 
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_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...
 
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...
 
const_section_flag_range flags () const
 Return a range of the SectionFlag flags set for the Section. More...
 
const_section_flag_iterator flags_begin () const
 Return a const iterator to the first SectionFlag. More...
 
const_section_flag_iterator flags_end () const
 Return a const iterator to the element following the last SectionFlag. More...
 
std::optional< AddrgetAddress () const
 Return the address of this section, if known. More...
 
ModulegetModule ()
 Get the Module this section belongs to. More...
 
const ModulegetModule () const
 Get the Module this section belongs to. More...
 
const std::string & getName () const
 Get the name of a Section. More...
 
std::optional< uint64_t > getSize () const
 Return the size of this section, if known. More...
 
bool isFlagSet (SectionFlag F) const
 Tests whether the given flag is set for the Section. More...
 
bool operator!= (const Section &Other) const
 Inequality operator overload. More...
 
bool operator== (const Section &Other) const
 Equality operator overload. More...
 
ChangeStatus removeByteInterval (ByteInterval *N)
 Remove an interval from this section. More...
 
void removeFlag (SectionFlag F)
 Removes the flag from the Section. More...
 
void setName (const std::string &N)
 Set this section's name. More...
 
symbolic_expression_range symbolic_expressions ()
 Return a range of all the SymbolicExpression objects. More...
 
const_symbolic_expression_range symbolic_expressions () const
 Return a range of all the SymbolicExpression objects. More...
 
symbolic_expression_iterator symbolic_expressions_begin ()
 Return an iterator to the first SymbolicExpression. More...
 
const_symbolic_expression_iterator symbolic_expressions_begin () const
 Return an 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 an 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 SectionCreate (Context &C)
 Create an unitialized Section object. More...
 
static SectionCreate (Context &C, const std::string &Name)
 Create a Section 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

class Context
 
class Module
 
class SerializationTestHarness
 
template<typename T >
T::MessageType toProtobuf (const T &)
 

Detailed Description

Represents a named section of the binary.

Does not directly store the contents of the section, which are kept in ImageByteMap.

Member Typedef Documentation

◆ block_iterator

using gtirb::Section::block_iterator = MergeSortedIterator<ByteInterval::block_iterator, BlockAddressLess>

Iterator over blocks.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ block_range

using gtirb::Section::block_range = boost::iterator_range<block_iterator>

Range of blocks.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ block_subrange

using gtirb::Section::block_subrange = boost::iterator_range<MergeSortedIterator< ByteInterval::block_subrange::iterator, BlockAddressLess> >

Sub-range of blocks overlapping an address or range of addreses.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ byte_interval_iterator

using gtirb::Section::byte_interval_iterator = boost::indirect_iterator<ByteIntervalSet::iterator>

Iterator over ByteInterval objects.

◆ byte_interval_range

Range of ByteInterval objects.

◆ byte_interval_subrange

using gtirb::Section::byte_interval_subrange = boost::iterator_range< boost::indirect_iterator<ByteIntervalIntMap::codomain_type::iterator> >

Sub-range of ByteInterval objects overlapping addresses.

◆ code_block_iterator

Iterator over CodeBlock objects.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ code_block_range

using gtirb::Section::code_block_range = boost::iterator_range<code_block_iterator>

Range of CodeBlock objects.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ code_block_subrange

using gtirb::Section::code_block_subrange = boost::iterator_range<MergeSortedIterator< ByteInterval::code_block_subrange::iterator, AddressLess> >

Sub-range of CodeBlock objects overlapping an address or range of addreses.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ const_block_iterator

using gtirb::Section::const_block_iterator = MergeSortedIterator<ByteInterval::const_block_iterator, BlockAddressLess>

Const iterator over blocks.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ const_block_range

Const range of blocks.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ const_block_subrange

using gtirb::Section::const_block_subrange = boost::iterator_range<MergeSortedIterator< ByteInterval::const_block_subrange::iterator, BlockAddressLess> >

Const sub-range of blocks overlapping an address or range of addreses.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ const_byte_interval_iterator

using gtirb::Section::const_byte_interval_iterator = boost::indirect_iterator<ByteIntervalSet::const_iterator, const ByteInterval>

Const iterator over ByteInterval objects.

◆ const_byte_interval_range

Const range of ByteInterval objects.

◆ const_byte_interval_subrange

using gtirb::Section::const_byte_interval_subrange = boost::iterator_range<boost::indirect_iterator< ByteIntervalIntMap::codomain_type::const_iterator> >

Const sub-range of ByteInterval objects overlapping addresses.

◆ const_code_block_iterator

Iterator over CodeBlock objects.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ const_code_block_range

Range of CodeBlock objects.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ const_code_block_subrange

using gtirb::Section::const_code_block_subrange = boost::iterator_range<MergeSortedIterator< ByteInterval::const_code_block_subrange::iterator, AddressLess> >

Sub-range of CodeBlock objects overlapping an address or range of addreses.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ const_data_block_iterator

Iterator over DataBlock objects.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ const_data_block_range

Range of DataBlock objects.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ const_data_block_subrange

using gtirb::Section::const_data_block_subrange = boost::iterator_range<MergeSortedIterator< ByteInterval::const_data_block_subrange::iterator, AddressLess> >

Sub-range of DataBlock objects overlapping an address or range of addreses.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ const_section_flag_iterator

using gtirb::Section::const_section_flag_iterator = std::set<SectionFlag>::const_iterator

Iterator over SectionFlag flags.

◆ const_section_flag_range

Range of SectionFlag flags.

◆ const_symbolic_expression_iterator

Iterator over SymbolicExpressionElement objects.

Results are yielded in address order, ascending.

◆ const_symbolic_expression_range

Range of SymbolicExpressionElement objects.

Results are yielded in address order, ascending.

◆ data_block_iterator

Iterator over DataBlock objects.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ data_block_range

using gtirb::Section::data_block_range = boost::iterator_range<data_block_iterator>

Range of DataBlock objects.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ data_block_subrange

using gtirb::Section::data_block_subrange = boost::iterator_range<MergeSortedIterator< ByteInterval::data_block_subrange::iterator, AddressLess> >

Sub-range of DataBlock objects overlapping an address or range of addreses.

Blocks are yielded in address order, ascending. If two blocks have the same address, thier order is not specified.

◆ symbolic_expression_iterator

Iterator over SymbolicExpressionElement objects.

Results are yielded in address order, ascending.

◆ symbolic_expression_range

Range of SymbolicExpressionElement objects.

Results are yielded in address order, ascending.

Member Function Documentation

◆ addByteInterval() [1/2]

ChangeStatus gtirb::Section::addByteInterval ( ByteInterval BI)

Move an existing ByteInterval to be a part of this section.

Returns
a ChangeStatus indicating whether the insertion took place (Accepted), was unnecessary because this node already contained the ByteInterval (NoChange), or could not be completed (Rejected).

◆ addByteInterval() [2/2]

template<typename... Args>
ByteInterval* gtirb::Section::addByteInterval ( Context C,
Args &&...  A 
)
inline

Creates a new ByteInterval in this section.

Template Parameters
ArgsThe arguments to construct a ByteInterval.
Parameters
CThe Context in which this object will be held.
AThe arguments to construct a ByteInterval.

◆ addFlag()

void gtirb::Section::addFlag ( SectionFlag  F)
inline

Adds the flag to the Section.

Parameters
FThe flag to be added.

◆ addFlags()

template<typename... Fs>
void gtirb::Section::addFlags ( Fs...  F)
inline

Adds all of the flags to the Section.

Template Parameters
FsA pack of SectionFlag flags.
Parameters
FThe flags to be added to the Section.

◆ blocks() [1/2]

block_range gtirb::Section::blocks ( )
inline

Return a range of all the blocks.

◆ blocks() [2/2]

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

Return a range of all the blocks.

◆ blocks_begin() [1/2]

block_iterator gtirb::Section::blocks_begin ( )
inline

Return an iterator to the first block.

◆ blocks_begin() [2/2]

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

Return an iterator to the first block.

◆ blocks_end() [1/2]

block_iterator gtirb::Section::blocks_end ( )
inline

Return an iterator to the element following the last block.

◆ blocks_end() [2/2]

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

Return an iterator to the element following the last block.

◆ byte_intervals() [1/2]

byte_interval_range gtirb::Section::byte_intervals ( )
inline

Return a range of the ByteInterval objects in this section.

◆ byte_intervals() [2/2]

const_byte_interval_range gtirb::Section::byte_intervals ( ) const
inline

Return a const range of the ByteInterval objects in this section.

◆ byte_intervals_begin() [1/2]

byte_interval_iterator gtirb::Section::byte_intervals_begin ( )
inline

Return an iterator to the first ByteInterval.

◆ byte_intervals_begin() [2/2]

const_byte_interval_iterator gtirb::Section::byte_intervals_begin ( ) const
inline

Return a const iterator to the first ByteInterval.

◆ byte_intervals_end() [1/2]

byte_interval_iterator gtirb::Section::byte_intervals_end ( )
inline

Return an iterator to the element following the last ByteInterval.

◆ byte_intervals_end() [2/2]

const_byte_interval_iterator gtirb::Section::byte_intervals_end ( ) const
inline

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

◆ code_blocks() [1/2]

code_block_range gtirb::Section::code_blocks ( )
inline

Return a range of all the CodeBlock objects.

◆ code_blocks() [2/2]

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

Return a range of all the CodeBlock objects.

◆ code_blocks_begin() [1/2]

code_block_iterator gtirb::Section::code_blocks_begin ( )
inline

Return an iterator to the first CodeBlock.

◆ code_blocks_begin() [2/2]

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

Return an iterator to the first CodeBlock.

◆ code_blocks_end() [1/2]

code_block_iterator gtirb::Section::code_blocks_end ( )
inline

Return an iterator to the element following the last CodeBlock.

◆ code_blocks_end() [2/2]

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

Return an iterator to the element following the last CodeBlock.

◆ Create() [1/2]

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

Create an unitialized Section object.

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

◆ Create() [2/2]

static Section* gtirb::Section::Create ( Context C,
const std::string &  Name 
)
inlinestatic

Create a Section object.

Parameters
CThe Context in which this object will be held.
NameThe name of the section.
Returns
The newly created object.

◆ data_blocks() [1/2]

data_block_range gtirb::Section::data_blocks ( )
inline

Return a range of all the DataBlock objects.

◆ data_blocks() [2/2]

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

Return a range of all the DataBlock objects.

◆ data_blocks_begin() [1/2]

data_block_iterator gtirb::Section::data_blocks_begin ( )
inline

Return an iterator to the first DataBlock.

◆ data_blocks_begin() [2/2]

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

Return an iterator to the first DataBlock.

◆ data_blocks_end() [1/2]

data_block_iterator gtirb::Section::data_blocks_end ( )
inline

Return an iterator to the element following the last DataBlock.

◆ data_blocks_end() [2/2]

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

Return an iterator to the element following the last DataBlock.

◆ findBlocksAt() [1/4]

block_range gtirb::Section::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::Section::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::Section::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::Section::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.

◆ findBlocksOn() [1/2]

block_subrange gtirb::Section::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::Section::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.

◆ findByteIntervalsAt() [1/4]

byte_interval_range gtirb::Section::findByteIntervalsAt ( Addr  A)
inline

Find all the intervals that start at an address.

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

◆ findByteIntervalsAt() [2/4]

const_byte_interval_range gtirb::Section::findByteIntervalsAt ( Addr  A) const
inline

Find all the intervals that start at an address.

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

◆ findByteIntervalsAt() [3/4]

byte_interval_range gtirb::Section::findByteIntervalsAt ( Addr  Low,
Addr  High 
)
inline

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

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

◆ findByteIntervalsAt() [4/4]

const_byte_interval_range gtirb::Section::findByteIntervalsAt ( Addr  Low,
Addr  High 
) const
inline

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

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

◆ findByteIntervalsOn() [1/2]

byte_interval_subrange gtirb::Section::findByteIntervalsOn ( Addr  A)
inline

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

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

◆ findByteIntervalsOn() [2/2]

const_byte_interval_subrange gtirb::Section::findByteIntervalsOn ( Addr  A) const
inline

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

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

◆ findCodeBlocksAt() [1/4]

code_block_range gtirb::Section::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::Section::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::Section::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::Section::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.

◆ findCodeBlocksOn() [1/2]

code_block_subrange gtirb::Section::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 CodeNode object that intersect the address A.

◆ findCodeBlocksOn() [2/2]

const_code_block_subrange gtirb::Section::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.

◆ findDataBlocksAt() [1/4]

data_block_range gtirb::Section::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::Section::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::Section::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::Section::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.

◆ findDataBlocksOn() [1/2]

data_block_subrange gtirb::Section::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 DataNode object that intersect the address A.

◆ findDataBlocksOn() [2/2]

const_data_block_subrange gtirb::Section::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.

◆ findSymbolicExpressionsAt() [1/4]

symbolic_expression_range gtirb::Section::findSymbolicExpressionsAt ( Addr  A)
inline

Find all the symbolic expressions that start at an address.

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::Section::findSymbolicExpressionsAt ( Addr  A) const
inline

Find all the symbolic expressions that start at an address.

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::Section::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::Section::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.

◆ flags()

const_section_flag_range gtirb::Section::flags ( ) const
inline

Return a range of the SectionFlag flags set for the Section.

◆ flags_begin()

const_section_flag_iterator gtirb::Section::flags_begin ( ) const
inline

Return a const iterator to the first SectionFlag.

◆ flags_end()

const_section_flag_iterator gtirb::Section::flags_end ( ) const
inline

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

◆ getAddress()

std::optional<Addr> gtirb::Section::getAddress ( ) const
inline

Return the address of this section, if known.

The address is calculated from the ByteInterval objects in this section. More specifically, if the address of all byte intervals in this section are fixed, then it will return the address of the interval lowest in memory. If any one interval does not have an address, then this function will return std::nullopt, as the address is not calculable in that case. Note that a section with no intervals in it has no address or size, so it will return std::nullopt in that case.

◆ getModule() [1/2]

Module* gtirb::Section::getModule ( )
inline

Get the Module this section belongs to.

◆ getModule() [2/2]

const Module* gtirb::Section::getModule ( ) const
inline

Get the Module this section belongs to.

◆ getName()

const std::string& gtirb::Section::getName ( ) const
inline

Get the name of a Section.

Returns
The name.

◆ getSize()

std::optional<uint64_t> gtirb::Section::getSize ( ) const
inline

Return the size of this section, if known.

The size is calculated from the ByteInterval objects in this section. More specifically, if the address of all byte intervals in this section are fixed, then it will return the difference between the lowest and highest address among the intervals. If any one interval does not have an address, then this function will return std::nullopt, as the size is not calculable in that case. Note that a section with no intervals in it has no address or size, so it will return std::nullopt in that case.

◆ isFlagSet()

bool gtirb::Section::isFlagSet ( SectionFlag  F) const
inline

Tests whether the given flag is set for the Section.

Parameters
FThe flag to test.
Returns
true if the flag is set, false otherwise.

◆ operator!=()

bool gtirb::Section::operator!= ( const Section Other) const

Inequality operator overload.

◆ operator==()

bool gtirb::Section::operator== ( const Section Other) const

Equality operator overload.

◆ removeByteInterval()

ChangeStatus gtirb::Section::removeByteInterval ( ByteInterval N)

Remove an interval from this section.

Returns
Whether the operation succeeded (Accepted), no change was made (NoChange), or the operation could not be completed (Rejected). In particular, if the node to remove is not actually part of this node to begin with, the result will be NoChange.

◆ removeFlag()

void gtirb::Section::removeFlag ( SectionFlag  F)
inline

Removes the flag from the Section.

Parameters
FThe flag to be removed.

◆ setName()

void gtirb::Section::setName ( const std::string &  N)
inline

Set this section's name.

◆ symbolic_expressions() [1/2]

symbolic_expression_range gtirb::Section::symbolic_expressions ( )
inline

Return a range of all the SymbolicExpression objects.

◆ symbolic_expressions() [2/2]

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

Return a range of all the SymbolicExpression objects.

◆ symbolic_expressions_begin() [1/2]

symbolic_expression_iterator gtirb::Section::symbolic_expressions_begin ( )
inline

Return an iterator to the first SymbolicExpression.

◆ symbolic_expressions_begin() [2/2]

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

Return an iterator to the first SymbolicExpression.

◆ symbolic_expressions_end() [1/2]

symbolic_expression_iterator gtirb::Section::symbolic_expressions_end ( )
inline

Return an iterator to the element following the last SymbolicExpression.

◆ symbolic_expressions_end() [2/2]

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

Return an iterator to the element following the last SymbolicExpression.

Friends And Related Function Documentation

◆ Context

friend class Context
friend

◆ Module

friend class Module
friend

◆ SerializationTestHarness

friend class SerializationTestHarness
friend

◆ toProtobuf

template<typename T >
T::MessageType toProtobuf ( const T &  )
friend

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