1 #ifndef ROSE_BinaryAnalysis_InstructionSemantics_BaseSemantics_MemoryCellState_H
2 #define ROSE_BinaryAnalysis_InstructionSemantics_BaseSemantics_MemoryCellState_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/MemoryCell.h>
7 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/MemoryState.h>
8 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/BasicTypes.h>
10 #include <boost/serialization/access.hpp>
11 #include <boost/serialization/base_object.hpp>
12 #include <boost/serialization/export.hpp>
15 namespace BinaryAnalysis {
16 namespace InstructionSemantics {
37 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
39 friend class boost::serialization::access;
42 void serialize(S &s,
const unsigned ) {
43 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
MemoryState);
44 s & BOOST_SERIALIZATION_NVP(protocell);
45 s & BOOST_SERIALIZATION_NVP(latestWrittenCell_);
56 MemoryCellState(
const MemoryCellState &other);
65 MemoryCellStatePtr retval = boost::dynamic_pointer_cast<
MemoryCellState>(m);
66 ASSERT_not_null(retval);
71 virtual void clear()
override;
78 return latestWrittenCell_;
81 latestWrittenCell_ = cell;
162 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
Base classes for instruction semantics.
virtual void latestWrittenCell(const MemoryCellPtr &cell)
Property: Cell most recently written.
virtual void updateReadProperties(const CellList &)
Adjust I/O properties after reading memory.
virtual void clear() override
Clear memory.
virtual void eraseMatchingCells(MemoryCell::Predicate &)=0
Remove all matching cells.
boost::shared_ptr< class MemoryCellState > MemoryCellStatePtr
Shared-ownership pointer to a cell-based memory state.
void eraseNonWritten()
Erase cells that have no writers.
virtual void eraseLeadingCells(MemoryCell::Predicate &)=0
Remove leading matching cells.
virtual AddressSet getWritersIntersection(const SValuePtr &addr, size_t nBits, RiscOperators *addrOps, RiscOperators *valOps)=0
Writers for an address.
Main namespace for the ROSE library.
virtual AddressSet getWritersUnion(const SValuePtr &addr, size_t nBits, RiscOperators *addrOps, RiscOperators *valOps)=0
Writers for an address.
boost::shared_ptr< MemoryCell > MemoryCellPtr
Shared-ownership pointer to a memory cell.
Predicate for non-written cells.
boost::shared_ptr< MemoryState > MemoryStatePtr
Shared-ownership pointer to a memory state.
virtual void updateWriteProperties(const CellList &, InputOutputPropertySet)
Adjust I/O properties after writing memory.
static MemoryCellStatePtr promote(const BaseSemantics::MemoryStatePtr &m)
Promote a base memory state pointer to a BaseSemantics::MemoryCellState pointer.
std::list< MemoryCellPtr > CellList
List of memory cells.
virtual MemoryCellPtr latestWrittenCell() const
Property: Cell most recently written.
virtual std::vector< MemoryCellPtr > matchingCells(MemoryCell::Predicate &) const =0
Find all matching cells.
Predicate that always returns true.
Sawyer::SharedPointer< SValue > SValuePtr
Shared-ownership pointer to a semantic value in any domain.
MemoryCellStatePtr Ptr
Shared-ownership pointer.
Predicate for matching cells.
Base class for most instruction semantics RISC operators.
Visitor for traversing a cells.
virtual std::vector< MemoryCellPtr > leadingCells(MemoryCell::Predicate &) const =0
Find leading matching cells.
virtual void traverse(MemoryCell::Visitor &)=0
Traverse and modify cells.
Represents all memory in the state.
std::vector< MemoryCellPtr > allCells() const
All cells.