ROSE 0.11.145.147
ConcreteLocation.h
1#ifndef ROSE_BinaryAnalysis_ConcreteLocation_H
2#define ROSE_BinaryAnalysis_ConcreteLocation_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5
6#include <Rose/BinaryAnalysis/BasicTypes.h>
7#include <Rose/BinaryAnalysis/RegisterDescriptor.h>
8#include <Rose/Location.h>
9
10#include <boost/serialization/access.hpp>
11#include <ostream>
12#include <Sawyer/Optional.h>
13#include <string>
14
15namespace Rose {
16namespace BinaryAnalysis {
17
27public:
35
36private:
39 RegisterDictionaryPtr regdict_;
40
41#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
42 friend class boost::serialization::access;
43 template<class S> void serialize(S&, unsigned);
44#endif
45
46public:
52 virtual ~ConcreteLocation();
53
56 ConcreteLocation& operator=(const ConcreteLocation&);
57
71 explicit ConcreteLocation(rose_addr_t);
72
84 static ConcreteLocation parse(const std::string&);
85
86 // Inherited methods
87 virtual bool isValid() const override;
88 virtual std::string toString() const override;
89 virtual void print(std::ostream&) const override;
90 virtual std::string printableName() const override;
91 virtual bool isEqual(const Location&) const override;
92 virtual bool operator<(const Location&) const override;
93 virtual bool operator<=(const Location&) const override;
94 virtual bool operator>(const Location&) const override;
95 virtual bool operator>=(const Location&) const override;
96
101 void print(std::ostream&, const RegisterDictionaryPtr&) const;
102
107 int compare(const ConcreteLocation&) const;
108
110 Type type() const;
111
126
131 rose_addr_t address() const;
132
137 int64_t offset() const;
138};
139
140} // namespace
141} // namespace
142
143#endif
144#endif
int compare(const ConcreteLocation &) const
Compare two concrete locations.
RegisterDictionaryPtr registerDictionary() const
Property: Register dictionary.
Type type() const
Type of location.
virtual void print(std::ostream &) const override
Output location to a stream.
ConcreteLocation()
Default constructor.
void print(std::ostream &, const RegisterDictionaryPtr &) const
Print using the specified register dictionary.
virtual std::string toString() const override
Convert location to string.
ConcreteLocation(const ConcreteLocation &)
Copy constructor.
virtual bool isEqual(const Location &) const override
Equality and inequality.
void registerDictionary(const RegisterDictionaryPtr &)
Property: Register dictionary.
ConcreteLocation(RegisterDescriptor, const RegisterDictionaryPtr &)
Register location.
@ NO_LOCATION
Used by default-constructed locations.
@ REGISTER
Parameter is in a register.
@ RELATIVE
Parameter in memory relative to a register.
@ ABSOLUTE
Parameter is at a fixed memory address.
virtual bool isValid() const override
Test whether this object is valid.
RegisterDescriptor reg() const
Register part of the location.
ConcreteLocation(RegisterDescriptor, int64_t offset, const RegisterDictionaryPtr &)
Register and offset location.
rose_addr_t address() const
Address part of the location.
ConcreteLocation(RegisterDescriptor)
Register location.
ConcreteLocation(rose_addr_t)
Address location.
int64_t offset() const
Offset part of the location.
static ConcreteLocation parse(const std::string &)
Parse a concrete location from a string.
ConcreteLocation(RegisterDescriptor, int64_t offset)
Register and offset location.
virtual std::string printableName() const override
Convert location to escaped, parsable string.
Describes (part of) a physical CPU register.
Base class for location types.
Definition Location.h:23
Holds a value or nothing.
Definition Optional.h:56
The ROSE library.