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/BinaryAnalysis/AddressInterval.h>
7#include <Rose/BinaryAnalysis/AddressIntervalSet.h>
8#include <Rose/SourceLocation.h>
10#include <Sawyer/IntervalMap.h>
11#include <Sawyer/Map.h>
12#include <Sawyer/Optional.h>
13#include <Sawyer/Synchronization.h>
15#include <boost/filesystem.hpp>
16#include <boost/serialization/access.hpp>
24namespace BinaryAnalysis {
36 mutable SAWYER_THREAD_TRAITS::Mutex mutex_;
41#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
42 friend class boost::serialization::access;
45 void serialize(S &s,
const unsigned ) {
46 s & BOOST_SERIALIZATION_NVP(addrToSrc_);
47 s & BOOST_SERIALIZATION_NVP(srcToAddr_);
153 void print(std::ostream&,
const std::string &prefix =
"")
const;
164 void eraseNS(rose_addr_t va);
Bidirectional mapping between addresses and source locations.
void fillHoles(size_t maxHoleSize=64)
Fill in small holes in the address space.
void insert(const SourceLocation &, const AddressIntervalSet &)
Insert links between source and adresseses.
SourceLocation nextSourceLocation(const SourceLocation ¤t=SourceLocation()) const
Given a source location, return the next source location.
void erase(const SourceLocation &, const AddressIntervalSet &)
Remove links between source and addresses.
void erase(rose_addr_t)
Remove all links for the specified addresses regardless of source.
void insert(const SourceLocation &, const AddressInterval &)
Insert links between source and adresseses.
void printAddrToSrc(std::ostream &, const std::string &prefix="") const
Print the address to source mapping.
void printSrcToAddr(std::ostream &, const std::string &prefix="") const
Print the source to address mapping.
void erase(const AddressInterval &)
Remove all links for the specified addresses regardless of source.
AddressIntervalSet get(const SourceLocation &) const
Find the addresses associated with a source location.
void print(std::ostream &, const std::string &prefix="") const
Print the source to address mapping.
void erase(const SourceLocation &, const AddressInterval &)
Remove links between source and addresses.
Sawyer::Optional< rose_addr_t > operator()(const SourceLocation &loc) const
Find the first address associated with a source location.
std::set< boost::filesystem::path > allFileNames() const
Get the list of all known source files.
SourceLocations()
Default constructor.
SourceLocations & operator=(const SourceLocations &)
Atomic copy.
SourceLocations(const SourceLocations &)
Atomic copy.
void erase(const SourceLocation &, rose_addr_t)
Remove links between source and addresses.
void erase(const AddressIntervalSet &)
Remove all links for the specified addresses regardless of source.
void insertFromDebug(SgNode *ast)
Insert information from debug tables.
void clear()
Remove all links.
void insert(const SourceLocation &, rose_addr_t)
Insert links between source and adresseses.
void erase(const SourceLocation &)
Remove all links for the specified source location regardless of address.
SourceLocation operator()(rose_addr_t va) const
Find the source location for an address.
SourceLocation get(rose_addr_t) const
Find the source location for an address.
Sawyer::Optional< rose_addr_t > firstAddress(const SourceLocation &) const
Find the first address associated with a source location.
Information about a source location.
An associative container whose keys are non-overlapping intervals.
Container associating values with keys.
Holds a value or nothing.
This class represents the base class for all IR nodes within Sage III.