1#ifndef ROSE_BinaryAnalysis_InstructionSemantics_BaseSemantics_FrameState_H
2#define ROSE_BinaryAnalysis_InstructionSemantics_BaseSemantics_FrameState_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/BasicTypes.h>
7#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/AddressSpace.h>
8#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/MemoryState.h>
11namespace BinaryAnalysis {
12namespace InstructionSemantics {
69 std::vector<SValuePtr> stack_;
70 std::vector<SValuePtr> locals_;
74#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
76 friend class boost::serialization::access;
79 void serialize(S &s,
const unsigned ) {
80 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
MemoryState);
81 s & BOOST_SERIALIZATION_NVP(stack_);
82 s & BOOST_SERIALIZATION_NVP(locals_);
125 SValuePtr readLocal(uint8_t index)
override;
126 void writeLocal(uint8_t index,
const SValuePtr &value)
override;
142#ifdef ROSE_ENABLE_BOOST_SERIALIZATION
Purely symbolic memory state.
static FrameStatePtr instance(const SValuePtr &valProtoval)
Instantiate a new empty frame state on the heap.
virtual void writeMemory(const SValuePtr &address, const SValuePtr &value, RiscOperators *addrOps, RiscOperators *valOps) override
Write a value to memory.
virtual bool merge(const AddressSpacePtr &other, RiscOperators *addrOps, RiscOperators *valOps) override
Merge address spaces 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.
virtual void clear() override
Clear memory.
void pushOperand(const SValuePtr &value) override
Push an operand value to a frame.
static FrameStatePtr promote(const AddressSpacePtr &)
Convert pointer to a FrameState pointer.
FrameStatePtr Ptr
Shared-ownership pointer.
SValuePtr popOperand() override
Pop an operand value from a frame.
virtual SValuePtr readMemory(const SValuePtr &address, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps) override
Read a value from memory.
virtual void hash(Combinatorics::Hasher &, RiscOperators *addrOps, RiscOperators *valOps) const override
Hash this address space.
virtual MemoryStatePtr create(const SValuePtr &addrProtoval, const SValuePtr &valProtoval) const override
Virtual allocating constructor.
virtual AddressSpacePtr clone() const override
Deep-copy of this address space.
virtual void print(std::ostream &, Formatter &) const override
Print an address space.
Represents all memory in the state.
Base class for most instruction semantics RISC operators.
Base classes for instruction semantics.
boost::shared_ptr< MemoryState > MemoryStatePtr
Shared-ownership pointer to a memory state.
boost::shared_ptr< AddressSpace > AddressSpacePtr
Shared-ownership pointer for AddressSpace objects.
boost::shared_ptr< FrameState > FrameStatePtr
Shared-ownership pointer to a frame state.