GTIRB
v2.2.0
GrammaTech Intermediate Representation for Binaries: C++ API
|
Go to the documentation of this file.
15 #ifndef GTIRB_MODULE_H
16 #define GTIRB_MODULE_H
28 #include <gtirb/proto/Module.pb.h>
30 #include <boost/icl/interval_map.hpp>
31 #include <boost/iterator/indirect_iterator.hpp>
32 #include <boost/iterator/iterator_traits.hpp>
33 #include <boost/iterator/transform_iterator.hpp>
34 #include <boost/multi_index/hashed_index.hpp>
35 #include <boost/multi_index/key_extractors.hpp>
36 #include <boost/multi_index/mem_fun.hpp>
37 #include <boost/multi_index/ordered_index.hpp>
38 #include <boost/multi_index_container.hpp>
39 #include <boost/range/iterator_range.hpp>
53 template <
class T>
class ErrorOr;
75 enum class ISA : uint8_t {
99 Big = proto::BigEndian,
101 Little = proto::LittleEndian,
108 struct by_address {};
110 struct by_pointer {};
111 struct by_referent {};
114 static const Node* get_symbol_referent(
const Symbol&
S) {
115 if (std::optional<const Node*> Res =
116 S.visit([](
const Node* N) { return N; })) {
122 using ProxyBlockSet = std::unordered_set<ProxyBlock*>;
124 using SectionSet = boost::multi_index::multi_index_container<
125 Section*, boost::multi_index::indexed_by<
126 boost::multi_index::ordered_non_unique<
127 boost::multi_index::tag<by_address>,
128 boost::multi_index::identity<Section*>, AddressLess>,
129 boost::multi_index::ordered_non_unique<
130 boost::multi_index::tag<by_name>,
131 boost::multi_index::const_mem_fun<
133 boost::multi_index::hashed_unique<
134 boost::multi_index::tag<by_pointer>,
135 boost::multi_index::identity<Section*>>>>;
136 using SectionIntMap =
137 boost::icl::interval_map<Addr, std::set<Section*, AddressLess>>;
139 using SymbolSet = boost::multi_index::multi_index_container<
141 boost::multi_index::indexed_by<
142 boost::multi_index::ordered_non_unique<
143 boost::multi_index::tag<by_address>,
144 boost::multi_index::const_mem_fun<Symbol, std::optional<Addr>,
146 boost::multi_index::ordered_non_unique<
147 boost::multi_index::tag<by_name>,
148 boost::multi_index::const_mem_fun<
Symbol,
const std::string&,
150 boost::multi_index::hashed_unique<
151 boost::multi_index::tag<by_pointer>,
152 boost::multi_index::identity<Symbol*>>,
153 boost::multi_index::hashed_non_unique<
154 boost::multi_index::tag<by_referent>,
155 boost::multi_index::global_fun<
const Symbol&,
const Node*,
156 &get_symbol_referent>>>>;
158 class SectionObserverImpl;
159 class SymbolObserverImpl;
283 using proxy_block_iterator =
284 boost::indirect_iterator<ProxyBlockSet::iterator>;
289 boost::indirect_iterator<ProxyBlockSet::const_iterator, const ProxyBlock>;
292 boost::iterator_range<const_proxy_block_iterator>;
313 return boost::make_iterator_range(proxy_blocks_begin(), proxy_blocks_end());
317 return boost::make_iterator_range(proxy_blocks_begin(), proxy_blocks_end());
346 template <
typename... Args>
349 [[maybe_unused]]
ChangeStatus status = addProxyBlock(PB);
354 "unexpected result when inserting ProxyBlock");
367 using symbol_iterator =
368 boost::indirect_iterator<SymbolSet::index<by_pointer>::type::iterator>;
377 SymbolSet::index<by_pointer>::type::const_iterator,
const Symbol>;
388 boost::indirect_iterator<SymbolSet::index<by_name>::type::iterator>;
399 boost::indirect_iterator<SymbolSet::index<by_name>::type::const_iterator,
406 boost::iterator_range<const_symbol_name_iterator>;
413 boost::indirect_iterator<SymbolSet::index<by_address>::type::iterator>;
424 SymbolSet::index<by_address>::type::const_iterator,
const Symbol>;
430 boost::iterator_range<const_symbol_addr_iterator>;
436 boost::indirect_iterator<SymbolSet::index<by_referent>::type::iterator>;
445 SymbolSet::index<by_referent>::type::const_iterator,
const Symbol>;
450 boost::iterator_range<const_symbol_ref_iterator>;
471 return boost::make_iterator_range(symbols_begin(), symbols_end());
475 return boost::make_iterator_range(symbols_begin(), symbols_end());
498 return boost::make_iterator_range(symbols_by_name_begin(),
499 symbols_by_name_end());
504 return boost::make_iterator_range(symbols_by_name_begin(),
505 symbols_by_name_end());
528 return boost::make_iterator_range(symbols_by_addr_begin(),
529 symbols_by_addr_end());
534 return boost::make_iterator_range(symbols_by_addr_begin(),
535 symbols_by_addr_end());
546 auto& Index = Symbols.get<by_pointer>();
547 if (
auto Iter = Index.find(
S); Iter != Index.end()) {
549 S->setParent(
nullptr,
nullptr);
559 if (
S->getModule()) {
560 S->getModule()->removeSymbol(
S);
563 S->setParent(
this, SymObs.get());
583 auto Found = Symbols.get<by_name>().equal_range(N);
584 return boost::make_iterator_range(Found.first, Found.second);
594 auto Found = Symbols.get<by_name>().equal_range(N);
595 return boost::make_iterator_range(Found.first, Found.second);
605 auto Found = Symbols.get<by_address>().equal_range(X);
606 return boost::make_iterator_range(Found.first, Found.second);
616 auto Found = Symbols.get<by_address>().equal_range(X);
617 return boost::make_iterator_range(Found.first, Found.second);
628 auto& Index = Symbols.get<by_address>();
629 return boost::make_iterator_range(Index.lower_bound(Lower),
630 Index.lower_bound(Upper));
641 auto& Index = Symbols.get<by_address>();
642 return boost::make_iterator_range(Index.lower_bound(Lower),
643 Index.lower_bound(Upper));
653 return Symbols.get<by_referent>().equal_range(&Referent);
663 return Symbols.get<by_referent>().equal_range(&Referent);
672 const std::string&
getName()
const {
return Name; }
675 void setName(
const std::string& X);
686 boost::indirect_iterator<SectionIntMap::codomain_type::iterator>>;
692 boost::indirect_iterator<SectionSet::index<by_name>::type::iterator>;
704 boost::indirect_iterator<SectionSet::const_iterator, const Section&>;
713 SectionIntMap::codomain_type::const_iterator,
const Section&>>;
719 boost::indirect_iterator<SectionSet::index<by_name>::type::const_iterator,
726 boost::iterator_range<const_section_name_iterator>;
734 return Sections.get<by_name>().begin();
738 return Sections.get<by_name>().begin();
747 return Sections.get<by_name>().end();
752 return Sections.get<by_name>().end();
756 return boost::make_iterator_range(sections_begin(), sections_end());
760 return boost::make_iterator_range(sections_begin(), sections_end());
790 Section*
S = Section::Create(C, std::forward<Args>(A)...);
795 "unexpected result when inserting Section");
805 if (
auto It = SectionAddrs.find(X); It != SectionAddrs.end()) {
806 return boost::make_iterator_range(It->second.begin(), It->second.end());
817 if (
auto It = SectionAddrs.find(X); It != SectionAddrs.end()) {
818 return boost::make_iterator_range(It->second.begin(), It->second.end());
829 auto Pair = Sections.get<by_address>().equal_range(A);
841 auto& Index = Sections.get<by_address>();
842 return boost::make_iterator_range(
853 auto Pair = Sections.get<by_address>().equal_range(A);
865 auto& Index = Sections.get<by_address>();
866 return boost::make_iterator_range(
878 auto Pair = Sections.get<by_name>().equal_range(X);
889 auto Pair = Sections.get<by_name>().equal_range(X);
901 using byte_interval_iterator =
902 MergeSortedIterator<Section::byte_interval_iterator, AddressLess>;
907 Section::byte_interval_subrange::iterator, AddressLess>>;
910 MergeSortedIterator<Section::const_byte_interval_iterator, AddressLess>;
913 boost::iterator_range<const_byte_interval_iterator>;
916 boost::iterator_range<MergeSortedIterator<
917 Section::const_byte_interval_subrange::iterator, AddressLess>>;
922 boost::make_transform_iterator(this->sections_begin(),
923 NodeToByteIntervalRange<Section>()),
924 boost::make_transform_iterator(this->sections_end(),
925 NodeToByteIntervalRange<Section>()));
936 return boost::make_iterator_range(byte_intervals_begin(),
937 byte_intervals_end());
943 boost::make_transform_iterator(
944 this->sections_begin(), NodeToByteIntervalRange<const Section>()),
945 boost::make_transform_iterator(
946 this->sections_end(), NodeToByteIntervalRange<const Section>()));
957 return boost::make_iterator_range(byte_intervals_begin(),
958 byte_intervals_end());
970 byte_interval_subrange::iterator(
971 boost::make_transform_iterator(Range.begin(),
972 FindByteIntervalsIn<Section>(A)),
973 boost::make_transform_iterator(Range.end(),
974 FindByteIntervalsIn<Section>(A))),
975 byte_interval_subrange::iterator());
987 const_byte_interval_subrange::iterator(
988 boost::make_transform_iterator(
989 Range.begin(), FindByteIntervalsIn<const Section>(A)),
990 boost::make_transform_iterator(
991 Range.end(), FindByteIntervalsIn<const Section>(A))),
992 const_byte_interval_subrange::iterator());
1003 byte_interval_range::iterator(
1004 boost::make_transform_iterator(Range.begin(),
1005 FindByteIntervalsAt<Section>(A)),
1006 boost::make_transform_iterator(Range.end(),
1007 FindByteIntervalsAt<Section>(A))),
1008 byte_interval_range::iterator());
1019 std::vector<Section::byte_interval_range> Ranges;
1020 for (
Section&
S : findSectionsOn(Low))
1021 Ranges.push_back(
S.findByteIntervalsAt(Low, High));
1022 for (
Section&
S : findSectionsAt(Low + 1, High))
1023 Ranges.push_back(
S.findByteIntervalsAt(Low, High));
1036 const_byte_interval_range::iterator(
1037 boost::make_transform_iterator(
1038 Range.begin(), FindByteIntervalsAt<const Section>(A)),
1039 boost::make_transform_iterator(
1040 Range.end(), FindByteIntervalsAt<const Section>(A))),
1041 const_byte_interval_range::iterator());
1052 std::vector<Section::const_byte_interval_range> Ranges;
1053 for (
const Section&
S : findSectionsOn(Low))
1054 Ranges.push_back(
S.findByteIntervalsAt(Low, High));
1055 for (
const Section&
S : findSectionsAt(Low + 1, High))
1056 Ranges.push_back(
S.findByteIntervalsAt(Low, High));
1071 MergeSortedIterator<Section::block_iterator, BlockAddressLess>;
1082 MergeSortedIterator<Section::block_subrange::iterator, BlockAddressLess>>;
1088 MergeSortedIterator<Section::const_block_iterator, BlockAddressLess>;
1098 Section::const_block_subrange::iterator, BlockAddressLess>>;
1103 boost::make_transform_iterator(this->sections_begin(),
1104 NodeToBlockRange<Section>()),
1105 boost::make_transform_iterator(this->sections_end(),
1106 NodeToBlockRange<Section>()));
1114 return boost::make_iterator_range(blocks_begin(), blocks_end());
1120 boost::make_transform_iterator(this->sections_begin(),
1121 NodeToBlockRange<const Section>()),
1122 boost::make_transform_iterator(this->sections_end(),
1123 NodeToBlockRange<const Section>()));
1131 return boost::make_iterator_range(blocks_begin(), blocks_end());
1144 block_subrange::iterator(
1145 boost::make_transform_iterator(SectionRange.begin(),
1146 FindBlocksIn<Section>(A)),
1147 boost::make_transform_iterator(SectionRange.end(),
1148 FindBlocksIn<Section>(A))),
1149 block_subrange::iterator());
1162 const_block_subrange::iterator(
1163 boost::make_transform_iterator(SectionRange.begin(),
1164 FindBlocksIn<const Section>(A)),
1165 boost::make_transform_iterator(SectionRange.end(),
1166 FindBlocksIn<const Section>(A))),
1167 const_block_subrange::iterator());
1179 boost::make_transform_iterator(
1180 SectionRange.begin(), FindBlocksAt<Section>(A)),
1181 boost::make_transform_iterator(
1182 SectionRange.end(), FindBlocksAt<Section>(A))),
1183 block_range::iterator());
1194 std::vector<Section::block_range> Ranges;
1195 for (
Section&
S : findSectionsOn(Low))
1196 Ranges.push_back(
S.findBlocksAt(Low, High));
1197 for (
Section&
S : findSectionsAt(Low + 1, High))
1198 Ranges.push_back(
S.findBlocksAt(Low, High));
1211 const_block_range::iterator(
1212 boost::make_transform_iterator(SectionRange.begin(),
1213 FindBlocksAt<const Section>(A)),
1214 boost::make_transform_iterator(SectionRange.end(),
1215 FindBlocksAt<const Section>(A))),
1216 const_block_range::iterator());
1227 std::vector<Section::const_block_range> Ranges;
1228 for (
const Section&
S : findSectionsOn(Low))
1229 Ranges.push_back(
S.findBlocksAt(Low, High));
1230 for (
const Section&
S : findSectionsAt(Low + 1, High))
1231 Ranges.push_back(
S.findBlocksAt(Low, High));
1245 using code_block_iterator =
1246 MergeSortedIterator<Section::code_block_iterator, AddressLess>;
1258 MergeSortedIterator<Section::code_block_subrange::iterator, AddressLess>>;
1264 MergeSortedIterator<Section::const_code_block_iterator, AddressLess>;
1270 boost::iterator_range<const_code_block_iterator>;
1277 Section::const_code_block_subrange::iterator, AddressLess>>;
1281 SectionSet::iterator End) {
1282 NodeToCodeBlockRange<Section> Transformer;
1283 return boost::make_iterator_range(
1295 boost::make_transform_iterator(this->sections_begin(),
1296 NodeToCodeBlockRange<Section>()),
1297 boost::make_transform_iterator(this->sections_end(),
1298 NodeToCodeBlockRange<Section>()));
1307 return boost::make_iterator_range(code_blocks_begin(), code_blocks_end());
1313 boost::make_transform_iterator(this->sections_begin(),
1314 NodeToCodeBlockRange<const Section>()),
1315 boost::make_transform_iterator(this->sections_end(),
1316 NodeToCodeBlockRange<const Section>()));
1327 return boost::make_iterator_range(code_blocks_begin(), code_blocks_end());
1339 code_block_subrange::iterator(
1340 boost::make_transform_iterator(Range.begin(),
1341 FindCodeBlocksIn<Section>(A)),
1342 boost::make_transform_iterator(Range.end(),
1343 FindCodeBlocksIn<Section>(A))),
1344 code_block_subrange::iterator());
1356 const_code_block_subrange::iterator(
1357 boost::make_transform_iterator(Range.begin(),
1358 FindCodeBlocksIn<const Section>(A)),
1359 boost::make_transform_iterator(Range.end(),
1360 FindCodeBlocksIn<const Section>(A))),
1361 const_code_block_subrange::iterator());
1372 code_block_range::iterator(
1373 boost::make_transform_iterator(Range.begin(),
1374 FindCodeBlocksAt<Section>(A)),
1375 boost::make_transform_iterator(Range.end(),
1376 FindCodeBlocksAt<Section>(A))),
1377 code_block_range::iterator());
1387 std::vector<Section::code_block_range> Ranges;
1388 for (
Section&
S : findSectionsOn(Low))
1389 Ranges.push_back(
S.findCodeBlocksAt(Low, High));
1390 for (
Section&
S : findSectionsAt(Low + 1, High))
1391 Ranges.push_back(
S.findCodeBlocksAt(Low, High));
1403 const_code_block_range::iterator(
1404 boost::make_transform_iterator(Range.begin(),
1405 FindCodeBlocksAt<const Section>(A)),
1406 boost::make_transform_iterator(Range.end(),
1407 FindCodeBlocksAt<const Section>(A))),
1408 const_code_block_range::iterator());
1418 std::vector<Section::const_code_block_range> Ranges;
1419 for (
const Section&
S : findSectionsOn(Low))
1420 Ranges.push_back(
S.findCodeBlocksAt(Low, High));
1421 for (
const Section&
S : findSectionsAt(Low + 1, High))
1422 Ranges.push_back(
S.findCodeBlocksAt(Low, High));
1436 using data_block_iterator =
1437 MergeSortedIterator<Section::data_block_iterator, AddressLess>;
1449 MergeSortedIterator<Section::data_block_subrange::iterator, AddressLess>>;
1455 MergeSortedIterator<Section::const_data_block_iterator, AddressLess>;
1461 boost::iterator_range<const_data_block_iterator>;
1468 Section::const_data_block_subrange::iterator, AddressLess>>;
1473 boost::make_transform_iterator(this->sections_begin(),
1474 NodeToDataBlockRange<Section>()),
1475 boost::make_transform_iterator(this->sections_end(),
1476 NodeToDataBlockRange<Section>()));
1485 return boost::make_iterator_range(data_blocks_begin(), data_blocks_end());
1491 boost::make_transform_iterator(this->sections_begin(),
1492 NodeToDataBlockRange<const Section>()),
1493 boost::make_transform_iterator(this->sections_end(),
1494 NodeToDataBlockRange<const Section>()));
1505 return boost::make_iterator_range(data_blocks_begin(), data_blocks_end());
1517 data_block_subrange::iterator(
1518 boost::make_transform_iterator(Range.begin(),
1519 FindDataBlocksIn<Section>(A)),
1520 boost::make_transform_iterator(Range.end(),
1521 FindDataBlocksIn<Section>(A))),
1522 data_block_subrange::iterator());
1534 const_data_block_subrange::iterator(
1535 boost::make_transform_iterator(Range.begin(),
1536 FindDataBlocksIn<const Section>(A)),
1537 boost::make_transform_iterator(Range.end(),
1538 FindDataBlocksIn<const Section>(A))),
1539 const_data_block_subrange::iterator());
1550 data_block_range::iterator(
1551 boost::make_transform_iterator(Range.begin(),
1552 FindDataBlocksAt<Section>(A)),
1553 boost::make_transform_iterator(Range.end(),
1554 FindDataBlocksAt<Section>(A))),
1555 data_block_range::iterator());
1565 std::vector<Section::data_block_range> Ranges;
1566 for (
Section&
S : findSectionsOn(Low))
1567 Ranges.push_back(
S.findDataBlocksAt(Low, High));
1568 for (
Section&
S : findSectionsAt(Low + 1, High))
1569 Ranges.push_back(
S.findDataBlocksAt(Low, High));
1581 const_data_block_range::iterator(
1582 boost::make_transform_iterator(Range.begin(),
1583 FindDataBlocksAt<const Section>(A)),
1584 boost::make_transform_iterator(Range.end(),
1585 FindDataBlocksAt<const Section>(A))),
1586 const_data_block_range::iterator());
1596 std::vector<Section::const_data_block_range> Ranges;
1597 for (
const Section&
S : findSectionsOn(Low))
1598 Ranges.push_back(
S.findDataBlocksAt(Low, High));
1599 for (
const Section&
S : findSectionsAt(Low + 1, High))
1600 Ranges.push_back(
S.findDataBlocksAt(Low, High));
1613 using symbolic_expression_iterator =
1620 boost::iterator_range<symbolic_expression_iterator>;
1631 boost::iterator_range<const_symbolic_expression_iterator>;
1636 boost::make_transform_iterator(
1637 this->sections_begin(), NodeToSymbolicExpressionRange<Section>()),
1638 boost::make_transform_iterator(
1639 this->sections_end(), NodeToSymbolicExpressionRange<Section>()));
1650 return boost::make_iterator_range(symbolic_expressions_begin(),
1651 symbolic_expressions_end());
1657 boost::make_transform_iterator(
1658 this->sections_begin(),
1659 NodeToSymbolicExpressionRange<const Section>()),
1660 boost::make_transform_iterator(
1661 this->sections_end(),
1662 NodeToSymbolicExpressionRange<const Section>()));
1673 return boost::make_iterator_range(symbolic_expressions_begin(),
1674 symbolic_expressions_end());
1685 symbolic_expression_range::iterator(
1686 boost::make_transform_iterator(this->sections_begin(),
1687 FindSymExprsAt<Section>(A)),
1688 boost::make_transform_iterator(this->sections_end(),
1689 FindSymExprsAt<Section>(A))),
1690 symbolic_expression_range::iterator());
1703 symbolic_expression_range::iterator(
1704 boost::make_transform_iterator(
1705 this->sections_begin(),
1706 FindSymExprsBetween<Section>(Low, High)),
1707 boost::make_transform_iterator(
1708 this->sections_end(), FindSymExprsBetween<Section>(Low, High))),
1709 symbolic_expression_range::iterator());
1720 const_symbolic_expression_range::iterator(
1721 boost::make_transform_iterator(this->sections_begin(),
1722 FindSymExprsAt<const Section>(A)),
1723 boost::make_transform_iterator(this->sections_end(),
1724 FindSymExprsAt<const Section>(A))),
1725 const_symbolic_expression_range::iterator());
1739 const_symbolic_expression_range::iterator(
1740 boost::make_transform_iterator(
1741 this->sections_begin(),
1742 FindSymExprsBetween<const Section>(Low, High)),
1743 boost::make_transform_iterator(
1744 this->sections_end(),
1745 FindSymExprsBetween<const Section>(Low, High))),
1746 const_symbolic_expression_range::iterator());
1752 static bool classof(
const Node* N) {
return N->getKind() == Kind::Module; }
1757 using MessageType = proto::Module;
1760 void removeSectionAddrs(Section* S);
1766 void insertSectionAddrs(Section* S);
1773 void toProtobuf(MessageType* Message)
const;
1781 static ErrorOr<Module*> fromProtobuf(Context& C,
const MessageType& Message);
1784 void save(std::ostream& Out)
const;
1787 static Module* load(Context& C, std::istream& In);
1789 void setParent(IR* I, ModuleObserver* O) {
1794 IR* Parent{
nullptr};
1795 ModuleObserver* Observer{
nullptr};
1796 std::string BinaryPath;
1798 int64_t RebaseDelta{0};
1803 CodeBlock* EntryPoint{
nullptr};
1804 ProxyBlockSet ProxyBlocks;
1805 SectionSet Sections;
1806 SectionIntMap SectionAddrs;
1809 std::unique_ptr<SectionObserver> SecObs;
1810 std::unique_ptr<SymbolObserver> SymObs;
1815 template <
typename T>
friend typename T::MessageType toProtobuf(
const T&);
1816 friend class SerializationTestHarness;
1836 const std::string& NewName) = 0;
1877 std::string OldName = X;
1878 std::swap(Name, OldName);
1884 "recovering from rejected name change is unimplemented");
1891 #endif // GTIRB_MODULE_H
Section * addSection(Context &C, Args &&... A)
Creates a new Section in this module.
Definition: Module.hpp:789
const_byte_interval_range findByteIntervalsAt(Addr Low, Addr High) const
Find all the intervals that start between a range of addresses.
Definition: Module.hpp:1051
boost::indirect_iterator< SymbolSet::index< by_address >::type::const_iterator, const Symbol > const_symbol_addr_iterator
Constant iterator over symbols (Symbol).
Definition: Module.hpp:424
const std::string & getName() const
Get the module name.
Definition: Module.hpp:672
const std::string & getName() const
Get the name of a Section.
Definition: Section.hpp:122
gtirb::FileFormat getFileFormat() const
Get the format of the binary pointed to by getBinaryPath().
Definition: Module.hpp:207
const_proxy_block_iterator proxy_blocks_begin() const
Return a constant iterator to the first ProxyBlock.
Definition: Module.hpp:299
const_section_range sections() const
Return a constant range of the sections (Section).
Definition: Module.hpp:759
boost::indirect_iterator< SymbolSet::index< by_name >::type::const_iterator, const Symbol > const_symbol_name_iterator
Constant iterator over symbols (Symbol).
Definition: Module.hpp:400
const_block_iterator blocks_begin() const
Return an iterator to the first block.
Definition: Module.hpp:1118
A basic block.
Definition: CodeBlock.hpp:47
boost::indirect_iterator< ProxyBlockSet::const_iterator, const ProxyBlock > const_proxy_block_iterator
Constant iterator over proxy_blocks (ProxyBlock).
Definition: Module.hpp:289
NodeTy * Create(Args &&... TheArgs)
Create an object of type T.
Definition: Context.hpp:126
code_block_iterator code_blocks_begin()
Return an iterator to the first CodeBlock.
Definition: Module.hpp:1293
const_symbol_ref_range findSymbols(const Node &Referent) const
Find symbols by their referent object.
Definition: Module.hpp:662
Symbol * addSymbol(Symbol *S)
Move a Symbol object to be located in this module.
Definition: Module.hpp:558
Represents the base of the Node class hierarchy.
Definition: Node.hpp:39
const_symbol_addr_range findSymbols(Addr X) const
Find symbols by address.
Definition: Module.hpp:615
section_name_iterator sections_by_name_end()
Return an iterator to the element following the last Section.
Definition: Module.hpp:746
section_subrange findSectionsOn(Addr X)
Find a Section containing an address.
Definition: Module.hpp:804
boost::indirect_iterator< SymbolSet::index< by_referent >::type::iterator > symbol_ref_iterator
Iterator over symbols (Symbol).
Definition: Module.hpp:436
boost::indirect_iterator< SectionSet::index< by_name >::type::const_iterator, const Section & > const_section_name_iterator
Constant iterator over sections (Section).
Definition: Module.hpp:720
MergeSortedIterator< Section::symbolic_expression_iterator, ByteInterval::SymbolicExpressionElement::AddressLess > symbolic_expression_iterator
Iterator over SymbolicExpressionElement objects.
Definition: Module.hpp:1615
const_symbolic_expression_range symbolic_expressions() const
Return a range of all the SymbolicExpression objects.
Definition: Module.hpp:1672
byte_interval_iterator byte_intervals_begin()
Return an iterator to the first ByteInterval.
Definition: Module.hpp:920
code_block_range findCodeBlocksAt(Addr Low, Addr High)
Find all the code blocks that start between a range of addresses.
Definition: Module.hpp:1386
MergeSortedIterator< Section::const_byte_interval_iterator, AddressLess > const_byte_interval_iterator
Const iterator over ByteInterval objects.
Definition: Module.hpp:910
boost::uuids::uuid UUID
Represents a universally unique identifier used to identify Node objects across serialization boundar...
Definition: Context.hpp:36
const_symbolic_expression_iterator symbolic_expressions_end() const
Return an iterator to the element following the last SymbolicExpression.
Definition: Module.hpp:1667
boost::indirect_iterator< SymbolSet::index< by_referent >::type::const_iterator, const Symbol > const_symbol_ref_iterator
Constant iterator over symbols (Symbol).
Definition: Module.hpp:445
Symbol * addSymbol(Context &C, Args... A)
Creates a new Symbol in this module.
Definition: Module.hpp:572
boost::iterator_range< const_section_iterator > const_section_range
Constant range of sections (Section).
Definition: Module.hpp:710
boost::iterator_range< const_byte_interval_iterator > const_byte_interval_range
Const range of ByteInterval objects.
Definition: Module.hpp:913
A special class to store an Effective Address.
Definition: Addr.hpp:37
CodeBlock * getEntryPoint()
Get the entry point of this module, or null if not present.
Definition: Module.hpp:272
boost::iterator_range< section_iterator > section_range
Range of sections (Section).
Definition: Module.hpp:683
symbol_addr_iterator symbols_by_addr_end()
Return an iterator to the element following the last Symbol, ordered by address.
Definition: Module.hpp:518
const_code_block_range findCodeBlocksAt(Addr Low, Addr High) const
Find all the code blocks that start between a range of addresses.
Definition: Module.hpp:1417
cfg_node_cast_iter< const CodeBlock > const_block_iterator
Constant iterator over blocks (Block).
Definition: CFG.hpp:198
symbol_range symbols()
Return a range of the symbols (Symbol).
Definition: Module.hpp:470
section_range findSectionsAt(Addr A)
Find all the sections that start at an address.
Definition: Module.hpp:828
code_block_iterator code_blocks_end()
Return an iterator to the element following the last CodeBlock.
Definition: Module.hpp:1303
boost::iterator_range< byte_interval_iterator > byte_interval_range
Range of ByteInterval objects.
Definition: Module.hpp:904
The context under which GTIRB operations occur.
Definition: Context.hpp:63
byte_interval_range findByteIntervalsAt(Addr A)
Find all the intervals that start at an address.
Definition: Module.hpp:1000
void setName(const std::string &X)
Set the module name.
Definition: Module.hpp:1875
void setRebaseDelta(int64_t X)
Set the difference between this module's preferred address and the address where it was actually load...
Definition: Module.hpp:216
const CodeBlock * getEntryPoint() const
Get the entry point of this module, or null if not present.
Definition: Module.hpp:270
MergeSortedIterator< ByteInterval::const_symbolic_expression_iterator, ByteInterval::ConstSymbolicExpressionElement::AddressLess > const_symbolic_expression_iterator
Iterator over SymbolicExpressionElement objects.
Definition: Section.hpp:919
const_section_subrange findSectionsOn(Addr X) const
Find a Section containing an address.
Definition: Module.hpp:816
boost::indirect_iterator< SymbolSet::index< by_pointer >::type::const_iterator, const Symbol > const_symbol_iterator
Constant iterator over symbols (Symbol).
Definition: Module.hpp:377
const_symbol_iterator symbols_end() const
Return a constant iterator to the element following the last Symbol.
Definition: Module.hpp:466
void setISA(gtirb::ISA X)
Set the ISA of the instructions in this Module.
Definition: Module.hpp:252
boost::iterator_range< MergeSortedIterator< Section::byte_interval_subrange::iterator, AddressLess > > byte_interval_subrange
Sub-range of ByteInterval objects overlapping addresses.
Definition: Module.hpp:907
boost::iterator_range< code_block_iterator > code_block_range
Range of CodeBlock objects.
Definition: Module.hpp:1251
const_byte_interval_range findByteIntervalsAt(Addr A) const
Find all the intervals that start at an address.
Definition: Module.hpp:1033
Represents a named section of the binary.
Definition: Section.hpp:66
boost::iterator_range< section_name_iterator > section_name_range
Range of sections (Section).
Definition: Module.hpp:697
const_block_subrange findBlocksOn(Addr A) const
Find all the blocks that have bytes that lie within the address specified.
Definition: Module.hpp:1159
boost::iterator_range< const_symbolic_expression_iterator > const_symbolic_expression_range
Range of SymbolicExpressionElement objects.
Definition: Module.hpp:1631
std::optional< Addr > getAddress() const
Get the effective address.
const_byte_interval_subrange findByteIntervalsOn(Addr A) const
Find all the intervals that contain the address specified.
Definition: Module.hpp:984
byte_interval_range byte_intervals()
Return a range of all the ByteInterval objects.
Definition: Module.hpp:935
boost::iterator_range< const_symbol_addr_iterator > const_symbol_addr_range
Constant range of symbols (Symbol).
Definition: Module.hpp:430
symbol_iterator symbols_begin()
Return an iterator to the first Symbol.
Definition: Module.hpp:453
boost::indirect_iterator< SectionSet::iterator > section_iterator
Iterator over sections (Section).
Definition: Module.hpp:681
byte_interval_subrange findByteIntervalsOn(Addr A)
Find all the intervals that contain the address specified.
Definition: Module.hpp:967
boost::indirect_iterator< SymbolSet::index< by_address >::type::iterator > symbol_addr_iterator
Iterator over symbols (Symbol).
Definition: Module.hpp:413
boost::iterator_range< MergeSortedIterator< Section::data_block_subrange::iterator, AddressLess > > data_block_subrange
Sub-range of DataBlock objects overlapping an address or range of addreses.
Definition: Module.hpp:1449
data_block_range data_blocks()
Return a range of all the DataBlock objects.
Definition: Module.hpp:1484
const_symbol_name_iterator symbols_by_name_end() const
Return a constant iterator to the element following the last Symbol, ordered by name.
Definition: Module.hpp:493
boost::indirect_iterator< SymbolSet::index< by_name >::type::iterator > symbol_name_iterator
Iterator over symbols (Symbol).
Definition: Module.hpp:388
MergeSortedIterator< Section::const_symbolic_expression_iterator, ByteInterval::ConstSymbolicExpressionElement::AddressLess > const_symbolic_expression_iterator
Iterator over SymbolicExpressionElement objects.
Definition: Module.hpp:1626
MergeSortedIterator< Section::const_code_block_iterator, AddressLess > const_code_block_iterator
Iterator over CodeBlock objects.
Definition: Module.hpp:1264
@ IdaProDb32
IDA Pro database file.
const_symbol_name_range findSymbols(const std::string &N) const
Find symbols by name.
Definition: Module.hpp:593
symbol_addr_range symbols_by_addr()
Return a range of the symbols (Symbol), ordered by address.
Definition: Module.hpp:527
code_block_range findCodeBlocksAt(Addr A)
Find all the code blocks that start at an address.
Definition: Module.hpp:1369
block_iterator blocks_begin()
Return an iterator to the first block.
Definition: Module.hpp:1101
#define GTIRB_EXPORT_API
This macro controls the visibility of exported symbols (i.e. classes) in shared libraries....
Definition: Export.hpp:52
boost::iterator_range< symbolic_expression_iterator > symbolic_expression_range
Range of SymbolicExpressionElement objects.
Definition: Module.hpp:1620
int64_t getRebaseDelta() const
Get the difference between this module's preferred address and the address where it was actually load...
Definition: Module.hpp:223
boost::iterator_range< symbol_addr_iterator > symbol_addr_range
Range of symbols (Symbol).
Definition: Module.hpp:418
symbolic_expression_iterator symbolic_expressions_end()
Return an iterator to the element following the last SymbolicExpression.
Definition: Module.hpp:1644
const_proxy_block_range proxy_blocks() const
Return a constant range of the proxy_blocks (ProxyBlock).
Definition: Module.hpp:316
Main namespace for the GTIRB API.
Definition: Addr.hpp:28
proxy_block_iterator proxy_blocks_end()
Return an iterator to the element following the last ProxyBlock.
Definition: Module.hpp:303
boost::iterator_range< block_iterator > block_range
Range of blocks.
Definition: Module.hpp:1076
void setPreferredAddr(gtirb::Addr X)
Set the preferred address for loading this module.
Definition: Module.hpp:231
section_name_range findSections(const std::string &X)
Find a Section by name.
Definition: Module.hpp:877
@ RAW
Raw binary file (no format)
const_data_block_iterator data_blocks_begin() const
Return an iterator to the first DataBlock.
Definition: Module.hpp:1489
static Symbol * Create(Context &C)
Create an unitialized Symbol object.
Definition: Symbol.hpp:221
const_byte_interval_iterator byte_intervals_begin() const
Return an iterator to the first ByteInterval.
Definition: Module.hpp:941
boost::iterator_range< boost::indirect_iterator< SectionIntMap::codomain_type::iterator > > section_subrange
Sub-range of sections overlapping an address (Section).
Definition: Module.hpp:686
proxy_block_range proxy_blocks()
Return a range of the proxy_blocks (ProxyBlock).
Definition: Module.hpp:312
boost::iterator_range< const_block_iterator > const_block_range
Range of blocks.
Definition: Module.hpp:1093
symbol_addr_range findSymbols(Addr Lower, Addr Upper)
Find symbols by a range of addresses.
Definition: Module.hpp:627
@ COFF
Common Object File Format (COFF)
data_block_range findDataBlocksAt(Addr Low, Addr High)
Find all the data blocks that start between a range of addresses.
Definition: Module.hpp:1564
boost::iterator_range< const_section_name_iterator > const_section_name_range
Constant range of sections (Section).
Definition: Module.hpp:726
MergeSortedIterator< Section::byte_interval_iterator, AddressLess > byte_interval_iterator
Iterator over ByteInterval objects.
Definition: Module.hpp:902
symbolic_expression_range symbolic_expressions()
Return a range of all the SymbolicExpression objects.
Definition: Module.hpp:1649
block_range blocks()
Return a range of all the blocks.
Definition: Module.hpp:1113
A placeholder that serves as the endpoint (source or target) of a CFG edge.
Definition: ProxyBlock.hpp:49
cfg_node_cast_iter< CodeBlock > block_iterator
Iterator over blocks (Block).
Definition: CFG.hpp:194
boost::iterator_range< boost::indirect_iterator< SectionIntMap::codomain_type::const_iterator, const Section & > > const_section_subrange
Sub-range of sections overlapping an address (Section).
Definition: Module.hpp:713
const_data_block_range findDataBlocksAt(Addr A) const
Find all the data blocks that start at an address.
Definition: Module.hpp:1578
boost::iterator_range< MergeSortedIterator< Section::const_block_subrange::iterator, BlockAddressLess > > const_block_subrange
Sub-range of blocks overlapping an address or range of addreses.
Definition: Module.hpp:1098
A complete internal representation consisting of Modules (Module).
Definition: IR.hpp:76
const std::string & getName() const
Get the name.
Definition: Symbol.hpp:279
bool removeSymbol(Symbol *S)
Remove a Symbol object located in this module.
Definition: Module.hpp:545
symbol_ref_range findSymbols(const Node &Referent)
Find symbols by their referent object.
Definition: Module.hpp:652
A comparison function object to order symbolic expression elements by the address in which they occur...
Definition: ByteInterval.hpp:1138
static ProxyBlock * Create(Context &C)
Create an unitialized ProxyBlock object.
Definition: ProxyBlock.hpp:54
const_section_name_range findSections(const std::string &X) const
Find a Section by name.
Definition: Module.hpp:888
boost::indirect_iterator< ProxyBlockSet::iterator > proxy_block_iterator
Iterator over proxy_blocks (ProxyBlock).
Definition: Module.hpp:284
const_block_range findBlocksAt(Addr A) const
Find all the blocks that start at an address.
Definition: Module.hpp:1208
const IR * getIR() const
Get the IR this module belongs to.
Definition: Module.hpp:180
byte_interval_range findByteIntervalsAt(Addr Low, Addr High)
Find all the intervals that start between a range of addresses.
Definition: Module.hpp:1018
boost::indirect_iterator< SectionSet::const_iterator, const Section & > const_section_iterator
Constant iterator over sections (Section).
Definition: Module.hpp:704
void setBinaryPath(const std::string &X)
Set the location of the corresponding binary on disk.
Definition: Module.hpp:190
Class gtirb::AuxDataContainer.
section_range findSectionsAt(Addr Low, Addr High)
Find all the sections that start between a range of addresses.
Definition: Module.hpp:840
IR * getIR()
Get the IR this module belongs to.
Definition: Module.hpp:182
const_byte_interval_range byte_intervals() const
Return a range of all the ByteInterval objects.
Definition: Module.hpp:956
gtirb::ISA getISA() const
Get the ISA of the instructions in this Module.
Definition: Module.hpp:257
const_symbol_name_range symbols_by_name() const
Return a constant range of the symbols (Symbol), ordered by name.
Definition: Module.hpp:503
const_symbol_addr_range symbols_by_addr() const
Return a constant range of the symbols (Symbol), ordered by address.
Definition: Module.hpp:533
section_iterator sections_end()
Return an iterator to the element following the last Section.
Definition: Module.hpp:741
Interface for notifying observers when the Module is updated.
Definition: Module.hpp:1824
data_block_subrange findDataBlocksOn(Addr A)
Find all the data blocks that have bytes that lie within the address specified.
Definition: Module.hpp:1514
MergeSortedIterator< Section::code_block_iterator, AddressLess > code_block_iterator
Iterator over CodeBlock objects.
Definition: Module.hpp:1246
MergeSortedIterator< Section::data_block_iterator, AddressLess > data_block_iterator
Iterator over DataBlock objects.
Definition: Module.hpp:1437
static Module * Create(Context &C, const std::string &Name)
Create a Module object.
Definition: Module.hpp:175
const_section_name_iterator sections_by_name_begin() const
Return a constant iterator to the first Section.
Definition: Module.hpp:737
proxy_block_iterator proxy_blocks_begin()
Return an iterator to the first ProxyBlock.
Definition: Module.hpp:295
const_data_block_subrange findDataBlocksOn(Addr A) const
Find all the data blocks that have bytes that lie within the address specified.
Definition: Module.hpp:1531
boost::iterator_range< const_proxy_block_iterator > const_proxy_block_range
Constant range of proxy_blocks (ProxyBlock).
Definition: Module.hpp:292
MergeSortedIterator< Section::const_data_block_iterator, AddressLess > const_data_block_iterator
Iterator over DataBlock objects.
Definition: Module.hpp:1455
MergeSortedIterator< Section::block_iterator, BlockAddressLess > block_iterator
Iterator over blocks.
Definition: Module.hpp:1071
const_section_range findSectionsAt(Addr A) const
Find all the sections that start at an address.
Definition: Module.hpp:852
const_data_block_range data_blocks() const
Return a range of all the DataBlock objects.
Definition: Module.hpp:1504
symbol_name_range symbols_by_name()
Return a range of the symbols (Symbol), ordered by name.
Definition: Module.hpp:497
symbol_addr_range findSymbols(Addr X)
Find symbols by address.
Definition: Module.hpp:604
block_subrange findBlocksOn(Addr A)
Find all the blocks that have bytes that lie within the address specified.
Definition: Module.hpp:1141
byte_interval_iterator byte_intervals_end()
Return an iterator to the element following the last ByteInterval.
Definition: Module.hpp:930
const_code_block_iterator code_blocks_end() const
Return an iterator to the element following the last CodeBlock.
Definition: Module.hpp:1321
const_block_iterator blocks_end() const
Return an iterator to the element following the last block.
Definition: Module.hpp:1127
const_block_range findBlocksAt(Addr Low, Addr High) const
Find all the blocks that start between a range of addresses.
Definition: Module.hpp:1226
void setByteOrder(gtirb::ByteOrder X)
Set the endianness of the instructions in this Module.
Definition: Module.hpp:262
boost::iterator_range< const_symbol_name_iterator > const_symbol_name_range
Constant range of symbols (Symbol).
Definition: Module.hpp:406
const_symbol_addr_iterator symbols_by_addr_begin() const
Return a constant iterator to the first Symbol, ordered by address.
Definition: Module.hpp:513
block_range findBlocksAt(Addr A)
Find all the blocks that start at an address.
Definition: Module.hpp:1176
boost::iterator_range< const_code_block_iterator > const_code_block_range
Range of CodeBlock objects.
Definition: Module.hpp:1270
@ PE
Microsoft Portable Executable (PE) format.
const_section_iterator sections_end() const
Return a constant iterator to the element following the last Section.
Definition: Module.hpp:744
const_code_block_range findCodeBlocksAt(Addr A) const
Find all the code blocks that start at an address.
Definition: Module.hpp:1400
const_data_block_range findDataBlocksAt(Addr Low, Addr High) const
Find all the data blocks that start between a range of addresses.
Definition: Module.hpp:1595
boost::iterator_range< symbol_iterator > symbol_range
Range of symbols (Symbol).
Definition: Module.hpp:372
boost::iterator_range< const_symbol_iterator > const_symbol_range
Constant range of symbols (Symbol).
Definition: Module.hpp:381
const_section_range findSectionsAt(Addr Low, Addr High) const
Find all the sections that start between a range of addresses.
Definition: Module.hpp:864
boost::iterator_range< symbol_ref_iterator > symbol_ref_range
Range of symbols (Symbol).
Definition: Module.hpp:440
const std::string & getBinaryPath() const
Get the location of the corresponding binary on disk.
Definition: Module.hpp:195
virtual ChangeStatus nameChange(Module *M, const std::string &OldName, const std::string &NewName)=0
Notify the parent when this Module's name changes.
symbolic_expression_iterator symbolic_expressions_begin()
Return an iterator to the first SymbolicExpression.
Definition: Module.hpp:1634
section_iterator sections_begin()
Return an iterator to the first Section.
Definition: Module.hpp:729
const_section_name_iterator sections_by_name_end() const
Return a constant iterator to the element following the last Section.
Definition: Module.hpp:751
Contains the AuxData Tables and serves as a base class.
Definition: AuxDataContainer.hpp:56
const_symbolic_expression_iterator symbolic_expressions_begin() const
Return an iterator to the first SymbolicExpression.
Definition: Module.hpp:1655
const_byte_interval_iterator byte_intervals_end() const
Return an iterator to the element following the last ByteInterval.
Definition: Module.hpp:951
const_proxy_block_iterator proxy_blocks_end() const
Return a constant iterator to the element following the last ProxyBlock.
Definition: Module.hpp:308
gtirb::Addr getPreferredAddr() const
Get the preferred address for loading this module.
Definition: Module.hpp:237
boost::iterator_range< MergeSortedIterator< Section::block_subrange::iterator, BlockAddressLess > > block_subrange
Sub-range of blocks overlapping an address or range of addreses.
Definition: Module.hpp:1082
const_symbol_addr_iterator symbols_by_addr_end() const
Return a constant iterator to the element following the last Symbol, ordered by address.
Definition: Module.hpp:523
const_code_block_range code_blocks() const
Return a range of all the CodeBlock objects.
Definition: Module.hpp:1326
Represents a single binary (library or executable).
Definition: Module.hpp:107
symbol_iterator symbols_end()
Return an iterator to the element following the last Symbol.
Definition: Module.hpp:461
boost::iterator_range< MergeSortedIterator< Section::const_code_block_subrange::iterator, AddressLess > > const_code_block_subrange
Sub-range of CodeBlock objects overlapping an address or range of addreses.
Definition: Module.hpp:1277
boost::indirect_iterator< SectionSet::index< by_name >::type::iterator > section_name_iterator
Iterator over sections (Section).
Definition: Module.hpp:692
const_code_block_iterator code_blocks_begin() const
Return an iterator to the first CodeBlock.
Definition: Module.hpp:1311
boost::iterator_range< data_block_iterator > data_block_range
Range of DataBlock objects.
Definition: Module.hpp:1442
const_data_block_iterator data_blocks_end() const
Return an iterator to the element following the last DataBlock.
Definition: Module.hpp:1499
symbolic_expression_range findSymbolicExpressionsAt(Addr A)
Find all the symbolic expressions that start at an address.
Definition: Module.hpp:1683
const_block_range blocks() const
Return a range of all the blocks.
Definition: Module.hpp:1130
data_block_range findDataBlocksAt(Addr A)
Find all the data blocks that start at an address.
Definition: Module.hpp:1547
@ IA32
Intel Architecture, 32-bit. Also known as i386.
const_section_iterator sections_begin() const
Return a constant iterator to the first Section.
Definition: Module.hpp:731
symbol_name_iterator symbols_by_name_end()
Return an iterator to the element following the last Symbol, ordered by name.
Definition: Module.hpp:488
const_symbol_name_iterator symbols_by_name_begin() const
Return a constant iterator to the first Symbol, ordered by name.
Definition: Module.hpp:483
block_range findBlocksAt(Addr Low, Addr High)
Find all the blocks that start between a range of addresses.
Definition: Module.hpp:1193
code_block_range code_blocks()
Return a range of all the CodeBlock objects.
Definition: Module.hpp:1306
symbol_name_iterator symbols_by_name_begin()
Return an iterator to the first Symbol, ordered by name.
Definition: Module.hpp:479
boost::iterator_range< MergeSortedIterator< Section::const_data_block_subrange::iterator, AddressLess > > const_data_block_subrange
Sub-range of DataBlock objects overlapping an address or range of addreses.
Definition: Module.hpp:1468
section_name_iterator sections_by_name_begin()
Return an iterator to the first Section.
Definition: Module.hpp:733
boost::indirect_iterator< SymbolSet::index< by_pointer >::type::iterator > symbol_iterator
Iterator over symbols (Symbol).
Definition: Module.hpp:368
code_block_subrange findCodeBlocksOn(Addr A)
Find all the code blocks that have bytes that lie within the address specified.
Definition: Module.hpp:1336
ISA
Definition: Module.hpp:75
void setEntryPoint(CodeBlock *CB)
Set the entry point of this module.
Definition: Module.hpp:277
block_iterator blocks_end()
Return an iterator to the element following the last block.
Definition: Module.hpp:1110
const_symbol_iterator symbols_begin() const
Return a constant iterator to the first Symbol.
Definition: Module.hpp:457
ProxyBlock * addProxyBlock(Context &C, Args &&... A)
Creates a new ProxyBlock in this module.
Definition: Module.hpp:347
const_code_block_subrange findCodeBlocksOn(Addr A) const
Find all the code blocks that have bytes that lie within the address specified.
Definition: Module.hpp:1353
const_symbolic_expression_range findSymbolicExpressionsAt(Addr Low, Addr High) const
Find all the symbolic expressions that start between a range of addresses.
Definition: Module.hpp:1736
symbolic_expression_range findSymbolicExpressionsAt(Addr Low, Addr High)
Find all the symbolic expressions that start between a range of addresses.
Definition: Module.hpp:1701
symbol_name_range findSymbols(const std::string &N)
Find symbols by name.
Definition: Module.hpp:582
section_range sections()
Return a range of the sections (Section).
Definition: Module.hpp:755
Types and operations for symbolic expressions.
boost::iterator_range< symbol_name_iterator > symbol_name_range
Range of symbols (Symbol).
Definition: Module.hpp:393
Class gtirb::Addr and related functions.
void setFileFormat(gtirb::FileFormat X)
Set the format of the binary pointed to by getBinaryPath().
Definition: Module.hpp:201
symbol_addr_iterator symbols_by_addr_begin()
Return an iterator to the first Symbol, ordered by address.
Definition: Module.hpp:509
MergeSortedIterator< Section::const_block_iterator, BlockAddressLess > const_block_iterator
Iterator over blocks.
Definition: Module.hpp:1088
@ MACHO
Mach object file format.
data_block_iterator data_blocks_begin()
Return an iterator to the first DataBlock.
Definition: Module.hpp:1471
boost::iterator_range< proxy_block_iterator > proxy_block_range
Range of proxy_blocks (ProxyBlock).
Definition: Module.hpp:286
ChangeStatus
Definition: Observer.hpp:19
gtirb::ByteOrder getByteOrder() const
Get the endianness of the instructions in this Module.
Definition: Module.hpp:267
ByteOrder
Definition: Module.hpp:97
const_symbolic_expression_range findSymbolicExpressionsAt(Addr A) const
Find all the symbolic expressions that start at an address.
Definition: Module.hpp:1718
@ IdaProDb64
IDA Pro database file.
boost::iterator_range< const_data_block_iterator > const_data_block_range
Range of DataBlock objects.
Definition: Module.hpp:1461
MergeSortedIterator< ByteInterval::symbolic_expression_iterator, ByteInterval::SymbolicExpressionElement::AddressLess > symbolic_expression_iterator
Iterator over SymbolicExpressionElement objects.
Definition: Section.hpp:908
const_symbol_addr_range findSymbols(Addr Lower, Addr Upper) const
Find symbols by a range of addresses.
Definition: Module.hpp:640
bool isRelocated() const
Has the image been loaded somewhere other than its preferred address?
Definition: Module.hpp:247
boost::iterator_range< MergeSortedIterator< Section::const_byte_interval_subrange::iterator, AddressLess > > const_byte_interval_subrange
Sub-range of ByteInterval objects overlapping addresses.
Definition: Module.hpp:917
boost::iterator_range< MergeSortedIterator< Section::code_block_subrange::iterator, AddressLess > > code_block_subrange
Sub-range of CodeBlock objects overlapping an address or range of addreses.
Definition: Module.hpp:1258
boost::iterator_range< const_symbol_ref_iterator > const_symbol_ref_range
Constant range of symbols (Symbol).
Definition: Module.hpp:450
Represents a Symbol, which maps a name to an object in the IR.
Definition: Symbol.hpp:43
FileFormat
Identifies an exectuable file format.
Definition: Module.hpp:58
const_symbol_range symbols() const
Return a constant range of the symbols (Symbol).
Definition: Module.hpp:474
data_block_iterator data_blocks_end()
Return an iterator to the element following the last DataBlock.
Definition: Module.hpp:1481
@ XCOFF
Non-COFF (files start with ANON_OBJECT_HEADER*)