ROSE  0.11.98.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State Class Reference

Description

Represents the entire state of the machine.

This state expects to use a subclass of BaseSemantics::MemoryCellList as its memory state, and does not expect that MemoryCellList to be byte-restricted.

Definition at line 256 of file PartialSymbolicSemantics.h.

#include <Rose/BinaryAnalysis/InstructionSemantics/PartialSymbolicSemantics.h>

Inheritance diagram for Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State:
Collaboration graph
[legend]

Public Types

using Super = BaseSemantics::State
 Base type. More...
 
using Ptr = StatePtr
 Shared-ownership pointer. More...
 
- Public Types inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State
using Ptr = StatePtr
 Shared-ownership pointer for a State. More...
 

Public Member Functions

virtual BaseSemantics::StatePtr create (const BaseSemantics::RegisterStatePtr &registers, const BaseSemantics::MemoryStatePtr &memory) const override
 Virtual constructor. More...
 
virtual BaseSemantics::StatePtr clone () const override
 Virtual copy constructor. More...
 
virtual void print_diff_registers (std::ostream &, const StatePtr &other_state, Formatter &) const
 Print info about how registers differ. More...
 
virtual bool equal_registers (const StatePtr &other) const
 Tests registers of two states for equality. More...
 
virtual void discard_popped_memory ()
 Removes from memory those values at addresses below the current stack pointer. More...
 
- Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State
SValuePtr protoval () const
 Return the protoval. More...
 
virtual void clear ()
 Initialize state. More...
 
void zeroRegisters ()
 Initialize all registers to zero. More...
 
void clearMemory ()
 Clear all memory locations. More...
 
RegisterStatePtr registerState () const
 Property: Register state. More...
 
MemoryStatePtr memoryState () const
 Property: Memory state. More...
 
virtual SValuePtr readRegister (RegisterDescriptor desc, const SValuePtr &dflt, RiscOperators *ops)
 Read a value from a register. More...
 
virtual SValuePtr peekRegister (RegisterDescriptor desc, const SValuePtr &dflt, RiscOperators *ops)
 Read register without side effects. More...
 
virtual void writeRegister (RegisterDescriptor desc, const SValuePtr &value, RiscOperators *ops)
 Write a value to a register. More...
 
virtual SValuePtr readMemory (const SValuePtr &address, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps)
 Read a value from memory. More...
 
virtual SValuePtr peekMemory (const SValuePtr &address, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps)
 Read from memory without side effects. More...
 
virtual void writeMemory (const SValuePtr &addr, const SValuePtr &value, RiscOperators *addrOps, RiscOperators *valOps)
 Write a value to memory. More...
 
virtual void hash (Combinatorics::Hasher &, RiscOperators *addrOps, RiscOperators *valOps) const
 Compute a hash of the state. More...
 
std::string toString () const
 Convert the state to a string for debugging. More...
 
virtual bool merge (const StatePtr &other, RiscOperators *ops)
 Merge operation for data flow analysis. More...
 
void printRegisters (std::ostream &stream, const std::string &prefix="")
 Print the register contents. More...
 
virtual void printRegisters (std::ostream &stream, Formatter &fmt) const
 Print the register contents. More...
 
void printMemory (std::ostream &stream, const std::string &prefix="") const
 Print memory contents. More...
 
virtual void printMemory (std::ostream &stream, Formatter &fmt) const
 Print memory contents. More...
 
void print (std::ostream &stream, const std::string &prefix="") const
 Print the state. More...
 
virtual void print (std::ostream &, Formatter &) const
 Print the state. More...
 
WithFormatter with_format (Formatter &fmt)
 Used for printing states with formatting. More...
 
WithFormatter operator+ (Formatter &fmt)
 Used for printing states with formatting. More...
 
WithFormatter operator+ (const std::string &linePrefix)
 Used for printing states with formatting. More...
 

Static Public Member Functions

static StatePtr instance (const BaseSemantics::RegisterStatePtr &registers, const BaseSemantics::MemoryStatePtr &memory)
 Instantiates a new instance of memory state with specified register and memory states. More...
 
static StatePtr instance (const StatePtr &other)
 Instantiates a new copy of an existing state. More...
 
static StatePtr promote (const BaseSemantics::StatePtr &x)
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State
static StatePtr instance (const RegisterStatePtr &registers, const MemoryStatePtr &memory)
 Instantiate a new state object with specified register and memory states. More...
 
static StatePtr instance (const StatePtr &other)
 Instantiate a new copy of an existing state. More...
 
static StatePtr promote (const StatePtr &x)
 

Protected Member Functions

 State (const BaseSemantics::RegisterStatePtr &registers, const BaseSemantics::MemoryStatePtr &memory)
 
 State (const State &other)
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State
 State (const RegisterStatePtr &registers, const MemoryStatePtr &memory)
 
 State (const State &other)
 

Member Typedef Documentation

Base type.

Definition at line 259 of file PartialSymbolicSemantics.h.

Shared-ownership pointer.

Definition at line 262 of file PartialSymbolicSemantics.h.

Member Function Documentation

static StatePtr Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::instance ( const BaseSemantics::RegisterStatePtr registers,
const BaseSemantics::MemoryStatePtr memory 
)
inlinestatic

Instantiates a new instance of memory state with specified register and memory states.

Definition at line 288 of file PartialSymbolicSemantics.h.

Referenced by clone(), and create().

static StatePtr Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::instance ( const StatePtr other)
inlinestatic

Instantiates a new copy of an existing state.

Definition at line 294 of file PartialSymbolicSemantics.h.

virtual BaseSemantics::StatePtr Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::create ( const BaseSemantics::RegisterStatePtr registers,
const BaseSemantics::MemoryStatePtr memory 
) const
inlineoverridevirtual

Virtual constructor.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State.

Definition at line 301 of file PartialSymbolicSemantics.h.

References instance().

virtual BaseSemantics::StatePtr Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::clone ( ) const
inlineoverridevirtual

Virtual copy constructor.

Allocates a new state object which is a deep copy of this state. States must be copyable objects because many analyses depend on being able to make a copy of the entire semantic state at each machine instruction, at each CFG vertex, etc.

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics::BaseSemantics::State.

Definition at line 306 of file PartialSymbolicSemantics.h.

References instance().

virtual void Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::print_diff_registers ( std::ostream &  ,
const StatePtr other_state,
Formatter  
) const
virtual

Print info about how registers differ.

If a RenameMap is specified then named values will be renamed to have a shorter name.

virtual bool Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::equal_registers ( const StatePtr other) const
virtual

Tests registers of two states for equality.

virtual void Rose::BinaryAnalysis::InstructionSemantics::PartialSymbolicSemantics::State::discard_popped_memory ( )
virtual

Removes from memory those values at addresses below the current stack pointer.

This is automatically called after each instruction if the policy's p_discard_popped_memory property is set.


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