1#ifndef ROSE_BinaryAnalysis_InstructionSemantics_BaseSemantics_MemoryCellMap_H
2#define ROSE_BinaryAnalysis_InstructionSemantics_BaseSemantics_MemoryCellMap_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/MemoryCellState.h>
10#include <boost/serialization/access.hpp>
11#include <boost/serialization/base_object.hpp>
12#include <boost/serialization/export.hpp>
15namespace BinaryAnalysis {
16namespace InstructionSemantics {
47 uint32_t lastPosition_ = 0;
52#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
54 friend class boost::serialization::access;
57 void serialize(S &s,
const unsigned ) {
59 s & BOOST_SERIALIZATION_NVP(cells);
125 unsigned nextPosition();
128 unsigned lastPosition()
const;
129 void lastPosition(
unsigned);
137#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
Simple map-based memory state.
MemoryCellMapPtr Ptr
Shared-ownership pointer.
virtual void eraseLeadingCells(MemoryCell::Predicate &) override
Remove leading matching cells.
virtual bool merge(const AddressSpacePtr &other, RiscOperators *addrOps, RiscOperators *valOps) override
Merge address spaces for data flow analysis.
virtual void print(std::ostream &, Formatter &) const override
Print an address space.
static MemoryCellMapPtr promote(const AddressSpacePtr &)
Promote a base address space pointer to a MemoryCellMap pointer.
virtual void writeMemory(const SValuePtr &address, const SValuePtr &value, RiscOperators *addrOps, RiscOperators *valOps) override
Write a value to memory.
virtual std::vector< MemoryCellPtr > leadingCells(MemoryCell::Predicate &) const override
Find leading matching cells.
virtual bool isAllPresent(const SValuePtr &address, size_t nBytes, RiscOperators *addrOps) const
Predicate to determine whether all bytes are present.
virtual CellKey generateCellKey(const SValuePtr &address) const =0
Generate a cell lookup key.
virtual AddressSet getWritersIntersection(const SValuePtr &addr, size_t nBits, RiscOperators *addrOps, RiscOperators *valOps) override
Writers for an address.
virtual void traverse(MemoryCell::Visitor &) override
Traverse and modify cells.
virtual void hash(Combinatorics::Hasher &, RiscOperators *addrOps, RiscOperators *valOps) const override
Hash this address space.
virtual void eraseMatchingCells(MemoryCell::Predicate &) override
Remove all matching cells.
virtual void clear() override
Clear memory.
uint64_t CellKey
Key used to look up memory cells.
virtual AddressSet getWritersUnion(const SValuePtr &addr, size_t nBits, RiscOperators *addrOps, RiscOperators *valOps) override
Writers for an address.
virtual SValuePtr readMemory(const SValuePtr &address, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps) override
Read a value from memory.
Sawyer::Container::Map< CellKey, MemoryCellPtr > CellMap
Map of memory cells indexed by cell keys.
virtual SValuePtr peekMemory(const SValuePtr &address, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps) override
Read a value from memory without side effects.
virtual MemoryCellPtr findCell(const SValuePtr &addr) const
Look up memory cell for address.
virtual std::vector< MemoryCellPtr > matchingCells(MemoryCell::Predicate &) const override
Find all matching cells.
Predicate for matching cells.
Visitor for traversing a cells.
Base class for most instruction semantics RISC operators.
Container associating values with keys.
Base classes for instruction semantics.
boost::shared_ptr< MemoryCell > MemoryCellPtr
Shared-ownership pointer to a memory cell.
boost::shared_ptr< class MemoryCellMap > MemoryCellMapPtr
Shared-ownership pointer to a map-based memory state.
boost::shared_ptr< AddressSpace > AddressSpacePtr
Shared-ownership pointer for AddressSpace objects.