GTIRB
v2.1.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>;
1099 Section::const_block_subrange::iterator, BlockAddressLess>>;
1104 boost::make_transform_iterator(this->sections_begin(),
1105 NodeToBlockRange<Section>()),
1106 boost::make_transform_iterator(this->sections_end(),
1107 NodeToBlockRange<Section>()));
1115 return boost::make_iterator_range(blocks_begin(), blocks_end());
1121 boost::make_transform_iterator(this->sections_begin(),
1122 NodeToBlockRange<const Section>()),
1123 boost::make_transform_iterator(this->sections_end(),
1124 NodeToBlockRange<const Section>()));
1132 return boost::make_iterator_range(blocks_begin(), blocks_end());
1145 block_subrange::iterator(
1146 boost::make_transform_iterator(SectionRange.begin(),
1147 FindBlocksIn<Section>(A)),
1148 boost::make_transform_iterator(SectionRange.end(),
1149 FindBlocksIn<Section>(A))),
1150 block_subrange::iterator());
1163 const_block_subrange::iterator(
1164 boost::make_transform_iterator(SectionRange.begin(),
1165 FindBlocksIn<const Section>(A)),
1166 boost::make_transform_iterator(SectionRange.end(),
1167 FindBlocksIn<const Section>(A))),
1168 const_block_subrange::iterator());
1180 boost::make_transform_iterator(
1181 SectionRange.begin(), FindBlocksAt<Section>(A)),
1182 boost::make_transform_iterator(
1183 SectionRange.end(), FindBlocksAt<Section>(A))),
1184 block_range::iterator());
1195 std::vector<Section::block_range> Ranges;
1196 for (
Section&
S : findSectionsOn(Low))
1197 Ranges.push_back(
S.findBlocksAt(Low, High));
1198 for (
Section&
S : findSectionsAt(Low + 1, High))
1199 Ranges.push_back(
S.findBlocksAt(Low, High));
1212 const_block_range::iterator(
1213 boost::make_transform_iterator(SectionRange.begin(),
1214 FindBlocksAt<const Section>(A)),
1215 boost::make_transform_iterator(SectionRange.end(),
1216 FindBlocksAt<const Section>(A))),
1217 const_block_range::iterator());
1228 std::vector<Section::const_block_range> Ranges;
1229 for (
const Section&
S : findSectionsOn(Low))
1230 Ranges.push_back(
S.findBlocksAt(Low, High));
1231 for (
const Section&
S : findSectionsAt(Low + 1, High))
1232 Ranges.push_back(
S.findBlocksAt(Low, High));
1246 using code_block_iterator =
1247 MergeSortedIterator<Section::code_block_iterator, AddressLess>;
1259 MergeSortedIterator<Section::code_block_subrange::iterator, AddressLess>>;
1265 MergeSortedIterator<Section::const_code_block_iterator, AddressLess>;
1271 boost::iterator_range<const_code_block_iterator>;
1278 Section::const_code_block_subrange::iterator, AddressLess>>;
1282 SectionSet::iterator End) {
1283 NodeToCodeBlockRange<Section> Transformer;
1284 return boost::make_iterator_range(
1296 boost::make_transform_iterator(this->sections_begin(),
1297 NodeToCodeBlockRange<Section>()),
1298 boost::make_transform_iterator(this->sections_end(),
1299 NodeToCodeBlockRange<Section>()));
1308 return boost::make_iterator_range(code_blocks_begin(), code_blocks_end());
1314 boost::make_transform_iterator(this->sections_begin(),
1315 NodeToCodeBlockRange<const Section>()),
1316 boost::make_transform_iterator(this->sections_end(),
1317 NodeToCodeBlockRange<const Section>()));
1328 return boost::make_iterator_range(code_blocks_begin(), code_blocks_end());
1340 code_block_subrange::iterator(
1341 boost::make_transform_iterator(Range.begin(),
1342 FindCodeBlocksIn<Section>(A)),
1343 boost::make_transform_iterator(Range.end(),
1344 FindCodeBlocksIn<Section>(A))),
1345 code_block_subrange::iterator());
1357 const_code_block_subrange::iterator(
1358 boost::make_transform_iterator(Range.begin(),
1359 FindCodeBlocksIn<const Section>(A)),
1360 boost::make_transform_iterator(Range.end(),
1361 FindCodeBlocksIn<const Section>(A))),
1362 const_code_block_subrange::iterator());
1373 code_block_range::iterator(
1374 boost::make_transform_iterator(Range.begin(),
1375 FindCodeBlocksAt<Section>(A)),
1376 boost::make_transform_iterator(Range.end(),
1377 FindCodeBlocksAt<Section>(A))),
1378 code_block_range::iterator());
1388 std::vector<Section::code_block_range> Ranges;
1389 for (
Section&
S : findSectionsOn(Low))
1390 Ranges.push_back(
S.findCodeBlocksAt(Low, High));
1391 for (
Section&
S : findSectionsAt(Low + 1, High))
1392 Ranges.push_back(
S.findCodeBlocksAt(Low, High));
1404 const_code_block_range::iterator(
1405 boost::make_transform_iterator(Range.begin(),
1406 FindCodeBlocksAt<const Section>(A)),
1407 boost::make_transform_iterator(Range.end(),
1408 FindCodeBlocksAt<const Section>(A))),
1409 const_code_block_range::iterator());
1419 std::vector<Section::const_code_block_range> Ranges;
1420 for (
const Section&
S : findSectionsOn(Low))
1421 Ranges.push_back(
S.findCodeBlocksAt(Low, High));
1422 for (
const Section&
S : findSectionsAt(Low + 1, High))
1423 Ranges.push_back(
S.findCodeBlocksAt(Low, High));
1437 using data_block_iterator =
1438 MergeSortedIterator<Section::data_block_iterator, AddressLess>;
1450 MergeSortedIterator<Section::data_block_subrange::iterator, AddressLess>>;
1456 MergeSortedIterator<Section::const_data_block_iterator, AddressLess>;
1462 boost::iterator_range<const_data_block_iterator>;
1469 Section::const_data_block_subrange::iterator, AddressLess>>;
1474 boost::make_transform_iterator(this->sections_begin(),
1475 NodeToDataBlockRange<Section>()),
1476 boost::make_transform_iterator(this->sections_end(),
1477 NodeToDataBlockRange<Section>()));
1486 return boost::make_iterator_range(data_blocks_begin(), data_blocks_end());
1492 boost::make_transform_iterator(this->sections_begin(),
1493 NodeToDataBlockRange<const Section>()),
1494 boost::make_transform_iterator(this->sections_end(),
1495 NodeToDataBlockRange<const Section>()));
1506 return boost::make_iterator_range(data_blocks_begin(), data_blocks_end());
1518 data_block_subrange::iterator(
1519 boost::make_transform_iterator(Range.begin(),
1520 FindDataBlocksIn<Section>(A)),
1521 boost::make_transform_iterator(Range.end(),
1522 FindDataBlocksIn<Section>(A))),
1523 data_block_subrange::iterator());
1535 const_data_block_subrange::iterator(
1536 boost::make_transform_iterator(Range.begin(),
1537 FindDataBlocksIn<const Section>(A)),
1538 boost::make_transform_iterator(Range.end(),
1539 FindDataBlocksIn<const Section>(A))),
1540 const_data_block_subrange::iterator());
1551 data_block_range::iterator(
1552 boost::make_transform_iterator(Range.begin(),
1553 FindDataBlocksAt<Section>(A)),
1554 boost::make_transform_iterator(Range.end(),
1555 FindDataBlocksAt<Section>(A))),
1556 data_block_range::iterator());
1566 std::vector<Section::data_block_range> Ranges;
1567 for (
Section&
S : findSectionsOn(Low))
1568 Ranges.push_back(
S.findDataBlocksAt(Low, High));
1569 for (
Section&
S : findSectionsAt(Low + 1, High))
1570 Ranges.push_back(
S.findDataBlocksAt(Low, High));
1582 const_data_block_range::iterator(
1583 boost::make_transform_iterator(Range.begin(),
1584 FindDataBlocksAt<const Section>(A)),
1585 boost::make_transform_iterator(Range.end(),
1586 FindDataBlocksAt<const Section>(A))),
1587 const_data_block_range::iterator());
1597 std::vector<Section::const_data_block_range> Ranges;
1598 for (
const Section&
S : findSectionsOn(Low))
1599 Ranges.push_back(
S.findDataBlocksAt(Low, High));
1600 for (
const Section&
S : findSectionsAt(Low + 1, High))
1601 Ranges.push_back(
S.findDataBlocksAt(Low, High));
1614 using symbolic_expression_iterator =
1621 boost::iterator_range<symbolic_expression_iterator>;
1632 boost::iterator_range<const_symbolic_expression_iterator>;
1637 boost::make_transform_iterator(
1638 this->sections_begin(), NodeToSymbolicExpressionRange<Section>()),
1639 boost::make_transform_iterator(
1640 this->sections_end(), NodeToSymbolicExpressionRange<Section>()));
1651 return boost::make_iterator_range(symbolic_expressions_begin(),
1652 symbolic_expressions_end());
1658 boost::make_transform_iterator(
1659 this->sections_begin(),
1660 NodeToSymbolicExpressionRange<const Section>()),
1661 boost::make_transform_iterator(
1662 this->sections_end(),
1663 NodeToSymbolicExpressionRange<const Section>()));
1674 return boost::make_iterator_range(symbolic_expressions_begin(),
1675 symbolic_expressions_end());
1686 symbolic_expression_range::iterator(
1687 boost::make_transform_iterator(this->sections_begin(),
1688 FindSymExprsAt<Section>(A)),
1689 boost::make_transform_iterator(this->sections_end(),
1690 FindSymExprsAt<Section>(A))),
1691 symbolic_expression_range::iterator());
1704 symbolic_expression_range::iterator(
1705 boost::make_transform_iterator(
1706 this->sections_begin(),
1707 FindSymExprsBetween<Section>(Low, High)),
1708 boost::make_transform_iterator(
1709 this->sections_end(), FindSymExprsBetween<Section>(Low, High))),
1710 symbolic_expression_range::iterator());
1721 const_symbolic_expression_range::iterator(
1722 boost::make_transform_iterator(this->sections_begin(),
1723 FindSymExprsAt<const Section>(A)),
1724 boost::make_transform_iterator(this->sections_end(),
1725 FindSymExprsAt<const Section>(A))),
1726 const_symbolic_expression_range::iterator());
1740 const_symbolic_expression_range::iterator(
1741 boost::make_transform_iterator(
1742 this->sections_begin(),
1743 FindSymExprsBetween<const Section>(Low, High)),
1744 boost::make_transform_iterator(
1745 this->sections_end(),
1746 FindSymExprsBetween<const Section>(Low, High))),
1747 const_symbolic_expression_range::iterator());
1753 static bool classof(
const Node* N) {
return N->getKind() == Kind::Module; }
1758 using MessageType = proto::Module;
1761 void removeSectionAddrs(Section* S);
1767 void insertSectionAddrs(Section* S);
1774 void toProtobuf(MessageType* Message)
const;
1782 static ErrorOr<Module*> fromProtobuf(Context& C,
const MessageType& Message);
1785 void save(std::ostream& Out)
const;
1788 static Module* load(Context& C, std::istream& In);
1790 void setParent(IR* I, ModuleObserver* O) {
1795 IR* Parent{
nullptr};
1796 ModuleObserver* Observer{
nullptr};
1797 std::string BinaryPath;
1799 int64_t RebaseDelta{0};
1804 CodeBlock* EntryPoint{
nullptr};
1805 ProxyBlockSet ProxyBlocks;
1806 SectionSet Sections;
1807 SectionIntMap SectionAddrs;
1810 std::unique_ptr<SectionObserver> SecObs;
1811 std::unique_ptr<SymbolObserver> SymObs;
1816 template <
typename T>
friend typename T::MessageType toProtobuf(
const T&);
1817 friend class SerializationTestHarness;
1837 const std::string& NewName) = 0;
1878 std::string OldName = X;
1879 std::swap(Name, OldName);
1885 "recovering from rejected name change is unimplemented");
1892 #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:1119
A basic block.
Definition: CodeBlock.hpp:54
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:1294
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:1616
const_symbolic_expression_range symbolic_expressions() const
Return a range of all the SymbolicExpression objects.
Definition: Module.hpp:1673
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:1387
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:1668
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:1418
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:1304
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:1876
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:1252
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:1160
boost::iterator_range< const_symbolic_expression_iterator > const_symbolic_expression_range
Range of SymbolicExpressionElement objects.
Definition: Module.hpp:1632
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:1450
data_block_range data_blocks()
Return a range of all the DataBlock objects.
Definition: Module.hpp:1485
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:1627
MergeSortedIterator< Section::const_code_block_iterator, AddressLess > const_code_block_iterator
Iterator over CodeBlock objects.
Definition: Module.hpp:1265
@ 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:1370
block_iterator blocks_begin()
Return an iterator to the first block.
Definition: Module.hpp:1102
#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:1621
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:1645
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:1490
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:1565
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:1650
block_range blocks()
Return a range of all the blocks.
Definition: Module.hpp:1114
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:1579
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:1099
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:1090
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:1209
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:1825
data_block_subrange findDataBlocksOn(Addr A)
Find all the data blocks that have bytes that lie within the address specified.
Definition: Module.hpp:1515
MergeSortedIterator< Section::code_block_iterator, AddressLess > code_block_iterator
Iterator over CodeBlock objects.
Definition: Module.hpp:1247
MergeSortedIterator< Section::data_block_iterator, AddressLess > data_block_iterator
Iterator over DataBlock objects.
Definition: Module.hpp:1438
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:1532
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:1456
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:1505
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:1142
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:1322
const_block_iterator blocks_end() const
Return an iterator to the element following the last block.
Definition: Module.hpp:1128
const_block_range findBlocksAt(Addr Low, Addr High) const
Find all the blocks that start between a range of addresses.
Definition: Module.hpp:1227
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:1177
boost::iterator_range< const_code_block_iterator > const_code_block_range
Range of CodeBlock objects.
Definition: Module.hpp:1271
@ 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:1401
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:1596
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:1635
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:1656
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:1327
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:1278
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:1312
boost::iterator_range< data_block_iterator > data_block_range
Range of DataBlock objects.
Definition: Module.hpp:1443
const_data_block_iterator data_blocks_end() const
Return an iterator to the element following the last DataBlock.
Definition: Module.hpp:1500
symbolic_expression_range findSymbolicExpressionsAt(Addr A)
Find all the symbolic expressions that start at an address.
Definition: Module.hpp:1684
const_block_range blocks() const
Return a range of all the blocks.
Definition: Module.hpp:1131
data_block_range findDataBlocksAt(Addr A)
Find all the data blocks that start at an address.
Definition: Module.hpp:1548
@ 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:1194
code_block_range code_blocks()
Return a range of all the CodeBlock objects.
Definition: Module.hpp:1307
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:1469
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:1337
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:1111
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:1354
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:1737
symbolic_expression_range findSymbolicExpressionsAt(Addr Low, Addr High)
Find all the symbolic expressions that start between a range of addresses.
Definition: Module.hpp:1702
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:1472
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:1719
@ IdaProDb64
IDA Pro database file.
boost::iterator_range< const_data_block_iterator > const_data_block_range
Range of DataBlock objects.
Definition: Module.hpp:1462
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:1259
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:1482
@ XCOFF
Non-COFF (files start with ANON_OBJECT_HEADER*)