GTIRB
v2.2.0
GrammaTech Intermediate Representation for Binaries: C++ API
|
Go to the documentation of this file.
15 #ifndef GTIRB_SECTION_H
16 #define GTIRB_SECTION_H
25 #include <gtirb/proto/Section.pb.h>
27 #include <boost/icl/interval_map.hpp>
28 #include <boost/iterator/indirect_iterator.hpp>
29 #include <boost/iterator/iterator_traits.hpp>
30 #include <boost/multi_index/hashed_index.hpp>
31 #include <boost/multi_index/key_extractors.hpp>
32 #include <boost/multi_index/mem_fun.hpp>
33 #include <boost/multi_index/ordered_index.hpp>
34 #include <boost/range/iterator_range.hpp>
44 class SectionObserver;
45 template <
typename T>
class ErrorOr;
51 Undefined = proto::SectionFlag::Section_Undefined,
52 Readable = proto::SectionFlag::Readable,
53 Writable = proto::SectionFlag::Writable,
55 Loaded = proto::SectionFlag::Loaded,
78 using ByteIntervalSet = boost::multi_index::multi_index_container<
80 boost::multi_index::indexed_by<
81 boost::multi_index::ordered_non_unique<
82 boost::multi_index::tag<by_address>,
83 boost::multi_index::identity<ByteInterval*>, AddressLess>,
84 boost::multi_index::hashed_unique<
85 boost::multi_index::tag<by_pointer>,
86 boost::multi_index::identity<ByteInterval*>>>>;
87 using ByteIntervalIntMap =
88 boost::icl::interval_map<Addr, std::set<ByteInterval*, AddressLess>>;
90 class ByteIntervalObserverImpl;
112 bool operator!=(
const Section& Other)
const;
122 const std::string&
getName()
const {
return Name; }
132 template <
typename... Fs>
void addFlags(Fs... F) { (addFlag(F), ...); }
144 return std::find(Flags.begin(), Flags.end(), F) != Flags.end();
151 boost::iterator_range<const_section_flag_iterator>;
160 return boost::make_iterator_range(flags_begin(), flags_end());
164 using byte_interval_iterator =
165 boost::indirect_iterator<ByteIntervalSet::iterator>;
170 boost::indirect_iterator<ByteIntervalIntMap::codomain_type::iterator>>;
173 boost::indirect_iterator<ByteIntervalSet::const_iterator,
177 boost::iterator_range<const_byte_interval_iterator>;
180 boost::iterator_range<boost::indirect_iterator<
181 ByteIntervalIntMap::codomain_type::const_iterator>>;
185 return ByteIntervals.begin();
189 return ByteIntervals.begin();
197 return ByteIntervals.end();
201 return boost::make_iterator_range(byte_intervals_begin(),
202 byte_intervals_end());
207 return boost::make_iterator_range(byte_intervals_begin(),
208 byte_intervals_end());
219 if (
auto It = ByteIntervalAddrs.find(A); It != ByteIntervalAddrs.end()) {
220 return boost::make_iterator_range(
221 boost::make_indirect_iterator(It->second.begin()),
222 boost::make_indirect_iterator(It->second.end()));
235 if (
auto It = ByteIntervalAddrs.find(A); It != ByteIntervalAddrs.end()) {
236 return boost::make_iterator_range(
237 boost::make_indirect_iterator(It->second.begin()),
238 boost::make_indirect_iterator(It->second.end()));
249 auto Pair = ByteIntervals.get<by_address>().equal_range(A);
262 auto& Index = ByteIntervals.get<by_address>();
264 return boost::make_iterator_range(Index.end(), Index.end());
266 return boost::make_iterator_range(
277 auto Pair = ByteIntervals.get<by_address>().equal_range(A);
278 return boost::make_iterator_range(
291 auto& Index = ByteIntervals.get<by_address>();
293 return boost::make_iterator_range(Index.end(), Index.end());
295 return boost::make_iterator_range(
311 return Extent->lower();
327 return Extent->size();
352 template <
typename... Args>
355 [[maybe_unused]]
ChangeStatus status = addByteInterval(BI);
360 "unexpected result when inserting ByteInterval");
365 void setName(
const std::string& N);
372 MergeSortedIterator<ByteInterval::block_iterator, BlockAddressLess>;
383 ByteInterval::block_subrange::iterator, BlockAddressLess>>;
389 MergeSortedIterator<ByteInterval::const_block_iterator, BlockAddressLess>;
401 ByteInterval::const_block_subrange::iterator, BlockAddressLess>>;
406 boost::make_transform_iterator(this->byte_intervals_begin(),
407 NodeToBlockRange<ByteInterval>()),
408 boost::make_transform_iterator(this->byte_intervals_end(),
409 NodeToBlockRange<ByteInterval>()));
417 return boost::make_iterator_range(blocks_begin(), blocks_end());
423 boost::make_transform_iterator(this->byte_intervals_begin(),
424 NodeToBlockRange<const ByteInterval>()),
425 boost::make_transform_iterator(this->byte_intervals_end(),
426 NodeToBlockRange<const ByteInterval>()));
434 return boost::make_iterator_range(blocks_begin(), blocks_end());
447 block_subrange::iterator(
448 boost::make_transform_iterator(Intervals.begin(),
449 FindBlocksIn<ByteInterval>(A)),
450 boost::make_transform_iterator(Intervals.end(),
451 FindBlocksIn<ByteInterval>(A))),
452 block_subrange::iterator());
465 const_block_subrange::iterator(
466 boost::make_transform_iterator(Intervals.begin(),
467 FindBlocksIn<const ByteInterval>(A)),
468 boost::make_transform_iterator(
469 Intervals.end(), FindBlocksIn<const ByteInterval>(A))),
470 const_block_subrange::iterator());
482 block_range::iterator(
483 boost::make_transform_iterator(Intervals.begin(),
484 FindBlocksAt<ByteInterval>(A)),
485 boost::make_transform_iterator(Intervals.end(),
486 FindBlocksAt<ByteInterval>(A))),
487 block_range::iterator());
498 std::vector<ByteInterval::block_range> Ranges;
500 Ranges.push_back(BI.findBlocksAt(Low, High));
501 for (
ByteInterval& BI : findByteIntervalsAt(Low + 1, High))
502 Ranges.push_back(BI.findBlocksAt(Low, High));
515 const_block_range::iterator(
516 boost::make_transform_iterator(Intervals.begin(),
517 FindBlocksAt<const ByteInterval>(A)),
518 boost::make_transform_iterator(
519 Intervals.end(), FindBlocksAt<const ByteInterval>(A))),
520 const_block_range::iterator());
531 std::vector<ByteInterval::const_block_range> Ranges;
533 Ranges.push_back(BI.findBlocksAt(Low, High));
534 for (
const ByteInterval& BI : findByteIntervalsAt(Low + 1, High))
535 Ranges.push_back(BI.findBlocksAt(Low, High));
544 using code_block_iterator =
545 MergeSortedIterator<ByteInterval::code_block_iterator, AddressLess>;
557 ByteInterval::code_block_subrange::iterator, AddressLess>>;
563 MergeSortedIterator<ByteInterval::const_code_block_iterator, AddressLess>;
569 boost::iterator_range<const_code_block_iterator>;
576 ByteInterval::const_code_block_subrange::iterator, AddressLess>>;
580 ByteIntervalSet::iterator End) {
581 NodeToCodeBlockRange<ByteInterval> Transformer;
582 return boost::make_iterator_range(
585 boost::make_transform_iterator(
594 boost::make_transform_iterator(this->byte_intervals_begin(),
595 NodeToCodeBlockRange<ByteInterval>()),
596 boost::make_transform_iterator(this->byte_intervals_end(),
597 NodeToCodeBlockRange<ByteInterval>()));
606 return boost::make_iterator_range(code_blocks_begin(), code_blocks_end());
612 boost::make_transform_iterator(
613 this->byte_intervals_begin(),
614 NodeToCodeBlockRange<const ByteInterval>()),
615 boost::make_transform_iterator(
616 this->byte_intervals_end(),
617 NodeToCodeBlockRange<const ByteInterval>()));
628 return boost::make_iterator_range(code_blocks_begin(), code_blocks_end());
640 code_block_subrange::iterator(
641 boost::make_transform_iterator(Intervals.begin(),
642 FindCodeBlocksIn<ByteInterval>(A)),
643 boost::make_transform_iterator(Intervals.end(),
644 FindCodeBlocksIn<ByteInterval>(A))),
645 code_block_subrange::iterator());
657 const_code_block_subrange::iterator(
658 boost::make_transform_iterator(
659 Intervals.begin(), FindCodeBlocksIn<const ByteInterval>(A)),
660 boost::make_transform_iterator(
661 Intervals.end(), FindCodeBlocksIn<const ByteInterval>(A))),
662 const_code_block_subrange::iterator());
673 code_block_range::iterator(
674 boost::make_transform_iterator(Intervals.begin(),
675 FindCodeBlocksAt<ByteInterval>(A)),
676 boost::make_transform_iterator(Intervals.end(),
677 FindCodeBlocksAt<ByteInterval>(A))),
678 code_block_range::iterator());
688 std::vector<ByteInterval::code_block_range> Ranges;
690 Ranges.push_back(BI.findCodeBlocksAt(Low, High));
691 for (
ByteInterval& BI : findByteIntervalsAt(Low + 1, High))
692 Ranges.push_back(BI.findCodeBlocksAt(Low, High));
704 const_code_block_range::iterator(
705 boost::make_transform_iterator(
706 Intervals.begin(), FindCodeBlocksAt<const ByteInterval>(A)),
707 boost::make_transform_iterator(
708 Intervals.end(), FindCodeBlocksAt<const ByteInterval>(A))),
709 const_code_block_range::iterator());
719 std::vector<ByteInterval::const_code_block_range> Ranges;
721 Ranges.push_back(BI.findCodeBlocksAt(Low, High));
722 for (
const ByteInterval& BI : findByteIntervalsAt(Low + 1, High))
723 Ranges.push_back(BI.findCodeBlocksAt(Low, High));
732 using data_block_iterator =
733 MergeSortedIterator<ByteInterval::data_block_iterator, AddressLess>;
745 ByteInterval::data_block_subrange::iterator, AddressLess>>;
751 MergeSortedIterator<ByteInterval::const_data_block_iterator, AddressLess>;
757 boost::iterator_range<const_data_block_iterator>;
764 ByteInterval::const_data_block_subrange::iterator, AddressLess>>;
769 boost::make_transform_iterator(this->byte_intervals_begin(),
770 NodeToDataBlockRange<ByteInterval>()),
771 boost::make_transform_iterator(this->byte_intervals_end(),
772 NodeToDataBlockRange<ByteInterval>()));
781 return boost::make_iterator_range(data_blocks_begin(), data_blocks_end());
787 boost::make_transform_iterator(
788 this->byte_intervals_begin(),
789 NodeToDataBlockRange<const ByteInterval>()),
790 boost::make_transform_iterator(
791 this->byte_intervals_end(),
792 NodeToDataBlockRange<const ByteInterval>()));
803 return boost::make_iterator_range(data_blocks_begin(), data_blocks_end());
815 data_block_subrange::iterator(
816 boost::make_transform_iterator(Intervals.begin(),
817 FindDataBlocksIn<ByteInterval>(A)),
818 boost::make_transform_iterator(Intervals.end(),
819 FindDataBlocksIn<ByteInterval>(A))),
820 data_block_subrange::iterator());
832 const_data_block_subrange::iterator(
833 boost::make_transform_iterator(
834 Intervals.begin(), FindDataBlocksIn<const ByteInterval>(A)),
835 boost::make_transform_iterator(
836 Intervals.end(), FindDataBlocksIn<const ByteInterval>(A))),
837 const_data_block_subrange::iterator());
848 data_block_range::iterator(
849 boost::make_transform_iterator(Intervals.begin(),
850 FindDataBlocksAt<ByteInterval>(A)),
851 boost::make_transform_iterator(Intervals.end(),
852 FindDataBlocksAt<ByteInterval>(A))),
853 data_block_range::iterator());
863 std::vector<ByteInterval::data_block_range> Ranges;
865 Ranges.push_back(BI.findDataBlocksAt(Low, High));
866 for (
ByteInterval& BI : findByteIntervalsAt(Low + 1, High))
867 Ranges.push_back(BI.findDataBlocksAt(Low, High));
879 const_data_block_range::iterator(
880 boost::make_transform_iterator(
881 Intervals.begin(), FindDataBlocksAt<const ByteInterval>(A)),
882 boost::make_transform_iterator(
883 Intervals.end(), FindDataBlocksAt<const ByteInterval>(A))),
884 const_data_block_range::iterator());
894 std::vector<ByteInterval::const_data_block_range> Ranges;
896 Ranges.push_back(BI.findDataBlocksAt(Low, High));
897 for (
const ByteInterval& BI : findByteIntervalsAt(Low + 1, High))
898 Ranges.push_back(BI.findDataBlocksAt(Low, High));
906 using symbolic_expression_iterator =
913 boost::iterator_range<symbolic_expression_iterator>;
924 boost::iterator_range<const_symbolic_expression_iterator>;
929 boost::make_transform_iterator(
930 this->byte_intervals_begin(),
931 NodeToSymbolicExpressionRange<ByteInterval>()),
932 boost::make_transform_iterator(
933 this->byte_intervals_end(),
934 NodeToSymbolicExpressionRange<ByteInterval>()));
945 return boost::make_iterator_range(symbolic_expressions_begin(),
946 symbolic_expressions_end());
952 boost::make_transform_iterator(
953 this->byte_intervals_begin(),
954 NodeToSymbolicExpressionRange<const ByteInterval>()),
955 boost::make_transform_iterator(
956 this->byte_intervals_end(),
957 NodeToSymbolicExpressionRange<const ByteInterval>()));
968 return boost::make_iterator_range(symbolic_expressions_begin(),
969 symbolic_expressions_end());
980 symbolic_expression_range::iterator(
981 boost::make_transform_iterator(this->byte_intervals_begin(),
982 FindSymExprsAt<ByteInterval>(A)),
983 boost::make_transform_iterator(this->byte_intervals_end(),
984 FindSymExprsAt<ByteInterval>(A))),
985 symbolic_expression_range::iterator());
998 symbolic_expression_range::iterator(
999 boost::make_transform_iterator(
1000 this->byte_intervals_begin(),
1001 FindSymExprsBetween<ByteInterval>(Low, High)),
1002 boost::make_transform_iterator(
1003 this->byte_intervals_end(),
1004 FindSymExprsBetween<ByteInterval>(Low, High))),
1005 symbolic_expression_range::iterator());
1016 const_symbolic_expression_range::iterator(
1017 boost::make_transform_iterator(
1018 this->byte_intervals_begin(),
1019 FindSymExprsAt<const ByteInterval>(A)),
1020 boost::make_transform_iterator(
1021 this->byte_intervals_end(),
1022 FindSymExprsAt<const ByteInterval>(A))),
1023 const_symbolic_expression_range::iterator());
1037 const_symbolic_expression_range::iterator(
1038 boost::make_transform_iterator(
1039 this->byte_intervals_begin(),
1040 FindSymExprsBetween<const ByteInterval>(Low, High)),
1041 boost::make_transform_iterator(
1042 this->byte_intervals_end(),
1043 FindSymExprsBetween<const ByteInterval>(Low, High))),
1044 const_symbolic_expression_range::iterator());
1048 static bool classof(
const Node* N) {
return N->getKind() == Kind::Section; }
1052 Module* Parent{
nullptr};
1053 SectionObserver* Observer{
nullptr};
1055 ByteIntervalSet ByteIntervals;
1056 ByteIntervalIntMap ByteIntervalAddrs;
1057 std::optional<AddrRange> Extent;
1058 std::set<SectionFlag> Flags;
1060 std::unique_ptr<ByteIntervalObserver> BIO;
1063 void removeByteIntervalAddrs(ByteInterval* BI);
1069 void insertByteIntervalAddrs(ByteInterval* BI);
1074 void setParent(Module* M, SectionObserver* O) {
1080 using MessageType = proto::Section;
1087 void toProtobuf(MessageType* Message)
const;
1095 static ErrorOr<Section*> fromProtobuf(Context& C,
const MessageType& Message);
1098 void save(std::ostream& Out)
const;
1101 static Section* load(Context& C, std::istream& In);
1106 template <
typename T>
friend typename T::MessageType toProtobuf(
const T&);
1107 friend class SerializationTestHarness;
1129 const std::string& NewName) = 0;
1207 std::function<
void(
Section*)> Callback) = 0;
1212 std::string OldName = X;
1213 std::swap(Name, OldName);
1219 "recovering from rejected name change is unimplemented");
1226 #endif // GTIRB_SECTION_H
boost::iterator_range< const_byte_interval_iterator > const_byte_interval_range
Const range of ByteInterval objects.
Definition: Section.hpp:177
const_symbolic_expression_range symbolic_expressions() const
Return a range of all the SymbolicExpression objects.
Definition: Section.hpp:967
static ByteInterval * Create(Context &C)
Create an unitialized ByteInterval object.
Definition: ByteInterval.hpp:262
const std::string & getName() const
Get the name of a Section.
Definition: Section.hpp:122
boost::iterator_range< code_block_iterator > code_block_range
Range of CodeBlock objects.
Definition: Section.hpp:550
symbolic_expression_range findSymbolicExpressionsAt(Addr A)
Find all the symbolic expressions that start at an address.
Definition: Section.hpp:978
NodeTy * Create(Args &&... TheArgs)
Create an object of type T.
Definition: Context.hpp:126
code_block_range findCodeBlocksAt(Addr Low, Addr High)
Find all the code blocks that start between a range of addresses.
Definition: Section.hpp:687
boost::iterator_range< MergeSortedIterator< ByteInterval::const_data_block_subrange::iterator, AddressLess > > const_data_block_subrange
Sub-range of DataBlock objects overlapping an address or range of addreses.
Definition: Section.hpp:764
const_data_block_range findDataBlocksAt(Addr A) const
Find all the data blocks that start at an address.
Definition: Section.hpp:876
Represents the base of the Node class hierarchy.
Definition: Node.hpp:39
code_block_range findCodeBlocksAt(Addr A)
Find all the code blocks that start at an address.
Definition: Section.hpp:670
byte_interval_iterator byte_intervals_end()
Return an iterator to the element following the last ByteInterval.
Definition: Section.hpp:193
const_byte_interval_range findByteIntervalsAt(Addr A) const
Find all the intervals that start at an address.
Definition: Section.hpp:276
const_code_block_range findCodeBlocksAt(Addr Low, Addr High) const
Find all the code blocks that start between a range of addresses.
Definition: Section.hpp:718
boost::iterator_range< MergeSortedIterator< ByteInterval::block_subrange::iterator, BlockAddressLess > > block_subrange
Sub-range of blocks overlapping an address or range of addreses.
Definition: Section.hpp:383
virtual ChangeStatus nameChange(Section *S, const std::string &OldName, const std::string &NewName)=0
Notify the parent when this Section's name changes.
const_block_iterator blocks_begin() const
Return an iterator to the first block.
Definition: Section.hpp:421
block_iterator blocks_end()
Return an iterator to the element following the last block.
Definition: Section.hpp:413
boost::uuids::uuid UUID
Represents a universally unique identifier used to identify Node objects across serialization boundar...
Definition: Context.hpp:36
symbolic_expression_iterator symbolic_expressions_begin()
Return an iterator to the first SymbolicExpression.
Definition: Section.hpp:927
A special class to store an Effective Address.
Definition: Addr.hpp:37
symbolic_expression_range findSymbolicExpressionsAt(Addr Low, Addr High)
Find all the symbolic expressions that start between a range of addresses.
Definition: Section.hpp:996
symbolic_expression_range symbolic_expressions()
Return a range of all the SymbolicExpression objects.
Definition: Section.hpp:944
byte_interval_range findByteIntervalsAt(Addr A)
Find all the intervals that start at an address.
Definition: Section.hpp:248
cfg_node_cast_iter< const CodeBlock > const_block_iterator
Constant iterator over blocks (Block).
Definition: CFG.hpp:198
block_range blocks()
Return a range of all the blocks.
Definition: Section.hpp:416
const_symbolic_expression_range findSymbolicExpressionsAt(Addr A) const
Find all the symbolic expressions that start at an address.
Definition: Section.hpp:1014
const_section_flag_range flags() const
Return a range of the SectionFlag flags set for the Section.
Definition: Section.hpp:159
Module * getModule()
Get the Module this section belongs to.
Definition: Section.hpp:115
void setName(const std::string &N)
Set this section's name.
Definition: Section.hpp:1210
The context under which GTIRB operations occur.
Definition: Context.hpp:63
block_range findBlocksAt(Addr A)
Find all the blocks that start at an address.
Definition: Section.hpp:479
code_block_range code_blocks()
Return a range of all the CodeBlock objects.
Definition: Section.hpp:605
void addFlag(SectionFlag F)
Adds the flag to the Section.
Definition: Section.hpp:127
const_byte_interval_iterator byte_intervals_begin() const
Return a const iterator to the first ByteInterval.
Definition: Section.hpp:188
MergeSortedIterator< ByteInterval::code_block_iterator, AddressLess > code_block_iterator
Iterator over CodeBlock objects.
Definition: Section.hpp:545
MergeSortedIterator< ByteInterval::const_symbolic_expression_iterator, ByteInterval::ConstSymbolicExpressionElement::AddressLess > const_symbolic_expression_iterator
Iterator over SymbolicExpressionElement objects.
Definition: Section.hpp:919
static Section * Create(Context &C, const std::string &Name)
Create a Section object.
Definition: Section.hpp:104
const_data_block_iterator data_blocks_begin() const
Return an iterator to the first DataBlock.
Definition: Section.hpp:785
block_subrange findBlocksOn(Addr A)
Find all the blocks that have bytes that lie within the address specified.
Definition: Section.hpp:444
const_code_block_subrange findCodeBlocksOn(Addr A) const
Find all the code blocks that have bytes that lie within the address specified.
Definition: Section.hpp:654
std::enable_if_t< std::is_error_code_enum< E >::value||std::is_error_condition_enum< E >::value, bool > operator==(const ErrorOr< T > &Err, E Code)
Definition: ErrorOr.hpp:277
Represents a named section of the binary.
Definition: Section.hpp:66
const_block_range findBlocksAt(Addr Low, Addr High) const
Find all the blocks that start between a range of addresses.
Definition: Section.hpp:530
boost::iterator_range< MergeSortedIterator< ByteInterval::const_code_block_subrange::iterator, AddressLess > > const_code_block_subrange
Sub-range of CodeBlock objects overlapping an address or range of addreses.
Definition: Section.hpp:576
boost::indirect_iterator< ByteIntervalSet::const_iterator, const ByteInterval > const_byte_interval_iterator
Const iterator over ByteInterval objects.
Definition: Section.hpp:174
MergeSortedIterator< ByteInterval::const_data_block_iterator, AddressLess > const_data_block_iterator
Iterator over DataBlock objects.
Definition: Section.hpp:751
#define GTIRB_EXPORT_API
This macro controls the visibility of exported symbols (i.e. classes) in shared libraries....
Definition: Export.hpp:52
const_block_range findBlocksAt(Addr A) const
Find all the blocks that start at an address.
Definition: Section.hpp:512
block_range findBlocksAt(Addr Low, Addr High)
Find all the blocks that start between a range of addresses.
Definition: Section.hpp:497
const_symbolic_expression_iterator symbolic_expressions_begin() const
Return an iterator to the first SymbolicExpression.
Definition: Section.hpp:950
Main namespace for the GTIRB API.
Definition: Addr.hpp:28
const_code_block_range findCodeBlocksAt(Addr A) const
Find all the code blocks that start at an address.
Definition: Section.hpp:701
std::set< SectionFlag >::const_iterator const_section_flag_iterator
Iterator over SectionFlag flags.
Definition: Section.hpp:148
const_data_block_subrange findDataBlocksOn(Addr A) const
Find all the data blocks that have bytes that lie within the address specified.
Definition: Section.hpp:829
symbolic_expression_iterator symbolic_expressions_end()
Return an iterator to the element following the last SymbolicExpression.
Definition: Section.hpp:939
boost::iterator_range< symbolic_expression_iterator > symbolic_expression_range
Range of SymbolicExpressionElement objects.
Definition: Section.hpp:913
const_data_block_range data_blocks() const
Return a range of all the DataBlock objects.
Definition: Section.hpp:802
cfg_node_cast_iter< CodeBlock > block_iterator
Iterator over blocks (Block).
Definition: CFG.hpp:194
SectionFlag
Idenfities the flags used for a section.
Definition: Section.hpp:50
Class gtirb::ByteInterval.
MergeSortedIterator< ByteInterval::const_block_iterator, BlockAddressLess > const_block_iterator
Const iterator over blocks.
Definition: Section.hpp:389
const_byte_interval_range findByteIntervalsAt(Addr Low, Addr High) const
Find all the intervals that start between a range of addresses.
Definition: Section.hpp:290
boost::iterator_range< const_section_flag_iterator > const_section_flag_range
Range of SectionFlag flags.
Definition: Section.hpp:151
MergeSortedIterator< ByteInterval::data_block_iterator, AddressLess > data_block_iterator
Iterator over DataBlock objects.
Definition: Section.hpp:733
data_block_iterator data_blocks_end()
Return an iterator to the element following the last DataBlock.
Definition: Section.hpp:777
const_byte_interval_iterator byte_intervals_end() const
Return a const iterator to the element following the last ByteInterval.
Definition: Section.hpp:196
boost::iterator_range< const_data_block_iterator > const_data_block_range
Range of DataBlock objects.
Definition: Section.hpp:757
A comparison function object to order symbolic expression elements by the address in which they occur...
Definition: ByteInterval.hpp:1138
const_block_subrange findBlocksOn(Addr A) const
Find all the blocks that have bytes that lie within the address specified.
Definition: Section.hpp:462
data_block_subrange findDataBlocksOn(Addr A)
Find all the data blocks that have bytes that lie within the address specified.
Definition: Section.hpp:812
const_code_block_iterator code_blocks_begin() const
Return an iterator to the first CodeBlock.
Definition: Section.hpp:610
code_block_iterator code_blocks_begin()
Return an iterator to the first CodeBlock.
Definition: Section.hpp:592
boost::iterator_range< MergeSortedIterator< ByteInterval::const_block_subrange::iterator, BlockAddressLess > > const_block_subrange
Const sub-range of blocks overlapping an address or range of addreses.
Definition: Section.hpp:401
const_symbolic_expression_iterator symbolic_expressions_end() const
Return an iterator to the element following the last SymbolicExpression.
Definition: Section.hpp:962
ByteInterval * addByteInterval(Context &C, Args &&... A)
Creates a new ByteInterval in this section.
Definition: Section.hpp:353
boost::iterator_range< boost::indirect_iterator< ByteIntervalIntMap::codomain_type::iterator > > byte_interval_subrange
Sub-range of ByteInterval objects overlapping addresses.
Definition: Section.hpp:170
boost::transform_iterator< SymExprPairToElement< SymbolicExpressionElement >, SymbolicExpressionMap::iterator > symbolic_expression_iterator
Iterator over SymbolicExpressionElement objects.
Definition: ByteInterval.hpp:1196
byte_interval_iterator byte_intervals_begin()
Return an iterator to the first ByteInterval.
Definition: Section.hpp:184
const_code_block_range code_blocks() const
Return a range of all the CodeBlock objects.
Definition: Section.hpp:627
std::optional< Addr > getAddress() const
Return the address of this section, if known.
Definition: Section.hpp:309
void removeFlag(SectionFlag F)
Removes the flag from the Section.
Definition: Section.hpp:137
boost::transform_iterator< SymExprPairToElement< ConstSymbolicExpressionElement >, SymbolicExpressionMap::const_iterator > const_symbolic_expression_iterator
Const iterator over SymbolicExpressionElement objects.
Definition: ByteInterval.hpp:1207
const_byte_interval_range byte_intervals() const
Return a const range of the ByteInterval objects in this section.
Definition: Section.hpp:206
const Module * getModule() const
Get the Module this section belongs to.
Definition: Section.hpp:117
boost::iterator_range< const_symbolic_expression_iterator > const_symbolic_expression_range
Range of SymbolicExpressionElement objects.
Definition: Section.hpp:924
const_symbolic_expression_range findSymbolicExpressionsAt(Addr Low, Addr High) const
Find all the symbolic expressions that start between a range of addresses.
Definition: Section.hpp:1034
boost::iterator_range< byte_interval_iterator > byte_interval_range
Range of ByteInterval objects.
Definition: Section.hpp:167
const_data_block_iterator data_blocks_end() const
Return an iterator to the element following the last DataBlock.
Definition: Section.hpp:797
data_block_iterator data_blocks_begin()
Return an iterator to the first DataBlock.
Definition: Section.hpp:767
code_block_subrange findCodeBlocksOn(Addr A)
Find all the code blocks that have bytes that lie within the address specified.
Definition: Section.hpp:637
data_block_range findDataBlocksAt(Addr A)
Find all the data blocks that start at an address.
Definition: Section.hpp:845
const_byte_interval_subrange findByteIntervalsOn(Addr A) const
Find all the intervals that have bytes that lie within the address specified.
Definition: Section.hpp:234
static Section * Create(Context &C)
Create an unitialized Section object.
Definition: Section.hpp:96
const_block_iterator blocks_end() const
Return an iterator to the element following the last block.
Definition: Section.hpp:430
MergeSortedIterator< ByteInterval::block_iterator, BlockAddressLess > block_iterator
Iterator over blocks.
Definition: Section.hpp:372
bool isFlagSet(SectionFlag F) const
Tests whether the given flag is set for the Section.
Definition: Section.hpp:143
const_data_block_range findDataBlocksAt(Addr Low, Addr High) const
Find all the data blocks that start between a range of addresses.
Definition: Section.hpp:893
MergeSortedIterator< ByteInterval::const_code_block_iterator, AddressLess > const_code_block_iterator
Iterator over CodeBlock objects.
Definition: Section.hpp:563
Represents a single binary (library or executable).
Definition: Module.hpp:107
data_block_range findDataBlocksAt(Addr Low, Addr High)
Find all the data blocks that start between a range of addresses.
Definition: Section.hpp:862
const_section_flag_iterator flags_end() const
Return a const iterator to the element following the last SectionFlag.
Definition: Section.hpp:157
boost::iterator_range< MergeSortedIterator< ByteInterval::code_block_subrange::iterator, AddressLess > > code_block_subrange
Sub-range of CodeBlock objects overlapping an address or range of addreses.
Definition: Section.hpp:557
boost::iterator_range< const_code_block_iterator > const_code_block_range
Range of CodeBlock objects.
Definition: Section.hpp:569
const_section_flag_iterator flags_begin() const
Return a const iterator to the first SectionFlag.
Definition: Section.hpp:154
Interface for notifying observers when the Section is modified.
Definition: Section.hpp:1115
const_code_block_iterator code_blocks_end() const
Return an iterator to the element following the last CodeBlock.
Definition: Section.hpp:622
A contiguous region of bytes in a binary.
Definition: ByteInterval.hpp:124
data_block_range data_blocks()
Return a range of all the DataBlock objects.
Definition: Section.hpp:780
std::optional< uint64_t > getSize() const
Return the size of this section, if known.
Definition: Section.hpp:325
boost::iterator_range< boost::indirect_iterator< ByteIntervalIntMap::codomain_type::const_iterator > > const_byte_interval_subrange
Const sub-range of ByteInterval objects overlapping addresses.
Definition: Section.hpp:181
Class gtirb::Addr and related functions.
byte_interval_subrange findByteIntervalsOn(Addr A)
Find all the intervals that have bytes that lie within the address specified.
Definition: Section.hpp:218
byte_interval_range byte_intervals()
Return a range of the ByteInterval objects in this section.
Definition: Section.hpp:200
boost::iterator_range< MergeSortedIterator< ByteInterval::data_block_subrange::iterator, AddressLess > > data_block_subrange
Sub-range of DataBlock objects overlapping an address or range of addreses.
Definition: Section.hpp:745
byte_interval_range findByteIntervalsAt(Addr Low, Addr High)
Find all the intervals that start between a range of addresses.
Definition: Section.hpp:261
ChangeStatus
Definition: Observer.hpp:19
const_block_range blocks() const
Return a range of all the blocks.
Definition: Section.hpp:433
void addFlags(Fs... F)
Adds all of the flags to the Section.
Definition: Section.hpp:132
boost::indirect_iterator< ByteIntervalSet::iterator > byte_interval_iterator
Iterator over ByteInterval objects.
Definition: Section.hpp:165
MergeSortedIterator< ByteInterval::symbolic_expression_iterator, ByteInterval::SymbolicExpressionElement::AddressLess > symbolic_expression_iterator
Iterator over SymbolicExpressionElement objects.
Definition: Section.hpp:908
block_iterator blocks_begin()
Return an iterator to the first block.
Definition: Section.hpp:404
boost::iterator_range< const_block_iterator > const_block_range
Const range of blocks.
Definition: Section.hpp:394
code_block_iterator code_blocks_end()
Return an iterator to the element following the last CodeBlock.
Definition: Section.hpp:602
boost::iterator_range< block_iterator > block_range
Range of blocks.
Definition: Section.hpp:377
boost::iterator_range< data_block_iterator > data_block_range
Range of DataBlock objects.
Definition: Section.hpp:738