3#ifndef ROSE_BinaryAnalysis_InstructionSemantics_BaseSemantics_SymbolicMemory_H
4#define ROSE_BinaryAnalysis_InstructionSemantics_BaseSemantics_SymbolicMemory_H
5#include <featureTests.h>
6#ifdef ROSE_ENABLE_BINARY_ANALYSIS
8#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/MemoryState.h>
9#include <Rose/BinaryAnalysis/SymbolicExpression.h>
12namespace BinaryAnalysis {
13namespace InstructionSemantics {
52 return instance(addrProtoval, valProtoval);
65 ASSERT_not_null(retval);
Represents all memory in the state.
Base class for most instruction semantics RISC operators.
Purely symbolic memory state.
void expression(const SymbolicExpression::Ptr &mem)
Property: the symbolic expression for the memory.
virtual MemoryStatePtr clone() const override
Virtual allocating copy constructor.
virtual bool merge(const MemoryStatePtr &other, RiscOperators *addrOps, RiscOperators *valOps) override
Merge memory states for data flow analysis.
virtual SValuePtr peekMemory(const SValuePtr &address, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps) override
Read a value from memory without side effects.
SymbolicMemoryPtr Ptr
Shared-ownership pointer.
static SymbolicMemoryPtr promote(const MemoryStatePtr &x)
Convert pointer to a SymbolicMemory pointer.
virtual void hash(Combinatorics::Hasher &, RiscOperators *addrOps, RiscOperators *valOps) const override
Calculate a hash for this memory state.
virtual void writeMemory(const SValuePtr &address, const SValuePtr &value, RiscOperators *addrOps, RiscOperators *valOps) override
Write a value to memory.
static SymbolicMemoryPtr instance(const SValuePtr &addrProtoval, const SValuePtr &valProtoval)
Instantiate a new empty memory state on the heap.
virtual void clear() override
Clear memory.
SymbolicExpression::Ptr expression() const
Property: the symbolic expression for the memory.
virtual SValuePtr readMemory(const SValuePtr &address, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps) override
Read a value from memory.
virtual void print(std::ostream &, Formatter &) const override
Print a memory state to more than one line of output.
virtual MemoryStatePtr create(const SValuePtr &addrProtoval, const SValuePtr &valProtoval) const override
Virtual allocating constructor.
Base classes for instruction semantics.
boost::shared_ptr< MemoryState > MemoryStatePtr
Shared-ownership pointer to a memory state.
boost::shared_ptr< class SymbolicMemory > SymbolicMemoryPtr
Shared-ownership pointer for symbolic memory state.
LeafPtr makeMemoryVariable(size_t addressWidth, size_t valueWidth, const std::string &comment="", unsigned flags=0)
Leaf constructor.