1#ifndef ROSE_BinaryAnalysis_Variables_GlobalVariable_H
2#define ROSE_BinaryAnalysis_Variables_GlobalVariable_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/AddressInterval.h>
7#include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>
8#include <Rose/BinaryAnalysis/Variables/BaseVariable.h>
10#include <Sawyer/IntervalMap.h>
13namespace BinaryAnalysis {
20#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
22 friend class boost::serialization::access;
25 void serialize(S &s,
const unsigned ) {
27 s & BOOST_SERIALIZATION_NVP(address_);
43 const std::vector<InstructionAccess> &definingInstructions = std::vector<InstructionAccess>(),
44 const std::string &
name =
"");
77 void print(std::ostream&)
const;
85 explicit operator bool()
const {
Base class describing a source-level variable.
rose_addr_t maxSizeBytes() const
Property: Maximum variable size in bytes.
const std::string & name() const
Property: Optional variable name.
Description of a global variable.
bool operator!=(const GlobalVariable &other) const
Compare two global variable descriptors.
Address address() const
Property: Starting address.
bool operator==(const GlobalVariable &other) const
Compare two global variable descriptors.
void address(Address va)
Property: Starting address.
std::string toString() const
Printing global variable.
const std::string & setDefaultName()
Give variable a defult name.
GlobalVariable(Address startingAddress, rose_addr_t maxSizeBytes, const std::vector< InstructionAccess > &definingInstructions=std::vector< InstructionAccess >(), const std::string &name="")
Constructor.
AddressInterval interval() const
Location of variable in memory.
bool operator!() const
Predicate to test whether variable is invalid.
void print(std::ostream &) const
Printing global variable.
friend std::ostream & operator<<(std::ostream &, const Rose::BinaryAnalysis::Variables::GlobalVariable &)
Print global variable descriptor.
GlobalVariable()
Default constructor.
bool isEmpty() const
True if interval is empty.
Converts text to messages.
void print(const GlobalVariables &, const Partitioner2::PartitionerConstPtr &, std::ostream &out, const std::string &prefix="")
Print info about multiple global variables.
void erase(GlobalVariables &, const AddressInterval &toErase)
Erase some global variables.
AddressInterval isInconsistent(const GlobalVariables &, Sawyer::Message::Stream &)
Check that the map is consistent.
std::uint64_t Address
Address.