ROSE  0.9.9.139
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState Class Referenceabstract

Description

Cell-based memory state.

This is the base class for cell-based memory states.

Definition at line 22 of file MemoryCellState.h.

#include <MemoryCellState.h>

Inheritance diagram for Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState:
Collaboration graph
[legend]

Public Member Functions

virtual void clear () ROSE_OVERRIDE
 Clear memory. More...
 
virtual MemoryCell::AddressSet getWritersUnion (const SValuePtr &addr, size_t nBits, RiscOperators *addrOps, RiscOperators *valOps)=0
 Writers for an address. More...
 
virtual MemoryCell::AddressSet getWritersIntersection (const SValuePtr &addr, size_t nBits, RiscOperators *addrOps, RiscOperators *valOps)=0
 Writers for an address. More...
 
virtual std::vector< MemoryCellPtrmatchingCells (const MemoryCell::Predicate &) const =0
 Find all matching cells. More...
 
virtual std::vector< MemoryCellPtrleadingCells (const MemoryCell::Predicate &) const =0
 Find leading matching cells. More...
 
virtual void eraseMatchingCells (const MemoryCell::Predicate &)=0
 Remove all matching cells. More...
 
virtual void eraseLeadingCells (const MemoryCell::Predicate &)=0
 Remove leading matching cells. More...
 
virtual void traverse (MemoryCell::Visitor &)=0
 Traverse and modify cells. More...
 
void eraseNonWritten ()
 Erase cells that have no writers. More...
 
std::vector< MemoryCellPtrallCells () const
 All cells. More...
 
virtual MemoryCellPtr latestWrittenCell () const
 Property: Cell most recently written.
 
virtual void latestWrittenCell (const MemoryCellPtr &cell)
 Property: Cell most recently written.
 
- Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryState
virtual MemoryStatePtr create (const SValuePtr &addrProtoval, const SValuePtr &valProtoval) const =0
 Virtual allocating constructor. More...
 
virtual MemoryStatePtr clone () const =0
 Virtual allocating copy constructor. More...
 
SValuePtr get_addr_protoval () const
 Return the address protoval. More...
 
SValuePtr get_val_protoval () const
 Return the value protoval. More...
 
virtual bool merge (const MemoryStatePtr &other, RiscOperators *addrOps, RiscOperators *valOps)=0
 Merge memory states for data flow analysis. More...
 
virtual SValuePtr readMemory (const SValuePtr &address, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps)=0
 Read a value from memory. More...
 
virtual void writeMemory (const SValuePtr &addr, const SValuePtr &value, RiscOperators *addrOps, RiscOperators *valOps)=0
 Write a value to memory. More...
 
MergerPtr merger () const
 Property: Merger. More...
 
void merger (const MergerPtr &m)
 Property: Merger. More...
 
bool byteRestricted () const
 Indicates whether memory cell values are required to be eight bits wide. More...
 
void byteRestricted (bool b)
 Indicates whether memory cell values are required to be eight bits wide. More...
 
ByteOrder::Endianness get_byteOrder () const
 Memory byte order.
 
void set_byteOrder (ByteOrder::Endianness bo)
 Memory byte order.
 
void print (std::ostream &stream, const std::string prefix="") const
 Print a memory state to more than one line of output.
 
virtual void print (std::ostream &, Formatter &) const =0
 Print a memory state to more than one line of output.
 
WithFormatter with_format (Formatter &fmt)
 Used for printing memory states with formatting. More...
 
WithFormatter operator+ (Formatter &fmt)
 Used for printing memory states with formatting. More...
 

Static Public Member Functions

static MemoryCellStatePtr promote (const BaseSemantics::MemoryStatePtr &m)
 Promote a base memory state pointer to a BaseSemantics::MemoryCellState pointer. More...
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryState
static MemoryStatePtr promote (const MemoryStatePtr &x)
 

Protected Member Functions

 MemoryCellState (const MemoryCellPtr &protocell)
 
 MemoryCellState (const SValuePtr &addrProtoval, const SValuePtr &valProtoval)
 
 MemoryCellState (const MemoryCellState &other)
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryState
 MemoryState (const SValuePtr &addrProtoval, const SValuePtr &valProtoval)
 
 MemoryState (const MemoryStatePtr &other)
 

Protected Attributes

MemoryCellPtr protocell
 
MemoryCellPtr latestWrittenCell_
 

Additional Inherited Members

- Public Types inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryState
typedef MemoryStatePtr Ptr
 Shared-ownership pointer for a MemoryState. More...
 

Member Function Documentation

static MemoryCellStatePtr Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::promote ( const BaseSemantics::MemoryStatePtr m)
inlinestatic

Promote a base memory state pointer to a BaseSemantics::MemoryCellState pointer.

The memory state m must have a BaseSemantics::MemoryCellState dynamic type.

Definition at line 54 of file MemoryCellState.h.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::clear ( )
virtual
virtual MemoryCell::AddressSet Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::getWritersUnion ( const SValuePtr addr,
size_t  nBits,
RiscOperators addrOps,
RiscOperators valOps 
)
pure virtual

Writers for an address.

Returns the set of all writers that wrote to the specified address or any address that might alias the specified address. Memory states that don't normally compute aliases (e.g., MemoryCellMap) return only the writers for the specified address, not any aliases, and in this case getWritersUnion and getWritersIntersection return the same set.

Implemented in Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellList, and Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellMap.

virtual MemoryCell::AddressSet Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::getWritersIntersection ( const SValuePtr addr,
size_t  nBits,
RiscOperators addrOps,
RiscOperators valOps 
)
pure virtual

Writers for an address.

Returns the set of all writers that wrote to the specified address and any address that might alias the specified address. Memory states that don't normally compute aliases (e.g., MemoryCellMap) return only the writers for the specified address, not any aliases, and in this case getWritersUnion and getWritersIntersection return the same set.

Implemented in Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellList, and Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellMap.

virtual std::vector<MemoryCellPtr> Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::matchingCells ( const MemoryCell::Predicate ) const
pure virtual

Find all matching cells.

Returns a vector of cells for which the predicate returns true.

Implemented in Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellList, and Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellMap.

Referenced by allCells().

virtual std::vector<MemoryCellPtr> Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::leadingCells ( const MemoryCell::Predicate ) const
pure virtual

Find leading matching cells.

Returns the vector of cells obtained by invoking the predicate on each cell and returning those leading cells for which the predicate is true. The first cell for which the predicate is false terminates the traversal and does not appear in the return value.

Implemented in Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellList, and Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellMap.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::eraseMatchingCells ( const MemoryCell::Predicate )
pure virtual

Remove all matching cells.

Traverses the memory cells and removes those for which the predicate returns true.

Implemented in Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellList, and Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellMap.

Referenced by eraseNonWritten().

virtual void Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::eraseLeadingCells ( const MemoryCell::Predicate )
pure virtual

Remove leading matching cells.

Traverses the memory cells and removes those for which the predicate returns true. The traversal is terminated the first time the predicate returns false.

Implemented in Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellList, and Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellMap.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::traverse ( MemoryCell::Visitor )
pure virtual
void Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::eraseNonWritten ( )
inline

Erase cells that have no writers.

Definition at line 122 of file MemoryCellState.h.

References eraseMatchingCells().

std::vector<MemoryCellPtr> Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCellState::allCells ( ) const
inline

All cells.

Definition at line 127 of file MemoryCellState.h.

References matchingCells().


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