ROSE  0.11.145.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super > Class Template Reference

Description

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
class Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >

Memory state.

Reading from an address that is either not writable (lacks MemoryMap::WRITABLE) or which is initialized (has MemoryMap::INITIALIZED) obtains the data directly from the memory map.

Addresses for each read operation are saved in a list which is nominally reset at the beginning of each instruction.

Definition at line 56 of file Semantics.h.

#include <Rose/BinaryAnalysis/Partitioner2/Semantics.h>

Inheritance diagram for Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >:
Collaboration graph
[legend]

Public Types

typedef boost::shared_ptr< MemoryStatePtr
 Shared-ownership pointer to a MemoryState. More...
 

Public Member Functions

virtual InstructionSemantics::BaseSemantics::MemoryStatePtr create (const InstructionSemantics::BaseSemantics::SValuePtr &addrProtoval, const InstructionSemantics::BaseSemantics::SValuePtr &valProtoval) const override
 Virtual constructor. More...
 
virtual InstructionSemantics::BaseSemantics::MemoryStatePtr create (const InstructionSemantics::BaseSemantics::MemoryCellPtr &protocell) const override
 Virtual constructor. More...
 
virtual InstructionSemantics::BaseSemantics::MemoryStatePtr clone () const override
 Virtual copy constructor. More...
 
virtual InstructionSemantics::BaseSemantics::SValuePtr readMemory (const InstructionSemantics::BaseSemantics::SValuePtr &addr, const InstructionSemantics::BaseSemantics::SValuePtr &dflt, InstructionSemantics::BaseSemantics::RiscOperators *addrOps, InstructionSemantics::BaseSemantics::RiscOperators *valOps) override
 
virtual void writeMemory (const InstructionSemantics::BaseSemantics::SValuePtr &addr, const InstructionSemantics::BaseSemantics::SValuePtr &value, InstructionSemantics::BaseSemantics::RiscOperators *addrOps, InstructionSemantics::BaseSemantics::RiscOperators *valOps) override
 
virtual InstructionSemantics::BaseSemantics::SValuePtr peekMemory (const InstructionSemantics::BaseSemantics::SValuePtr &addr, const InstructionSemantics::BaseSemantics::SValuePtr &dflt, InstructionSemantics::BaseSemantics::RiscOperators *addrOps, InstructionSemantics::BaseSemantics::RiscOperators *valOps) override
 
void print (std::ostream &, InstructionSemantics::BaseSemantics::Formatter &) const override
 
bool enabled () const
 Property: Enabled. More...
 
void enabled (bool b)
 Property: Enabled. More...
 
MemoryMap::Ptr memoryMap () const
 The memory map for the specimen. More...
 
void memoryMap (const MemoryMap::Ptr &map)
 The memory map for the specimen. More...
 
const std::vector< SValuePtr > & addressesRead () const
 Property: concrete virtual addresses that were read.
 
std::vector< SValuePtr > & addressesRead ()
 Property: concrete virtual addresses that were read.
 

Static Public Member Functions

static Ptr instance (const InstructionSemantics::BaseSemantics::MemoryCellPtr &protocell)
 Instantiates a new memory state having specified prototypical cells and value. More...
 
static Ptr instance (const InstructionSemantics::BaseSemantics::SValuePtr &addrProtoval, const InstructionSemantics::BaseSemantics::SValuePtr &valProtoval)
 Instantiates a new memory state having specified prototypical value. More...
 
static Ptr instance (const Ptr &other)
 Instantiates a new deep copy of an existing state. More...
 
static Ptr promote (const InstructionSemantics::BaseSemantics::MemoryStatePtr &x)
 Recasts a base pointer to a symbolic memory state. More...
 

Protected Member Functions

 MemoryState (const InstructionSemantics::BaseSemantics::MemoryCellPtr &protocell)
 
 MemoryState (const InstructionSemantics::BaseSemantics::SValuePtr &addrProtoval, const InstructionSemantics::BaseSemantics::SValuePtr &valProtoval)
 

Member Typedef Documentation

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
typedef boost::shared_ptr<MemoryState> Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::Ptr

Shared-ownership pointer to a MemoryState.

See Shared ownership.

Definition at line 59 of file Semantics.h.

Member Function Documentation

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
static Ptr Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::instance ( const InstructionSemantics::BaseSemantics::MemoryCellPtr protocell)
inlinestatic

Instantiates a new memory state having specified prototypical cells and value.

Definition at line 92 of file Semantics.h.

Referenced by Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::create().

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
static Ptr Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::instance ( const InstructionSemantics::BaseSemantics::SValuePtr addrProtoval,
const InstructionSemantics::BaseSemantics::SValuePtr valProtoval 
)
inlinestatic

Instantiates a new memory state having specified prototypical value.

Definition at line 97 of file Semantics.h.

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
static Ptr Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::instance ( const Ptr other)
inlinestatic

Instantiates a new deep copy of an existing state.

Definition at line 103 of file Semantics.h.

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
virtual InstructionSemantics::BaseSemantics::MemoryStatePtr Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::create ( const InstructionSemantics::BaseSemantics::SValuePtr addrProtoval,
const InstructionSemantics::BaseSemantics::SValuePtr valProtoval 
) const
inlineoverridevirtual

Virtual constructor.

Creates a memory state having specified prototypical value.

Definition at line 110 of file Semantics.h.

References Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::instance().

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
virtual InstructionSemantics::BaseSemantics::MemoryStatePtr Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::create ( const InstructionSemantics::BaseSemantics::MemoryCellPtr protocell) const
inlineoverridevirtual

Virtual constructor.

Creates a new memory state having specified prototypical cells and value.

Definition at line 117 of file Semantics.h.

References Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::instance().

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
virtual InstructionSemantics::BaseSemantics::MemoryStatePtr Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::clone ( ) const
inlineoverridevirtual

Virtual copy constructor.

Creates a new deep copy of this memory state.

Definition at line 123 of file Semantics.h.

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
static Ptr Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::promote ( const InstructionSemantics::BaseSemantics::MemoryStatePtr x)
inlinestatic

Recasts a base pointer to a symbolic memory state.

This is a checked cast that will fail if the specified pointer does not point to an object of our class.

Definition at line 131 of file Semantics.h.

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
bool Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::enabled ( ) const
inline

Property: Enabled.

A memory state can be disabled, in which case writes are ignored and reads always return a copy of the provided default value. Disabling a memory state is useful for certain data-flow analyses that don't need memory.

Definition at line 144 of file Semantics.h.

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
void Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::enabled ( bool  b)
inline

Property: Enabled.

A memory state can be disabled, in which case writes are ignored and reads always return a copy of the provided default value. Disabling a memory state is useful for certain data-flow analyses that don't need memory.

Definition at line 145 of file Semantics.h.

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
MemoryMap::Ptr Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::memoryMap ( ) const
inline

The memory map for the specimen.

If this memory map exists and contains segments that have read permission but lack write permission, then any reads from such addresses will return the concrete values read from the map. Any writes to such addresses will cause warnings and no operation to be performed.

Definition at line 155 of file Semantics.h.

template<class Super = InstructionSemantics::SymbolicSemantics::MemoryListState>
void Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::memoryMap ( const MemoryMap::Ptr map)
inline

The memory map for the specimen.

If this memory map exists and contains segments that have read permission but lack write permission, then any reads from such addresses will return the concrete values read from the map. Any writes to such addresses will cause warnings and no operation to be performed.

Definition at line 156 of file Semantics.h.


The documentation for this class was generated from the following file: