1 #ifndef ROSE_BinaryAnalysis_SourceLocations_H
2 #define ROSE_BinaryAnalysis_SourceLocations_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 #include <Rose/SourceLocation.h>
8 #include <boost/filesystem.hpp>
9 #include <boost/serialization/access.hpp>
10 #include <Sawyer/IntervalMap.h>
11 #include <Sawyer/Map.h>
12 #include <Sawyer/Optional.h>
13 #include <Sawyer/Synchronization.h>
18 namespace BinaryAnalysis {
30 mutable SAWYER_THREAD_TRAITS::Mutex mutex_;
31 AddressToSource addrToSrc_;
32 SourceToAddress srcToAddr_;
35 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
36 friend class boost::serialization::access;
39 void serialize(S &s,
const unsigned ) {
40 s & BOOST_SERIALIZATION_NVP(addrToSrc_);
41 s & BOOST_SERIALIZATION_NVP(srcToAddr_);
83 void erase(rose_addr_t);
146 void printSrcToAddr(std::ostream&,
const std::string &prefix =
"")
const;
147 void print(std::ostream&,
const std::string &prefix =
"")
const;
153 void printAddrToSrc(std::ostream&,
const std::string &prefix =
"")
const;
158 void eraseNS(rose_addr_t va);
161 std::ostream& operator<<(std::ostream&,
const SourceLocations&);
Sawyer::Optional< rose_addr_t > operator()(const SourceLocation &loc) const
Find the first address associated with a source location.
Information about a source location.
SourceLocation nextSourceLocation(const SourceLocation ¤t=SourceLocation()) const
Given a source location, return the next source location.
Bidirectional mapping between addresses and source locations.
SourceLocation operator()(rose_addr_t va) const
Find the source location for an address.
std::set< boost::filesystem::path > allFileNames() const
Get the list of all known source files.
SourceLocations()
Default constructor.
Main namespace for the ROSE library.
void clear()
Remove all links.
Sawyer::Optional< rose_addr_t > firstAddress(const SourceLocation &) const
Find the first address associated with a source location.
void fillHoles(size_t maxHoleSize=64)
Fill in small holes in the address space.
This class represents the base class for all IR nodes within Sage III.
void insertFromDebug(SgNode *ast)
Insert information from debug tables.
void print(std::ostream &, const std::string &prefix="") const
Print the source to address mapping.
void erase(const SourceLocation &, rose_addr_t)
Remove links between source and addresses.
void insert(const SourceLocation &, rose_addr_t)
Insert links between source and adresseses.
void printSrcToAddr(std::ostream &, const std::string &prefix="") const
Print the source to address mapping.
SourceLocations & operator=(const SourceLocations &)
Atomic copy.
void printAddrToSrc(std::ostream &, const std::string &prefix="") const
Print the address to source mapping.