ROSE  0.9.9.109
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell Class Reference

Description

Represents one location in memory.

MemoryCell objects are used by the MemoryCellList to represent a memory state. Each memory cell has an address and a value. A cell also has an optional list of instruction addresses that wrote to that cell, and this list is manipulated by the RiscOperators separately from updating cell addresses and values and according to settings in the RiscOperators. Cells written to by RiscOperators typically contain one writer address since each write operation creates a new cell; however, the result of a dataflow merge operation might produce cells that have multiple writers.

Definition at line 24 of file MemoryCell.h.

#include <MemoryCell.h>

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

Classes

class  AllCells
 Predicate that always returns true. More...
 
class  NonWrittenCells
 Predicate for non-written cells. More...
 
class  Predicate
 Predicate for matching cells. More...
 
class  Visitor
 Visitor for traversing a cells. More...
 
class  WithFormatter
 State with formatter. More...
 

Public Types

typedef Sawyer::Container::Set< rose_addr_t > AddressSet
 A set of concrete virtual addresses. More...
 

Public Member Functions

virtual MemoryCellPtr create (const SValuePtr &address, const SValuePtr &value)
 Creates a new memory cell object with the specified address and value. More...
 
virtual MemoryCellPtr clone () const
 Creates a new deep-copy of this memory cell. More...
 
virtual const AddressSetgetWriters () const
 Get writer information. More...
 
virtual void eraseWriters ()
 Erase all writers. More...
 
virtual boost::optional< rose_addr_t > get_latest_writer () const ROSE_DEPRECATED("use getWriters instead")
 
virtual void set_latest_writer (rose_addr_t writer_va) ROSE_DEPRECATED("use setWriter instead")
 
virtual void clear_latest_writer () ROSE_DEPRECATED("use clearWriters instead")
 
virtual Sawyer::Optional< rose_addr_t > latestWriter () const ROSE_DEPRECATED("use getWriters instead")
 
virtual void latestWriter (rose_addr_t writerVa) ROSE_DEPRECATED("use setWriter instead")
 
virtual void latestWriter (const Sawyer::Optional< rose_addr_t > w) ROSE_DEPRECATED("use setWriter instead")
 
virtual void clearLatestWriter () ROSE_DEPRECATED("use eraseWrites instead")
 
virtual bool may_alias (const MemoryCellPtr &other, RiscOperators *addrOps) const
 Determines whether two memory cells can alias one another. More...
 
virtual bool must_alias (const MemoryCellPtr &other, RiscOperators *addrOps) const
 Determines whether two memory cells must alias one another. More...
 
virtual SValuePtr get_address () const
 Accessor for the memory cell address.
 
virtual void set_address (const SValuePtr &addr)
 Accessor for the memory cell address.
 
virtual SValuePtr get_value () const
 Accessor for the value stored at a memory location.
 
virtual void set_value (const SValuePtr &v)
 Accessor for the value stored at a memory location.
 
bool insertWriter (rose_addr_t writerVa)
 Insert writer information. More...
 
virtual bool insertWriters (const AddressSet &writerVas)
 Insert writer information. More...
 
bool eraseWriter (rose_addr_t writerVa)
 Erase specified writers. More...
 
virtual bool eraseWriters (const AddressSet &writerVas)
 Erase specified writers. More...
 
void setWriter (rose_addr_t writerVa)
 Sets writer information. More...
 
virtual void setWriters (const AddressSet &writerVas)
 Sets writer information. More...
 
const InputOutputPropertySetioProperties () const
 Properties: Boolean property set. More...
 
InputOutputPropertySetioProperties ()
 Properties: Boolean property set. More...
 
void print (std::ostream &stream) const
 Print the memory cell on a single line.
 
virtual void print (std::ostream &, Formatter &) const
 Print the memory cell on a single line.
 
WithFormatter with_format (Formatter &fmt)
 Used for printing states with formatting. More...
 
WithFormatter operator+ (Formatter &fmt)
 Used for printing states with formatting. More...
 

Static Public Member Functions

static MemoryCellPtr instance (const SValuePtr &address, const SValuePtr &value)
 Instantiates a new memory cell object with the specified address and value. More...
 
static MemoryCellPtr instance (const MemoryCellPtr &other)
 Instantiates a new copy of an existing cell. More...
 
static MemoryCellPtr promote (const MemoryCellPtr &x)
 

Protected Member Functions

 MemoryCell (const SValuePtr &address, const SValuePtr &value)
 
 MemoryCell (const MemoryCell &other)
 

Member Typedef Documentation

A set of concrete virtual addresses.

Definition at line 26 of file MemoryCell.h.

Member Function Documentation

static MemoryCellPtr Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::instance ( const SValuePtr address,
const SValuePtr value 
)
inlinestatic

Instantiates a new memory cell object with the specified address and value.

Definition at line 107 of file MemoryCell.h.

Referenced by create().

static MemoryCellPtr Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::instance ( const MemoryCellPtr other)
inlinestatic

Instantiates a new copy of an existing cell.

Definition at line 112 of file MemoryCell.h.

virtual MemoryCellPtr Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::create ( const SValuePtr address,
const SValuePtr value 
)
inlinevirtual

Creates a new memory cell object with the specified address and value.

Definition at line 120 of file MemoryCell.h.

References instance().

virtual MemoryCellPtr Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::clone ( ) const
inlinevirtual

Creates a new deep-copy of this memory cell.

Definition at line 125 of file MemoryCell.h.

virtual const AddressSet& Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::getWriters ( ) const
inlinevirtual

Get writer information.

Returns all instruction addresses that have written to the specified memory address.

Definition at line 161 of file MemoryCell.h.

bool Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::insertWriter ( rose_addr_t  writerVa)
inline

Insert writer information.

Insert the specified instruction addresses as writers for this memory cell. Returns true if any address was inserted, false if they were all already members.

Definition at line 171 of file MemoryCell.h.

References Sawyer::Container::Set< T, C, A >::insert().

virtual bool Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::insertWriters ( const AddressSet writerVas)
inlinevirtual

Insert writer information.

Insert the specified instruction addresses as writers for this memory cell. Returns true if any address was inserted, false if they were all already members.

Definition at line 172 of file MemoryCell.h.

References Sawyer::Container::Set< T, C, A >::insert().

bool Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::eraseWriter ( rose_addr_t  writerVa)
inline

Erase specified writers.

Removes the specified addresses from the set of writers for this memory cell. Returns true if none of the writer addresses existed, false if any were removed.

Definition at line 181 of file MemoryCell.h.

References Sawyer::Container::Set< T, C, A >::erase().

virtual bool Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::eraseWriters ( const AddressSet writerVas)
inlinevirtual

Erase specified writers.

Removes the specified addresses from the set of writers for this memory cell. Returns true if none of the writer addresses existed, false if any were removed.

Definition at line 182 of file MemoryCell.h.

References Sawyer::Container::Set< T, C, A >::erase().

void Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::setWriter ( rose_addr_t  writerVa)

Sets writer information.

Changes writer information to be excactly the specified address or set of addresses.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::setWriters ( const AddressSet writerVas)
inlinevirtual

Sets writer information.

Changes writer information to be excactly the specified address or set of addresses.

Definition at line 191 of file MemoryCell.h.

References Sawyer::Container::Set< T, C, A >::insert().

virtual void Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::eraseWriters ( )
inlinevirtual

Erase all writers.

Erases all writer information for this memory cell.

Definition at line 197 of file MemoryCell.h.

References Sawyer::Container::Set< T, C, A >::clear().

const InputOutputPropertySet& Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::ioProperties ( ) const
inline

Properties: Boolean property set.

This set holds Boolean input/output properties. If a property is present in the set then it is considered to be true, otherwise false.

Definition at line 205 of file MemoryCell.h.

InputOutputPropertySet& Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::ioProperties ( )
inline

Properties: Boolean property set.

This set holds Boolean input/output properties. If a property is present in the set then it is considered to be true, otherwise false.

Definition at line 206 of file MemoryCell.h.

virtual bool Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::may_alias ( const MemoryCellPtr other,
RiscOperators addrOps 
) const
virtual

Determines whether two memory cells can alias one another.

Two cells may alias one another if it is possible that their addresses cause them to overlap. For cells containing one-byte values, aliasing may occur if their two addresses may be equal; multi-byte cells will need to check ranges of addresses.

virtual bool Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::must_alias ( const MemoryCellPtr other,
RiscOperators addrOps 
) const
virtual

Determines whether two memory cells must alias one another.

Two cells must alias one another when it can be proven that their addresses cause them to overlap. For cells containing one-byte values, aliasing must occur unless their addresses can be different; multi-byte cells will need to check ranges of addresses.

WithFormatter Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::with_format ( Formatter fmt)
inline

Used for printing states with formatting.

The usual way to use this is:

MemoryCellPtr obj = ...;
Formatter fmt = ...;
std::cout <<"The value is: " <<(*obj+fmt) <<"\n";

Definition at line 281 of file MemoryCell.h.

Referenced by operator+().

WithFormatter Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::MemoryCell::operator+ ( Formatter fmt)
inline

Used for printing states with formatting.

The usual way to use this is:

MemoryCellPtr obj = ...;
Formatter fmt = ...;
std::cout <<"The value is: " <<(*obj+fmt) <<"\n";

Definition at line 282 of file MemoryCell.h.

References with_format().


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