ROSE 0.11.145.192
|
Base class for address spaces.
An address space stores information about memory, registers, or other kinds of states that have a mapping from an address to a value. A semantic state typically has multiple address spaces.
Definition at line 88 of file AddressSpace.h.
#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/AddressSpace.h>
Classes | |
class | WithFormatter |
Address space with formatter. More... | |
Public Types | |
using | Ptr = AddressSpacePtr |
Shared-ownership pointer. | |
using | Purpose = AddressSpacePurpose |
Purpose for the address space. | |
Public Member Functions | |
virtual Ptr | clone () const =0 |
Deep-copy of this address space. | |
virtual void | clear ()=0 |
Remove all values. | |
virtual SValuePtr | read (const AddressSpaceAddress &, const SValuePtr &dflt, RiscOperators &addrOps, RiscOperators &valOps) |
Read a value from the address space. | |
virtual SValuePtr | peek (const AddressSpaceAddress &, const SValuePtr &dflt, RiscOperators &addrOps, RiscOperators &valOps) |
Read without causing side effects. | |
virtual void | write (const AddressSpaceAddress &, const SValuePtr &value, RiscOperators &addrOps, RiscOperators &valOps) |
Write a value to an address space. | |
virtual void | hash (Combinatorics::Hasher &, RiscOperators *addrOps, RiscOperators *valOps) const =0 |
Hash this address space. | |
virtual bool | merge (const AddressSpacePtr &other, RiscOperators *addrOps, RiscOperators *valOps)=0 |
Merge address spaces for data flow analysis. | |
std::string | printableName () const |
Printable name for this address space. | |
Purpose | purpose () const |
Property: Purpose of this address space. | |
void | purpose (Purpose) |
Property: Purpose of this address space. | |
const std::string & | name () const |
Property: Name for this address space. | |
void | name (const std::string &) |
Property: Name for this address space. | |
void | print (std::ostream &, const std::string &prefix="") const |
Print an address space. | |
virtual void | print (std::ostream &, Formatter &) const =0 |
Print an address space. | |
WithFormatter | with_format (Formatter &) |
Used for printing address spaces with formatting. | |
WithFormatter | operator+ (Formatter &) |
Used for printing address spaces with formatting. | |
WithFormatter | operator+ (const std::string &linePrefix) |
Used for printing address spaces with formatting. | |
Protected Member Functions | |
AddressSpace (Purpose, const std::string &name) | |
AddressSpace (const AddressSpace &) | |
AddressSpace & | operator= (const AddressSpace &)=delete |
using Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::Ptr = AddressSpacePtr |
Shared-ownership pointer.
Definition at line 91 of file AddressSpace.h.
using Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::Purpose = AddressSpacePurpose |
Purpose for the address space.
Definition at line 94 of file AddressSpace.h.
|
pure virtual |
Deep-copy of this address space.
Implemented in Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCellList, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::RegisterStateGeneric, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SymbolicMemory, Rose::BinaryAnalysis::InstructionSemantics::ConcreteSemantics::MemoryState, Rose::BinaryAnalysis::InstructionSemantics::IntervalSemantics::MemoryState, Rose::BinaryAnalysis::InstructionSemantics::NullSemantics::RegisterState, Rose::BinaryAnalysis::InstructionSemantics::NullSemantics::MemoryState, Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::MemoryListState, Rose::BinaryAnalysis::InstructionSemantics::SymbolicSemantics::MemoryMapState, and Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >.
Purpose Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::purpose | ( | ) | const |
Property: Purpose of this address space.
Every address space has a purpose to describe what kind of data it stores. It is permissible for a semantic state to have multiple address spaces that have the same value for this property but have slightly different purposes. For instance, the state might have two Purpose::MEMORY address spaces where one is for the processor's main address bus and another is used internally to store temporary values.
Thread safety: It is safe to have multiple threads reading the purpose as long as none are modifying the purpose.
void Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::purpose | ( | Purpose | ) |
Property: Purpose of this address space.
Every address space has a purpose to describe what kind of data it stores. It is permissible for a semantic state to have multiple address spaces that have the same value for this property but have slightly different purposes. For instance, the state might have two Purpose::MEMORY address spaces where one is for the processor's main address bus and another is used internally to store temporary values.
Thread safety: It is safe to have multiple threads reading the purpose as long as none are modifying the purpose.
const std::string & Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::name | ( | ) | const |
Property: Name for this address space.
Every address space has a name (possibly an empty string) that is used in diagnostic messages and sometimes used to look up an address space within a semantic state.
Thread safety: It is safe for multiple threads to read the name as long as none are modifying the name.
void Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::name | ( | const std::string & | ) |
Property: Name for this address space.
Every address space has a name (possibly an empty string) that is used in diagnostic messages and sometimes used to look up an address space within a semantic state.
Thread safety: It is safe for multiple threads to read the name as long as none are modifying the name.
|
pure virtual |
Remove all values.
All address and value pairs are removed from the address space, making the space completely empty.
Implemented in Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCellList, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCellMap, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCellState, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::RegisterStateGeneric, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SymbolicMemory, Rose::BinaryAnalysis::InstructionSemantics::ConcreteSemantics::MemoryState, Rose::BinaryAnalysis::InstructionSemantics::NullSemantics::RegisterState, Rose::BinaryAnalysis::InstructionSemantics::NullSemantics::MemoryState, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryState, and Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::RegisterState.
|
virtual |
Read a value from the address space.
Reading a value may have side effects. For instance, reading from a certain address that hasn't previously been defined may instantiate a new value and save it at that address so that a subsequent read from the same address can return the same value. The provided default is used for this purpose.
|
virtual |
Read without causing side effects.
Attempts to read a value from the specified address of this address space. If the space does not hold a value for that address then the specified default is returned. The address space is not modified by this operation.
|
pure virtual |
Hash this address space.
Hashes this address space by appending its data to the specified hasher. The goal is to identify when two address spaces are the "same" and allow certain kinds of analyses to take shortcuts. The address space purpose and name are not included in the hash. Separate RISC operators are passed for the addresses and values of this address space and are used if the hashing requires any operations on the addresses or values.
Implemented in Rose::BinaryAnalysis::InstructionSemantics::NullSemantics::RegisterState, Rose::BinaryAnalysis::InstructionSemantics::NullSemantics::MemoryState, Rose::BinaryAnalysis::InstructionSemantics::ConcreteSemantics::MemoryState, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCellList, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCellMap, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::RegisterStateGeneric, and Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SymbolicMemory.
|
pure virtual |
Merge address spaces for data flow analysis.
Merges the other
address space into this address space, returning true if this space changed.
Implemented in Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCellList, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCellMap, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::RegisterStateGeneric, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SymbolicMemory, Rose::BinaryAnalysis::InstructionSemantics::NullSemantics::RegisterState, Rose::BinaryAnalysis::InstructionSemantics::ConcreteSemantics::MemoryState, and Rose::BinaryAnalysis::InstructionSemantics::NullSemantics::MemoryState.
std::string Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::printableName | ( | ) | const |
Printable name for this address space.
Returns a string with the name of the address space. If the address space name is a single word then the word is printed without quotes. Otherwise quotes and appropriate C-style escapes are included.
void Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::print | ( | std::ostream & | , |
const std::string & | prefix = "" |
||
) | const |
Print an address space.
The output most likely occupies more than one line and each emitted line will be terminated with a line feed.
|
pure virtual |
Print an address space.
The output most likely occupies more than one line and each emitted line will be terminated with a line feed.
Implemented in Rose::BinaryAnalysis::InstructionSemantics::NullSemantics::RegisterState, Rose::BinaryAnalysis::InstructionSemantics::NullSemantics::MemoryState, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCellList, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::MemoryCellMap, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::RegisterStateGeneric, Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::SymbolicMemory, Rose::BinaryAnalysis::InstructionSemantics::ConcreteSemantics::MemoryState, and Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >.
WithFormatter Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::with_format | ( | Formatter & | ) |
Used for printing address spaces with formatting.
The usual way to use this is:
Since specifying a line prefix string for indentation purposes is such a common use case, the indentation can be given instead of a format, as in the following code that indents each line of the expression with four spaces.
WithFormatter Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::operator+ | ( | Formatter & | ) |
Used for printing address spaces with formatting.
The usual way to use this is:
Since specifying a line prefix string for indentation purposes is such a common use case, the indentation can be given instead of a format, as in the following code that indents each line of the expression with four spaces.
WithFormatter Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::AddressSpace::operator+ | ( | const std::string & | linePrefix | ) |
Used for printing address spaces with formatting.
The usual way to use this is:
Since specifying a line prefix string for indentation purposes is such a common use case, the indentation can be given instead of a format, as in the following code that indents each line of the expression with four spaces.